arm64: zynqmp: Do not duplicate flash partition label property
Subsystems (11)
Sasha Levin
maintainerPATCH 1/75 arm64: zynqmp: Do not duplicate flash partition label property
From: Amit Kumar Mahapatra <[email protected]>
[ Upstream commit 167721a5909f867f8c18c8e78ea58e705ad9bbd4 ]
In kernel 5.4, support has been added for reading MTD devices via the nvmem API.
For this the mtd devices are registered as read-only NVMEM providers under sysfs with the same name as the flash partition label property.
So if flash partition label property of multiple flash devices are identical then the second mtd device fails to get registered as a NVMEM provider.
This patch fixes the issue by having different label property for different flashes.
--- arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts +2 -2
@@ -131,7 +131,7 @@ reg = <0>; partition@0 { - label = "data"; + label = "spi0-data"; reg = <0x0 0x100000>; }; };
@@ -149,7 +149,7 @@ reg = <0>; partition@0 { - label = "data"; + label = "spi1-data"; reg = <0x0 0x84000>; }; };
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 2/75 arm64: zynqmp: Fix serial compatible string
From: Michal Simek <[email protected]>
[ Upstream commit 812fa2f0e9d33564bd0131a69750e0d165f4c82a ]
Based on commit 65a2c14d4f00 ("dt-bindings: serial: convert Cadence UART bindings to YAML") compatible string should look like differently that's why fix it to be aligned with dt binding.
--- arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/xilinx/zynqmp.dtsi +2 -2
@@ -792,7 +792,7 @@ }; uart0: serial@ff000000 { - compatible = "cdns,uart-r1p12", "xlnx,xuartps"; + compatible = "xlnx,zynqmp-uart", "cdns,uart-r1p12"; status = "disabled"; interrupt-parent = <&gic>; interrupts = <0 21 4>;
@@ -802,7 +802,7 @@ }; uart1: serial@ff010000 { - compatible = "cdns,uart-r1p12", "xlnx,xuartps"; + compatible = "xlnx,zynqmp-uart", "cdns,uart-r1p12"; status = "disabled"; interrupt-parent = <&gic>; interrupts = <0 22 4>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 3/75 clk: sunxi-ng: Unregister clocks/resets when unbinding
In reply to Sasha LevinFrom: Samuel Holland <[email protected]>
[ Upstream commit 9bec2b9c6134052994115d2d3374e96f2ccb9b9d ]
Currently, unbinding a CCU driver unmaps the device's MMIO region, while leaving its clocks/resets and their providers registered. This can cause a page fault later when some clock operation tries to perform MMIO. Fix this by separating the CCU initialization from the memory allocation, and then using a devres callback to unregister the clocks and resets.
This also fixes a memory leak of the struct ccu_reset, and uses the correct owner (the specific platform driver) for the clocks and resets.
Early OF clock providers are never unregistered, and limited error handling is possible, so they are mostly unchanged. The error reporting is made more consistent by moving the message inside of_sunxi_ccu_probe.
--- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 2 +- drivers/clk/sunxi-ng/ccu-sun50i-a100-r.c | 2 +- drivers/clk/sunxi-ng/ccu-sun50i-a100.c | 2 +- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 2 +- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 2 +- drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 2 +- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 4 +- drivers/clk/sunxi-ng/ccu-sun5i.c | 2 +- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 2 +- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 2 +- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 2 +- drivers/clk/sunxi-ng/ccu-sun8i-a83t.c | 2 +- drivers/clk/sunxi-ng/ccu-sun8i-de2.c | 2 +- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 2 +- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 2 +- drivers/clk/sunxi-ng/ccu-sun8i-r40.c | 2 +- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 2 +- drivers/clk/sunxi-ng/ccu-sun9i-a80-de.c | 3 +- drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c | 3 +- drivers/clk/sunxi-ng/ccu-sun9i-a80.c | 2 +- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 2 +- drivers/clk/sunxi-ng/ccu_common.c | 89 ++++++++++++++++++++---- drivers/clk/sunxi-ng/ccu_common.h | 6 +- 23 files changed, 100 insertions(+), 41 deletions(-)
drivers/clk/sunxi-ng/ccu-sun4i-a10.c +1 -1
@@ -1464,7 +1464,7 @@ static void __init sun4i_ccu_init(struct device_node *node, val &= ~GENMASK (7 ,6 );writel (val | (2 <<6 ), reg +SUN4I_AHB_REG ); -sunxi_ccu_probe (node, reg, desc); +of_sunxi_ccu_probe (node, reg, desc); }static void __init sun4i_a10_ccu_setup (struct device_node *node)
drivers/clk/sunxi-ng/ccu-sun50i-a100-r.c +1 -1
@@ -196,7 +196,7 @@ static int sun50i_a100_r_ccu_probe(struct platform_device *pdev)if (IS_ERR (reg))return PTR_ERR (reg); -return sunxi_ccu_probe (pdev->dev.of_node, reg, &sun50i_a100_r_ccu_desc); +return devm_sunxi_ccu_probe (&pdev->dev, reg, &sun50i_a100_r_ccu_desc); }static const struct of_device_id sun50i_a100_r_ccu_ids[] = {
drivers/clk/sunxi-ng/ccu-sun50i-a100.c +1 -1
@@ -1247,7 +1247,7 @@ static int sun50i_a100_ccu_probe(struct platform_device *pdev)writel (val, reg + sun50i_a100_usb2_clk_regs[i]); } - ret =sunxi_ccu_probe (pdev->dev.of_node, reg, &sun50i_a100_ccu_desc); + ret =devm_sunxi_ccu_probe (&pdev->dev, reg, &sun50i_a100_ccu_desc);if (ret)return ret;
drivers/clk/sunxi-ng/ccu-sun50i-a64.c +1 -1
@@ -955,7 +955,7 @@ static int sun50i_a64_ccu_probe(struct platform_device *pdev)writel (0x515 , reg +SUN50I_A64_PLL_MIPI_REG ); - ret =sunxi_ccu_probe (pdev->dev.of_node, reg, &sun50i_a64_ccu_desc); + ret =devm_sunxi_ccu_probe (&pdev->dev, reg, &sun50i_a64_ccu_desc);if (ret)return ret;
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +1 -1
@@ -232,7 +232,7 @@ static void __init sunxi_r_ccu_init(struct device_node *node,return ; } -sunxi_ccu_probe (node, reg, desc); +of_sunxi_ccu_probe (node, reg, desc); }static void __init sun50i_h6_r_ccu_setup (struct device_node *node)
drivers/clk/sunxi-ng/ccu-sun50i-h6.c +1 -1
@@ -1240,7 +1240,7 @@ static int sun50i_h6_ccu_probe(struct platform_device *pdev) val |=BIT (24 );writel (val, reg +SUN50I_H6_HDMI_CEC_CLK_REG ); -return sunxi_ccu_probe (pdev->dev.of_node, reg, &sun50i_h6_ccu_desc); +return devm_sunxi_ccu_probe (&pdev->dev, reg, &sun50i_h6_ccu_desc); }static const struct of_device_id sun50i_h6_ccu_ids[] = {
drivers/clk/sunxi-ng/ccu-sun50i-h616.c +1 -3
@@ -1141,9 +1141,7 @@ static void __init sun50i_h616_ccu_setup(struct device_node *node) val |=BIT (24 );writel (val, reg +SUN50I_H616_HDMI_CEC_CLK_REG ); - i =sunxi_ccu_probe (node, reg, &sun50i_h616_ccu_desc); -if (i) -pr_err ("%pOF: probing clocks fails: %d\n" , node, i); +of_sunxi_ccu_probe (node, reg, &sun50i_h616_ccu_desc); } CLK_OF_DECLARE(sun50i_h616_ccu, "allwinner,sun50i-h616-ccu",
drivers/clk/sunxi-ng/ccu-sun5i.c +1 -1
@@ -1012,7 +1012,7 @@ static void __init sun5i_ccu_init(struct device_node *node, val &= ~GENMASK (7 ,6 );writel (val | (2 <<6 ), reg +SUN5I_AHB_REG ); -sunxi_ccu_probe (node, reg, desc); +of_sunxi_ccu_probe (node, reg, desc); }static void __init sun5i_a10s_ccu_setup (struct device_node *node)
drivers/clk/sunxi-ng/ccu-sun6i-a31.c +1 -1
@@ -1257,7 +1257,7 @@ static void __init sun6i_a31_ccu_setup(struct device_node *node) val |=0x3 <<12 ;writel (val, reg +SUN6I_A31_AHB1_REG ); -sunxi_ccu_probe (node, reg, &sun6i_a31_ccu_desc); +of_sunxi_ccu_probe (node, reg, &sun6i_a31_ccu_desc);ccu_mux_notifier_register (pll_cpu_clk.common.hw.clk, &sun6i_a31_cpu_nb);
drivers/clk/sunxi-ng/ccu-sun8i-a23.c +1 -1
@@ -745,7 +745,7 @@ static void __init sun8i_a23_ccu_setup(struct device_node *node) val &= ~BIT (16 );writel (val, reg +SUN8I_A23_PLL_MIPI_REG ); -sunxi_ccu_probe (node, reg, &sun8i_a23_ccu_desc); +of_sunxi_ccu_probe (node, reg, &sun8i_a23_ccu_desc); }CLK_OF_DECLARE (sun8i_a23_ccu,"allwinner,sun8i-a23-ccu" , sun8i_a23_ccu_setup);
drivers/clk/sunxi-ng/ccu-sun8i-a33.c +1 -1
@@ -805,7 +805,7 @@ static void __init sun8i_a33_ccu_setup(struct device_node *node) val &= ~BIT (16 );writel (val, reg +SUN8I_A33_PLL_MIPI_REG ); -sunxi_ccu_probe (node, reg, &sun8i_a33_ccu_desc); +of_sunxi_ccu_probe (node, reg, &sun8i_a33_ccu_desc);/* Gate then ungate PLL CPU after any rate changes */ ccu_pll_notifier_register (&sun8i_a33_pll_cpu_nb);
drivers/clk/sunxi-ng/ccu-sun8i-a83t.c +1 -1
@@ -906,7 +906,7 @@ static int sun8i_a83t_ccu_probe(struct platform_device *pdev)sun8i_a83t_cpu_pll_fixup (reg +SUN8I_A83T_PLL_C0CPUX_REG );sun8i_a83t_cpu_pll_fixup (reg +SUN8I_A83T_PLL_C1CPUX_REG ); -return sunxi_ccu_probe (pdev->dev.of_node, reg, &sun8i_a83t_ccu_desc); +return devm_sunxi_ccu_probe (&pdev->dev, reg, &sun8i_a83t_ccu_desc); }static const struct of_device_id sun8i_a83t_ccu_ids[] = {
drivers/clk/sunxi-ng/ccu-sun8i-de2.c +1 -1
@@ -342,7 +342,7 @@ static int sunxi_de2_clk_probe(struct platform_device *pdev) goto err_disable_mod_clk; } - ret =sunxi_ccu_probe (pdev->dev.of_node, reg, ccu_desc); + ret =devm_sunxi_ccu_probe (&pdev->dev, reg, ccu_desc);if (ret) goto err_assert_reset;
drivers/clk/sunxi-ng/ccu-sun8i-h3.c +1 -1
@@ -1154,7 +1154,7 @@ static void __init sunxi_h3_h5_ccu_init(struct device_node *node, val &= ~GENMASK (19 ,16 );writel (val | (0 <<16 ), reg +SUN8I_H3_PLL_AUDIO_REG ); -sunxi_ccu_probe (node, reg, desc); +of_sunxi_ccu_probe (node, reg, desc);/* Gate then ungate PLL CPU after any rate changes */ ccu_pll_notifier_register (&sun8i_h3_pll_cpu_nb);
drivers/clk/sunxi-ng/ccu-sun8i-r.c +1 -1
@@ -265,7 +265,7 @@ static void __init sunxi_r_ccu_init(struct device_node *node,return ; } -sunxi_ccu_probe (node, reg, desc); +of_sunxi_ccu_probe (node, reg, desc); }static void __init sun8i_a83t_r_ccu_setup (struct device_node *node)
drivers/clk/sunxi-ng/ccu-sun8i-r40.c +1 -1
@@ -1346,7 +1346,7 @@ static int sun8i_r40_ccu_probe(struct platform_device *pdev)if (IS_ERR (regmap))return PTR_ERR (regmap); - ret =sunxi_ccu_probe (pdev->dev.of_node, reg, &sun8i_r40_ccu_desc); + ret =devm_sunxi_ccu_probe (&pdev->dev, reg, &sun8i_r40_ccu_desc);if (ret)return ret;
drivers/clk/sunxi-ng/ccu-sun8i-v3s.c +1 -1
@@ -822,7 +822,7 @@ static void __init sun8i_v3_v3s_ccu_init(struct device_node *node, val &= ~GENMASK (19 ,16 );writel (val, reg +SUN8I_V3S_PLL_AUDIO_REG ); -sunxi_ccu_probe (node, reg, ccu_desc); +of_sunxi_ccu_probe (node, reg, ccu_desc); }static void __init sun8i_v3s_ccu_setup (struct device_node *node)
drivers/clk/sunxi-ng/ccu-sun9i-a80-de.c +1 -2
@@ -246,8 +246,7 @@ static int sun9i_a80_de_clk_probe(struct platform_device *pdev) goto err_disable_clk; } - ret =sunxi_ccu_probe (pdev->dev.of_node, reg, - &sun9i_a80_de_clk_desc); + ret =devm_sunxi_ccu_probe (&pdev->dev, reg, &sun9i_a80_de_clk_desc);if (ret) goto err_assert_reset;
drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c +1 -2
@@ -117,8 +117,7 @@ static int sun9i_a80_usb_clk_probe(struct platform_device *pdev)return ret; } - ret =sunxi_ccu_probe (pdev->dev.of_node, reg, - &sun9i_a80_usb_clk_desc); + ret =devm_sunxi_ccu_probe (&pdev->dev, reg, &sun9i_a80_usb_clk_desc);if (ret) goto err_disable_clk;
drivers/clk/sunxi-ng/ccu-sun9i-a80.c +1 -1
@@ -1231,7 +1231,7 @@ static int sun9i_a80_ccu_probe(struct platform_device *pdev)sun9i_a80_cpu_pll_fixup (reg +SUN9I_A80_PLL_C0CPUX_REG );sun9i_a80_cpu_pll_fixup (reg +SUN9I_A80_PLL_C1CPUX_REG ); -return sunxi_ccu_probe (pdev->dev.of_node, reg, &sun9i_a80_ccu_desc); +return devm_sunxi_ccu_probe (&pdev->dev, reg, &sun9i_a80_ccu_desc); }static const struct of_device_id sun9i_a80_ccu_ids[] = {
drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c +1 -1
@@ -538,7 +538,7 @@ static void __init suniv_f1c100s_ccu_setup(struct device_node *node) val &= ~GENMASK (19 ,16 );writel (val | (3 <<16 ), reg +SUNIV_PLL_AUDIO_REG ); -sunxi_ccu_probe (node, reg, &suniv_ccu_desc); +of_sunxi_ccu_probe (node, reg, &suniv_ccu_desc);/* Gate then ungate PLL CPU after any rate changes */ ccu_pll_notifier_register (&suniv_pll_cpu_nb);
drivers/clk/sunxi-ng/ccu_common.c +75 -14
137 lines not on this page · raw message
drivers/clk/sunxi-ng/ccu_common.h +4 -2
@@ -63,7 +63,9 @@ struct ccu_pll_nb {int ccu_pll_notifier_register (struct ccu_pll_nb *pll_nb); -int sunxi_ccu_probe (struct device_node *node,void __iomem *reg, -const struct sunxi_ccu_desc *desc); +int devm_sunxi_ccu_probe (struct device *dev,void __iomem *reg, +const struct sunxi_ccu_desc *desc); +void of_sunxi_ccu_probe (struct device_node *node,void __iomem *reg, +const struct sunxi_ccu_desc *desc);#endif /* _COMMON_H_ */
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 4/75 ARM: dts: sunxi: Fix OPPs node name
In reply to Sasha LevinFrom: Maxime Ripard <[email protected]>
[ Upstream commit ffbe853a3f5a37fa0a511265b21abf097ffdbe45 ]
The operating-points-v2 nodes are named inconsistently, but mostly either opp_table0 or gpu-opp-table. However, the underscore is an invalid character for a node name and the thermal zone binding explicitly requires that zones are called opp-table-*. Let's fix it.
--- arch/arm/boot/dts/sun8i-a33.dtsi | 4 ++-- arch/arm/boot/dts/sun8i-a83t.dtsi | 4 ++-- arch/arm/boot/dts/sun8i-h3.dtsi | 4 ++-- arch/arm64/boot/dts/allwinner/sun50i-a64-cpu-opp.dtsi | 2 +- arch/arm64/boot/dts/allwinner/sun50i-h5-cpu-opp.dtsi | 2 +- arch/arm64/boot/dts/allwinner/sun50i-h6-cpu-opp.dtsi | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-)
arch/arm/boot/dts/sun8i-a33.dtsi +2 -2
@@ -46,7 +46,7 @@ #include <dt-bindings/thermal/thermal.h> / { - cpu0_opp_table: opp_table0 { + cpu0_opp_table: opp-table-cpu { compatible = "operating-points-v2"; opp-shared;
@@ -164,7 +164,7 @@ io-channels = <&ths>; }; - mali_opp_table: gpu-opp-table { + mali_opp_table: opp-table-gpu { compatible = "operating-points-v2"; opp-144000000 {
arch/arm/boot/dts/sun8i-a83t.dtsi +2 -2
@@ -200,7 +200,7 @@ status = "disabled"; }; - cpu0_opp_table: opp_table0 { + cpu0_opp_table: opp-table-cluster0 { compatible = "operating-points-v2"; opp-shared;
@@ -253,7 +253,7 @@ }; }; - cpu1_opp_table: opp_table1 { + cpu1_opp_table: opp-table-cluster1 { compatible = "operating-points-v2"; opp-shared;
arch/arm/boot/dts/sun8i-h3.dtsi +2 -2
@@ -44,7 +44,7 @@ #include <dt-bindings/thermal/thermal.h> / { - cpu0_opp_table: opp_table0 { + cpu0_opp_table: opp-table-cpu { compatible = "operating-points-v2"; opp-shared;
@@ -112,7 +112,7 @@ }; }; - gpu_opp_table: gpu-opp-table { + gpu_opp_table: opp-table-gpu { compatible = "operating-points-v2"; opp-120000000 {
arch/arm64/boot/dts/allwinner/sun50i-a64-cpu-opp.dtsi +1 -1
@@ -4,7 +4,7 @@ */ / { - cpu0_opp_table: opp_table0 { + cpu0_opp_table: opp-table-cpu { compatible = "operating-points-v2"; opp-shared;
arch/arm64/boot/dts/allwinner/sun50i-h5-cpu-opp.dtsi +1 -1
@@ -2,7 +2,7 @@ // Copyright (C) 2020 Chen-Yu Tsai <[email protected]> / { - cpu_opp_table: cpu-opp-table { + cpu_opp_table: opp-table-cpu { compatible = "operating-points-v2"; opp-shared;
arch/arm64/boot/dts/allwinner/sun50i-h6-cpu-opp.dtsi +1 -1
@@ -3,7 +3,7 @@ // Copyright (C) 2020 Clément Péron <[email protected]> / { - cpu_opp_table: cpu-opp-table { + cpu_opp_table: opp-table-cpu { compatible = "allwinner,sun50i-h6-operating-points"; nvmem-cells = <&cpu_speed_grade>; opp-shared;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 5/75 arm64: dts: allwinner: h5: Fix GPU thermal zone node name
In reply to Sasha LevinFrom: Maxime Ripard <[email protected]>
[ Upstream commit 94a0f2b0e4e0953d8adf319c44244ef7a57de32c ]
The GPU thermal zone is named gpu_thermal. However, the underscore is an invalid character for a node name and the thermal zone binding explicitly requires that zones are called *-thermal. Let's fix it.
--- arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi +1 -1
@@ -217,7 +217,7 @@ }; }; - gpu_thermal { + gpu-thermal { polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 1>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 6/75 arm64: dts: allwinner: a100: Fix thermal zone node name
In reply to Sasha LevinFrom: Maxime Ripard <[email protected]>
[ Upstream commit 5c34c4e46e601554bfa370b23c8ae3c3c734e9f7 ]
The thermal zones one the A100 are called $device-thermal-zone.
However, the thermal zone binding explicitly requires that zones are called *-thermal. Let's fix it.
--- arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi +3 -3
@@ -343,19 +343,19 @@ }; thermal-zones { - cpu-thermal-zone { + cpu-thermal { polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 0>; }; - ddr-thermal-zone { + ddr-thermal { polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 2>; }; - gpu-thermal-zone { + gpu-thermal { polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 1>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 7/75 staging: wfx: ensure IRQ is ready before enabling it
In reply to Sasha LevinFrom: Jérôme Pouiller <[email protected]>
[ Upstream commit 5e57c668dc097c6c27c973504706edec53f79281 ]
Since commit 5561770f80b1 ("staging: wfx: repair external IRQ for SDIO"), wfx_sdio_irq_subscribe() enforce the device to use IRQs. However, there is currently a race in this code. An IRQ may happen before the IRQ has been registered.
The problem has observed during debug session when the device crashes before the IRQ set up:
[ 1.546] wfx-sdio mmc0:0001:1: started firmware 3.12.2 "WF200_ASIC_WFM_(Jenkins)_FW3.12.2" (API: 3.7, keyset: C0, caps: 0x00000002)
[ 2.559] wfx-sdio mmc0:0001:1: time out while polling control register
[ 3.565] wfx-sdio mmc0:0001:1: chip is abnormally long to answer
[ 6.563] wfx-sdio mmc0:0001:1: chip did not answer
[ 6.568] wfx-sdio mmc0:0001:1: hardware request CONFIGURATION (0x09) on vif 2 returned error -110
[ 6.577] wfx-sdio mmc0:0001:1: PDS bytes 0 to 12: chip didn't reply (corrupted file?)
[ 6.585] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 6.592] pgd = c0004000
[ 6.595] [00000000] *pgd=00000000
[ 6.598] Internal error: Oops - BUG: 17 [#1] THUMB2
[ 6.603] Modules linked in:
[ 6.606] CPU: 0 PID: 23 Comm: kworker/u2:1 Not tainted 3.18.19 #78
[ 6.612] Workqueue: kmmcd mmc_rescan
[ 6.616] task: c176d100 ti: c0e50000 task.ti: c0e50000
[ 6.621] PC is at wake_up_process+0xa/0x14
[ 6.625] LR is at sdio_irq+0x61/0x250
[ 6.629] pc : [<c001e8ae>] lr : [<c00ec5bd>] psr: 600001b3
[ 6.629] sp : c0e51bd8 ip : c0e51cc8 fp : 00000001
[ 6.640] r10: 00000003 r9 : 00000000 r8 : c0003c34
[ 6.644] r7 : c0e51bd8 r6 : c0003c30 r5 : 00000001 r4 : c0e78c00
[ 6.651] r3 : 00000000 r2 : 00000000 r1 : 00000003 r0 : 00000000
[ 6.657] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA Thumb Segment kernel
[ 6.664] Control: 50c53c7d Table: 11fd8059 DAC: 00000015
[ 6.670] Process kworker/u2:1 (pid: 23, stack limit = 0xc0e501b0)
[ 6.676] Stack: (0xc0e51bd8 to 0xc0e52000)
[...]
[ 6.949] [<c001e8ae>] (wake_up_process) from [<c00ec5bd>] (sdio_irq+0x61/0x250)
[ 6.956] [<c00ec5bd>] (sdio_irq) from [<c0025099>] (handle_irq_event_percpu+0x17/0x92)
[ 6.964] [<c0025099>] (handle_irq_event_percpu) from [<c002512f>] (handle_irq_event+0x1b/0x24)
[ 6.973] [<c002512f>] (handle_irq_event) from [<c0026577>] (handle_level_irq+0x5d/0x76)
[ 6.981] [<c0026577>] (handle_level_irq) from [<c0024cc3>] (generic_handle_irq+0x13/0x1c)
[ 6.989] [<c0024cc3>] (generic_handle_irq) from [<c0024dd9>] (__handle_domain_irq+0x31/0x48)
[ 6.997] [<c0024dd9>] (__handle_domain_irq) from [<c0008359>] (ov_handle_irq+0x31/0xe0)
[ 7.005] [<c0008359>] (ov_handle_irq) from [<c000af5b>] (__irq_svc+0x3b/0x5c)
[ 7.013] Exception stack(0xc0e51c68 to 0xc0e51cb0)
[...]
[ 7.038] [<c000af5b>] (__irq_svc) from [<c01775aa>] (wait_for_common+0x9e/0xc4)
[ 7.045] [<c01775aa>] (wait_for_common) from [<c00e1dc3>] (mmc_wait_for_req+0x4b/0xdc)
[ 7.053] [<c00e1dc3>] (mmc_wait_for_req) from [<c00e1e83>] (mmc_wait_for_cmd+0x2f/0x34)
[ 7.061] [<c00e1e83>] (mmc_wait_for_cmd) from [<c00e7b2b>] (mmc_io_rw_direct_host+0x71/0xac)
[ 7.070] [<c00e7b2b>] (mmc_io_rw_direct_host) from [<c00e8f79>] (sdio_claim_irq+0x6b/0x116)
[ 7.078] [<c00e8f79>] (sdio_claim_irq) from [<c00d8415>] (wfx_sdio_irq_subscribe+0x19/0x94)
[ 7.086] [<c00d8415>] (wfx_sdio_irq_subscribe) from [<c00d5229>] (wfx_probe+0x189/0x2ac)
[ 7.095] [<c00d5229>] (wfx_probe) from [<c00d83bf>] (wfx_sdio_probe+0x8f/0xcc)
[ 7.102] [<c00d83bf>] (wfx_sdio_probe) from [<c00e7fbb>] (sdio_bus_probe+0x5f/0xa8)
[ 7.109] [<c00e7fbb>] (sdio_bus_probe) from [<c00be229>] (driver_probe_device+0x59/0x134)
[ 7.118] [<c00be229>] (driver_probe_device) from [<c00bd4d7>] (bus_for_each_drv+0x3f/0x4a)
[ 7.126] [<c00bd4d7>] (bus_for_each_drv) from [<c00be1a5>] (device_attach+0x3b/0x52)
[ 7.134] [<c00be1a5>] (device_attach) from [<c00bdc2b>] (bus_probe_device+0x17/0x4c)
[ 7.141] [<c00bdc2b>] (bus_probe_device) from [<c00bcd69>] (device_add+0x2c5/0x334)
[ 7.149] [<c00bcd69>] (device_add) from [<c00e80bf>] (sdio_add_func+0x23/0x44)
[ 7.156] [<c00e80bf>] (sdio_add_func) from [<c00e79eb>] (mmc_attach_sdio+0x187/0x1ec)
[ 7.164] [<c00e79eb>] (mmc_attach_sdio) from [<c00e31bd>] (mmc_rescan+0x18d/0x1fc)
[ 7.172] [<c00e31bd>] (mmc_rescan) from [<c001a14f>] (process_one_work+0xd7/0x170)
[ 7.179] [<c001a14f>] (process_one_work) from [<c001a59b>] (worker_thread+0x103/0x1bc)
[ 7.187] [<c001a59b>] (worker_thread) from [<c001c731>] (kthread+0x7d/0x90)
[ 7.194] [<c001c731>] (kthread) from [<c0008ce1>] (ret_from_fork+0x11/0x30)
[ 7.201] Code: 2103 b580 2200 af00 (681b) 46bd
[ 7.206] ---[ end trace 3ab50aced42eedb4 ]------ drivers/staging/wfx/bus_sdio.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/staging/wfx/bus_sdio.c +10 -7
@@ -120,19 +120,22 @@ static int wfx_sdio_irq_subscribe(void *priv)return ret; } + flags =irq_get_trigger_type (bus->of_irq); +if (!flags) + flags =IRQF_TRIGGER_HIGH ; + flags |=IRQF_ONESHOT ; + ret =devm_request_threaded_irq (&bus->func->dev, bus->of_irq,NULL , + wfx_sdio_irq_handler_ext, flags, +"wfx" , bus); +if (ret) +return ret;sdio_claim_host (bus->func); cccr =sdio_f0_readb (bus->func, SDIO_CCCR_IENx,NULL ); cccr |=BIT (0 ); cccr |=BIT (bus->func->num);sdio_f0_writeb (bus->func, cccr, SDIO_CCCR_IENx,NULL );sdio_release_host (bus->func); - flags =irq_get_trigger_type (bus->of_irq); -if (!flags) - flags =IRQF_TRIGGER_HIGH ; - flags |=IRQF_ONESHOT ; -return devm_request_threaded_irq (&bus->func->dev, bus->of_irq,NULL , - wfx_sdio_irq_handler_ext, flags, -"wfx" , bus); +return 0 ; }static int wfx_sdio_irq_unsubscribe (void *priv)
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 8/75 ARM: dts: BCM5301X: Fix nodes names
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 9dba049b6d32e95c0dd2a0d607f593ea288ac140 ]
This fixes following errors for all BCM5301X dts files:
chipcommonA@18000000: $nodename:0: 'chipcommonA@18000000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$' mpcore@19000000: $nodename:0: 'mpcore@19000000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$' mdio-bus-mux@18003000: $nodename:0: 'mdio-bus-mux@18003000' does not match '^mdio-mux[\\-@]?'
dmu@1800c000: $nodename:0: 'dmu@1800c000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
--- arch/arm/boot/dts/bcm47094-linksys-panamera.dts | 2 +- arch/arm/boot/dts/bcm5301x.dtsi | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/bcm47094-linksys-panamera.dts +1 -1
@@ -129,7 +129,7 @@ }; }; - mdio-bus-mux@18003000 { + mdio-mux@18003000 { /* BIT(9) = 1 => external mdio */ mdio@200 {
arch/arm/boot/dts/bcm5301x.dtsi +4 -4
@@ -19,7 +19,7 @@ #size-cells = <1>; interrupt-parent = <&gic>; - chipcommonA@18000000 { + chipcommon-a-bus@18000000 { compatible = "simple-bus"; ranges = <0x00000000 0x18000000 0x00001000>; #address-cells = <1>;
@@ -44,7 +44,7 @@ }; }; - mpcore@19000000 { + mpcore-bus@19000000 { compatible = "simple-bus"; ranges = <0x00000000 0x19000000 0x00023000>; #address-cells = <1>;
@@ -369,7 +369,7 @@ #address-cells = <1>; }; - mdio-bus-mux@18003000 { + mdio-mux@18003000 { compatible = "mdio-mux-mmioreg"; mdio-parent-bus = <&mdio>; #address-cells = <1>;
@@ -415,7 +415,7 @@ status = "disabled"; }; - dmu@1800c000 { + dmu-bus@1800c000 { compatible = "simple-bus"; ranges = <0 0x1800c000 0x1000>; #address-cells = <1>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 9/75 ARM: dts: BCM5301X: Fix MDIO mux binding
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 6ee0b56f7530e0ebb496fe15d0b54c5f3a1b5e17 ]
This fixes following error for all BCM5301X dts files:
mdio-bus-mux@18003000: compatible: ['mdio-mux-mmioreg'] is too short
--- arch/arm/boot/dts/bcm5301x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/bcm5301x.dtsi +1 -1
@@ -370,7 +370,7 @@ }; mdio-mux@18003000 { - compatible = "mdio-mux-mmioreg"; + compatible = "mdio-mux-mmioreg", "mdio-mux"; mdio-parent-bus = <&mdio>; #address-cells = <1>; #size-cells = <0>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 10/75 ARM: dts: NSP: Fix mpcore, mmc node names
In reply to Sasha LevinFrom: Matthew Hagan <[email protected]>
[ Upstream commit 15a563d008ef9d04df525f0c476cd7d7127bb883 ]
Running dtbs_check yielded the issues with bcm-nsp.dtsi.
Firstly this patch fixes the following message by appending "-bus" to
the mpcore node name:
mpcore@19000000: $nodename:0: 'mpcore@19000000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
Secondly mmc node name. The label name can remain as is. sdhci@21000: $nodename:0: 'sdhci@21000' does not match '^mmc(@.*)?$'
--- arch/arm/boot/dts/bcm-nsp.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/bcm-nsp.dtsi +2 -2
@@ -77,7 +77,7 @@ interrupt-affinity = <&cpu0>, <&cpu1>; }; - mpcore@19000000 { + mpcore-bus@19000000 { compatible = "simple-bus"; ranges = <0x00000000 0x19000000 0x00023000>; #address-cells = <1>;
@@ -219,7 +219,7 @@ status = "disabled"; }; - sdio: sdhci@21000 { + sdio: mmc@21000 { compatible = "brcm,sdhci-iproc-cygnus"; reg = <0x21000 0x100>; interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 11/75 arm64: dts: broadcom: bcm4908: Move reboot syscon out of bus
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 6cf9f70255b90b540b9cbde062f18fea29024a75 ]
This fixes following error for every bcm4908 DTS file:
bus@ff800000: reboot: {'type': 'object'} is not allowed for {'compatible': ['syscon-reboot'], 'regmap': [[15]], 'offset': [[52]], 'mask': [[1]]}
--- arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi +6 -6
@@ -326,12 +326,12 @@ #reset-cells = <1>; }; }; + }; - reboot { - compatible = "syscon-reboot"; - regmap = <&timer>; - offset = <0x34>; - mask = <1>; - }; + reboot { + compatible = "syscon-reboot"; + regmap = <&timer>; + offset = <0x34>; + mask = <1>; }; };
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 12/75 scsi: pm80xx: Fix memory leak during rmmod
In reply to Sasha LevinFrom: Ajish Koshy <[email protected]>
[ Upstream commit 51e6ed83bb4ade7c360551fa4ae55c4eacea354b ]
Driver failed to release all memory allocated. This would lead to memory leak during driver removal.
Properly free memory when the module is removed.
--- drivers/scsi/pm8001/pm8001_init.c | 11 +++++++++++ drivers/scsi/pm8001/pm8001_sas.h | 1 + 2 files changed, 12 insertions(+)
drivers/scsi/pm8001/pm8001_init.c +11 -0
@@ -1198,6 +1198,7 @@ pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost, goto err_out;/* Memory region for ccb_info*/ + pm8001_ha->ccb_count = ccb_count; pm8001_ha->ccb_info =kcalloc (ccb_count,sizeof (struct pm8001_ccb_info ),GFP_KERNEL );if (!pm8001_ha->ccb_info) {
@@ -1259,6 +1260,16 @@ static void pm8001_pci_remove(struct pci_dev *pdev)tasklet_kill (&pm8001_ha->tasklet[j]);#endif scsi_host_put (pm8001_ha->shost); + +for (i =0 ; i < pm8001_ha->ccb_count; i++) { +dma_free_coherent (&pm8001_ha->pdev->dev, +sizeof (struct pm8001_prd ) *PM8001_MAX_DMA_SG , + pm8001_ha->ccb_info[i].buf_prd, + pm8001_ha->ccb_info[i].ccb_dma_handle); + } +kfree (pm8001_ha->ccb_info); +kfree (pm8001_ha->devices); +pm8001_free (pm8001_ha);kfree (sha->sas_phy);kfree (sha->sas_port);
drivers/scsi/pm8001/pm8001_sas.h +1 -0
@@ -516,6 +516,7 @@ struct pm8001_hba_info {u32 iomb_size;/* SPC and SPCV IOMB size */ struct pm8001_device *devices;struct pm8001_ccb_info *ccb_info; +u32 ccb_count;#ifdef PM8001_USE_MSIX int number_of_intr;/*will be used in remove()*/ char intr_drvname[PM8001_MAX_MSIX_VEC ]
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 13/75 scsi: lpfc: Fix list_add() corruption in lpfc_drain_txq()
In reply to Sasha LevinFrom: James Smart <[email protected]>
[ Upstream commit 99154581b05c8fb22607afb7c3d66c1bace6aa5d ]
When parsing the txq list in lpfc_drain_txq(), the driver attempts to pass the requests to the adapter. If such an attempt fails, a local "fail_msg" string is set and a log message output. The job is then added to a completions list for cancellation.
Processing of any further jobs from the txq list continues, but since "fail_msg" remains set, jobs are added to the completions list regardless of whether a wqe was passed to the adapter. If successfully added to txcmplq, jobs are added to both lists resulting in list corruption.
Fix by clearing the fail_msg string after adding a job to the completions list. This stops the subsequent jobs from being added to the completions list unless they had an appropriate failure.
--- drivers/scsi/lpfc/lpfc_sli.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/lpfc/lpfc_sli.c +1 -0
@@ -20357,6 +20357,7 @@ lpfc_drain_txq(struct lpfc_hba *phba) fail_msg, piocbq->iotag, piocbq->sli4_xritag);list_add_tail (&piocbq->list, &completions); + fail_msg =NULL ; }spin_unlock_irqrestore (&pring->ring_lock, iflags); }
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 14/75 arm64: dts: rockchip: Disable CDN DP on Pinebook Pro
In reply to Sasha LevinFrom: Matthias Brugger <[email protected]>
[ Upstream commit 2513fa5c25d42f55ca5f0f0ab247af7c9fbfa3b1 ]
The CDN DP needs a PHY and a extcon to work correctly. But no extcon is provided by the device-tree, which leads to an error:
cdn-dp fec00000.dp: [drm:cdn_dp_probe [rockchipdrm]] *ERROR* missing extcon or phy
cdn-dp: probe of fec00000.dp failed with error -22
Disable the CDN DP to make graphic work on the Pinebook Pro.
--- arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 4 ---- 1 file changed, 4 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts +0 -4
@@ -385,10 +385,6 @@ }; }; -&cdn_dp { - status = "okay"; -}; - &cpu_b0 { cpu-supply = <&vdd_cpu_b>; };
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 15/75 arm64: dts: hisilicon: fix arm,sp805 compatible string
In reply to Sasha LevinFrom: Michael Walle <[email protected]>
[ Upstream commit 894d4f1f77d0e88f1f81af2e1e37333c1c41b631 ]
According to Documentation/devicetree/bindings/watchdog/arm,sp805.yaml the compatible is:
compatible = "arm,sp805", "arm,primecell";
The current compatible string doesn't exist at all. Fix it.
--- arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 4 ++-- arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/hisilicon/hi3660.dtsi +2 -2
@@ -1087,7 +1087,7 @@ }; watchdog0: watchdog@e8a06000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xe8a06000 0x0 0x1000>; interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; clocks = <&crg_ctrl HI3660_OSC32K>,
@@ -1096,7 +1096,7 @@ }; watchdog1: watchdog@e8a07000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xe8a07000 0x0 0x1000>; interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>; clocks = <&crg_ctrl HI3660_OSC32K>,
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +1 -1
@@ -840,7 +840,7 @@ }; watchdog0: watchdog@f8005000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xf8005000 0x0 0x1000>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ao_ctrl HI6220_WDT0_PCLK>,
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 16/75 arm64: dts: rockchip: add Coresight debug range for RK3399
In reply to Sasha LevinFrom: Brian Norris <[email protected]>
[ Upstream commit 75dccea503b8e176ad044175e891d7bb291b6ba0 ]
Per Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt.
This IP block can be used for sampling the PC of any given CPU, which is useful in certain panic scenarios where you can't get the CPU to stop cleanly (e.g., hard lockup).
--- arch/arm64/boot/dts/rockchip/rk3399.dtsi | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399.dtsi +48 -0
@@ -361,6 +361,54 @@ status = "disabled"; }; + debug@fe430000 { + compatible = "arm,coresight-cpu-debug", "arm,primecell"; + reg = <0 0xfe430000 0 0x1000>; + clocks = <&cru PCLK_COREDBG_L>; + clock-names = "apb_pclk"; + cpu = <&cpu_l0>; + }; + + debug@fe432000 { + compatible = "arm,coresight-cpu-debug", "arm,primecell"; + reg = <0 0xfe432000 0 0x1000>; + clocks = <&cru PCLK_COREDBG_L>; + clock-names = "apb_pclk"; + cpu = <&cpu_l1>; + }; + + debug@fe434000 { + compatible = "arm,coresight-cpu-debug", "arm,primecell"; + reg = <0 0xfe434000 0 0x1000>; + clocks = <&cru PCLK_COREDBG_L>; + clock-names = "apb_pclk"; + cpu = <&cpu_l2>; + }; + + debug@fe436000 { + compatible = "arm,coresight-cpu-debug", "arm,primecell"; + reg = <0 0xfe436000 0 0x1000>; + clocks = <&cru PCLK_COREDBG_L>; + clock-names = "apb_pclk"; + cpu = <&cpu_l3>; + }; + + debug@fe610000 { + compatible = "arm,coresight-cpu-debug", "arm,primecell"; + reg = <0 0xfe610000 0 0x1000>; + clocks = <&cru PCLK_COREDBG_B>; + clock-names = "apb_pclk"; + cpu = <&cpu_b0>; + }; + + debug@fe710000 { + compatible = "arm,coresight-cpu-debug", "arm,primecell"; + reg = <0 0xfe710000 0 0x1000>; + clocks = <&cru PCLK_COREDBG_B>; + clock-names = "apb_pclk"; + cpu = <&cpu_b1>; + }; + usbdrd3_0: usb@fe800000 { compatible = "rockchip,rk3399-dwc3"; #address-cells = <2>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 17/75 RDMA/bnxt_re: Check if the vlan is valid before reporting
In reply to Sasha LevinFrom: Selvin Xavier <[email protected]>
[ Upstream commit 6bda39149d4b8920fdb8744090653aca3daa792d ]
When VF is configured with default vlan, HW strips the vlan from the packet and driver receives it in Rx completion. VLAN needs to be reported for UD work completion only if the vlan is configured on the host. Add a check for valid vlan in the UD receive path.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +9 -3
@@ -3364,8 +3364,11 @@ static void bnxt_re_process_res_ud_wc(struct bnxt_re_qp *qp,struct ib_wc *wc, struct bnxt_qplib_cqe *cqe) { + struct bnxt_re_dev *rdev; +u16 vlan_id =0 ;u8 nw_type; + rdev = qp->rdev; wc->opcode =IB_WC_RECV ; wc->status =__rc_to_ib_wc_status (cqe->status);
@@ -3377,9 +3380,12 @@ static void bnxt_re_process_res_ud_wc(struct bnxt_re_qp *qp,memcpy (wc->smac, cqe->smac,ETH_ALEN ); wc->wc_flags |=IB_WC_WITH_SMAC ;if (cqe->flags &CQ_RES_UD_FLAGS_META_FORMAT_VLAN ) { - wc->vlan_id = (cqe->cfa_meta &0xFFF ); -if (wc->vlan_id <0x1000 ) - wc->wc_flags |=IB_WC_WITH_VLAN ; + vlan_id = (cqe->cfa_meta &0xFFF ); + } +/* Mark only if vlan_id is non zero */ +if (vlan_id &&bnxt_re_check_if_vlan_valid (rdev, vlan_id)) { + wc->vlan_id = vlan_id; + wc->wc_flags |=IB_WC_WITH_VLAN ; } nw_type = (cqe->flags &CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK ) >>CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT ;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 18/75 bus: ti-sysc: Add quirk handling for reinit on context lost
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 9d881361206ebcf6285c2ec2ef275aff80875347 ]
Some interconnect target modules such as otg and gpmc on am335x need a re-init after resume. As we also have PM runtime cases where the context may be lost, let's handle these all with cpu_pm.
For the am335x resume path, we already have cpu_pm_resume() call cpu_pm_cluster_exit().
--- drivers/bus/ti-sysc.c | 108 ++++++++++++++++++++++++-- include/linux/platform_data/ti-sysc.h | 1 + 2 files changed, 103 insertions(+), 6 deletions(-)
drivers/bus/ti-sysc.c +102 -6
@@ -6,6 +6,7 @@#include <linux/io.h> #include <linux/clk.h> #include <linux/clkdev.h> +#include <linux/cpu_pm.h> #include <linux/delay.h> #include <linux/list.h> #include <linux/module.h>
@@ -51,11 +52,18 @@ struct sysc_address {struct list_head node; }; +struct sysc_module { +struct sysc *ddata; +struct list_head node; +}; +struct sysc_soc_info {unsigned long general_purpose:1 ;enum sysc_soc soc; -struct mutex list_lock;/* disabled modules list lock */ +struct mutex list_lock;/* disabled and restored modules list lock */ struct list_head disabled_modules; +struct list_head restored_modules; +struct notifier_block nb; };enum sysc_clocks {
@@ -2402,6 +2410,79 @@ static struct dev_pm_domain sysc_child_pm_domain = { } }; +/* Caller needs to take list_lock if ever used outside of cpu_pm */ +static void sysc_reinit_modules (struct sysc_soc_info *soc) +{ +struct sysc_module *module; +struct list_head *pos; +struct sysc *ddata; +int error =0 ; + +list_for_each (pos, &sysc_soc->restored_modules) { + module = list_entry(pos, struct sysc_module, node); + ddata = module->ddata; + error =sysc_reinit_module (ddata, ddata->enabled); + } +} + +/** +* sysc_context_notifier - optionally reset and restore module after idle +* @nb: notifier block +* @cmd: unused +* @v: unused +* +* Some interconnect target modules need to be restored, or reset and restored +* on CPU_PM CPU_PM_CLUSTER_EXIT notifier. This is needed at least for am335x +* OTG and GPMC target modules even if the modules are unused. +*/ +static int sysc_context_notifier (struct notifier_block *nb,unsigned long cmd, +void *v) +{ +struct sysc_soc_info *soc; + + soc = container_of(nb, struct sysc_soc_info, nb); + +switch (cmd) { +case CPU_CLUSTER_PM_ENTER : +break ; +case CPU_CLUSTER_PM_ENTER_FAILED :/* No need to restore context */ +break ; +case CPU_CLUSTER_PM_EXIT : +sysc_reinit_modules (soc); +break ; + } + +return NOTIFY_OK ; +} + +/** +* sysc_add_restored - optionally add reset and restore quirk hanlling +* @ddata: device data +*/ +static void sysc_add_restored (struct sysc *ddata) +{ +struct sysc_module *restored_module; + + restored_module =kzalloc (sizeof (*restored_module),GFP_KERNEL ); +if (!restored_module) +return ; + + restored_module->ddata = ddata; + +mutex_lock (&sysc_soc->list_lock); + +list_add (&restored_module->node, &sysc_soc->restored_modules); + +if (sysc_soc->nb.notifier_call) + goto out_unlock; + + sysc_soc->nb.notifier_call = sysc_context_notifier; +cpu_pm_register_notifier (&sysc_soc->nb); + +out_unlock: +mutex_unlock (&sysc_soc->list_lock); +} +/** * sysc_legacy_idle_quirk - handle children in omap_device compatible way * @ddata: device driver data
@@ -2901,12 +2982,14 @@ static int sysc_add_disabled(unsigned long base) }/* -* One time init to detect the booted SoC and disable unavailable features. +* One time init to detect the booted SoC, disable unavailable features +* and initialize list for optional cpu_pm notifier. +* * Note that we initialize static data shared across all ti-sysc instances * so ddata is only used for SoC type. This can be called from module_init * once we no longer need to rely on platform data. */ -static int sysc_init_soc (struct sysc *ddata) +static int sysc_init_static_data (struct sysc *ddata) {const struct soc_device_attribute *match;struct ti_sysc_platform_data *pdata;
@@ -2922,6 +3005,7 @@ static int sysc_init_soc(struct sysc *ddata)mutex_init (&sysc_soc->list_lock);INIT_LIST_HEAD (&sysc_soc->disabled_modules); +INIT_LIST_HEAD (&sysc_soc->restored_modules); sysc_soc->general_purpose = true; pdata =dev_get_platdata (ddata->dev);
@@ -2986,15 +3070,24 @@ static int sysc_init_soc(struct sysc *ddata)return 0 ; } -static void sysc_cleanup_soc (void ) +static void sysc_cleanup_static_data (void ) { +struct sysc_module *restored_module;struct sysc_address *disabled_module;struct list_head *pos, *tmp;if (!sysc_soc)return ; +if (sysc_soc->nb.notifier_call) +cpu_pm_unregister_notifier (&sysc_soc->nb); +mutex_lock (&sysc_soc->list_lock); +list_for_each_safe (pos, tmp, &sysc_soc->restored_modules) { + restored_module = list_entry(pos, struct sysc_module, node); +list_del (pos); +kfree (restored_module); + }list_for_each_safe (pos, tmp, &sysc_soc->disabled_modules) { disabled_module = list_entry(pos, struct sysc_address, node);list_del (pos);
@@ -3062,7 +3155,7 @@ static int sysc_probe(struct platform_device *pdev) ddata->dev = &pdev->dev;platform_set_drvdata (pdev, ddata); - error =sysc_init_soc (ddata); + error =sysc_init_static_data (ddata);if (error)return error;
@@ -3161,6 +3254,9 @@ static int sysc_probe(struct platform_device *pdev)pm_runtime_put (&pdev->dev); } +if (ddata->cfg.quirks &SYSC_QUIRK_REINIT_ON_CTX_LOST ) +sysc_add_restored (ddata); +return 0 ; err:
@@ -3243,7 +3339,7 @@ static void __exit sysc_exit(void) {bus_unregister_notifier (&platform_bus_type, &sysc_nb);platform_driver_unregister (&sysc_driver); -sysc_cleanup_soc (); +sysc_cleanup_static_data (); }module_exit (sysc_exit);
include/linux/platform_data/ti-sysc.h +1 -0
@@ -50,6 +50,7 @@ struct sysc_regbits {s8 emufree_shift; }; +#define SYSC_QUIRK_REINIT_ON_CTX_LOST BIT(28)#define SYSC_QUIRK_REINIT_ON_RESUME BIT(27)#define SYSC_QUIRK_GPMC_DEBUG BIT(26)#define SYSC_MODULE_QUIRK_ENA_RESETDONE BIT(25)
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 19/75 bus: ti-sysc: Use context lost quirk for otg
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 9067839ff45a528bcb015cc2f24f656126b91e3f ]
Let's use SYSC_QUIRK_REINIT_ON_CTX_LOST quirk for am335x otg instead of SYSC_QUIRK_REINIT_ON_RESUME quirk as we can now handle the context loss in a more generic way.
--- drivers/bus/ti-sysc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/ti-sysc.c +1 -1
@@ -1528,7 +1528,7 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),SYSC_QUIRK ("usb_otg_hs" ,0 ,0 ,0x10 , -ENODEV ,0x4ea2080d ,0xffffffff ,SYSC_QUIRK_SWSUP_SIDLE |SYSC_QUIRK_SWSUP_MSTANDBY | -SYSC_QUIRK_REINIT_ON_RESUME ), +SYSC_QUIRK_REINIT_ON_CTX_LOST ),SYSC_QUIRK ("wdt" ,0 ,0 ,0x10 ,0x14 ,0x502a0500 ,0xfffff0f0 , SYSC_MODULE_QUIRK_WDT),/* PRUSS on am3, am4 and am5 */
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 20/75 usb: musb: tusb6010: check return value after calling platform_get_resource()
In reply to Sasha LevinFrom: Yang Yingliang <[email protected]>
[ Upstream commit 14651496a3de6807a17c310f63c894ea0c5d858e ]
It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value.
--- drivers/usb/musb/tusb6010.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/musb/tusb6010.c +5 -0
@@ -1104,6 +1104,11 @@ static int tusb_musb_init(struct musb *musb)/* dma address for async dma */ mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!mem) { +pr_debug ("no async dma resource?\n" ); + ret = -ENODEV ; + goto done; + } musb->async = mem->start;/* dma address for sync dma */
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 21/75 usb: typec: tipd: Remove WARN_ON in tps6598x_block_read
In reply to Sasha LevinFrom: Sven Peter <[email protected]>
[ Upstream commit b7a0a63f3fed57d413bb857de164ea9c3984bc4e ]
Calling tps6598x_block_read with a higher than allowed len can be handled by just returning an error. There's no need to crash systems with panic-on-warn enabled.
--- drivers/usb/typec/tipd/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tipd/core.c +1 -1
@@ -117,7 +117,7 @@ tps6598x_block_read(struct tps6598x *tps, u8 reg, void *val, size_t len)u8 data[TPS_MAX_LEN +1 ];int ret; -if (WARN_ON (len +1 >sizeof (data))) +if (len +1 >sizeof (data))return -EINVAL ;if (!tps->i2c_protocol)
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 22/75 ARM: dts: ux500: Skomer regulator fixes
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit 7aee0288beab72cdfa35af51f62e94373fca595d ]
AUX2 has slightly wrong voltage and AUX5 doesn't need to be always on.
--- arch/arm/boot/dts/ste-ux500-samsung-skomer.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/ste-ux500-samsung-skomer.dts +4 -4
@@ -290,10 +290,10 @@ }; ab8500_ldo_aux2 { - /* Supplies the Cypress TMA140 touchscreen only with 3.3V */ + /* Supplies the Cypress TMA140 touchscreen only with 3.0V */ regulator-name = "AUX2"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; }; ab8500_ldo_aux3 {
@@ -312,9 +312,9 @@ ab8500_ldo_aux5 { regulator-name = "AUX5"; + /* Intended for 1V8 for touchscreen but actually left unused */ regulator-min-microvolt = <1050000>; regulator-max-microvolt = <2790000>; - regulator-always-on; }; ab8500_ldo_aux6 {
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 23/75 staging: rtl8723bs: remove possible deadlock when disconnect (v2)
In reply to Sasha LevinFrom: Fabio Aiuto <[email protected]>
[ Upstream commit 54659ca026e586bbb33a7e60daa6443a3ac6b5df ]
when turning off a connection, lockdep complains with the following warning (a modprobe has been done but the same happens with a disconnection from NetworkManager, it's enough to trigger a cfg80211_disconnect call):
[ 682.855867] ======================================================
[ 682.855877] WARNING: possible circular locking dependency detected
[ 682.855887] 5.14.0-rc6+ #16 Tainted: G C OE
[ 682.855898] ------------------------------------------------------
[ 682.855906] modprobe/1770 is trying to acquire lock:
[ 682.855916] ffffb6d000332b00 (&pxmitpriv->lock){+.-.}-{2:2},
at: rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.856073]
but task is already holding lock:
[ 682.856081] ffffb6d0003336a8 (&pstapriv->sta_hash_lock){+.-.}-{2:2},
at: rtw_free_assoc_resources+0x48/0x110 [r8723bs]
[ 682.856207]
which lock already depends on the new lock.[ 682.856215]
the existing dependency chain (in reverse order) is:
[ 682.856223]
-> #1 (&pstapriv->sta_hash_lock){+.-.}-{2:2}:
[ 682.856247] _raw_spin_lock_bh+0x34/0x40
[ 682.856265] rtw_get_stainfo+0x9a/0x110 [r8723bs]
[ 682.856389] rtw_xmit_classifier+0x27/0x130 [r8723bs]
[ 682.856515] rtw_xmitframe_enqueue+0xa/0x20 [r8723bs]
[ 682.856642] rtl8723bs_hal_xmit+0x3b/0xb0 [r8723bs]
[ 682.856752] rtw_xmit+0x4ef/0x890 [r8723bs]
[ 682.856879] _rtw_xmit_entry+0xba/0x350 [r8723bs]
[ 682.856981] dev_hard_start_xmit+0xee/0x320
[ 682.856999] sch_direct_xmit+0x8c/0x330
[ 682.857014] __dev_queue_xmit+0xba5/0xf00
[ 682.857030] packet_sendmsg+0x981/0x1b80
[ 682.857047] sock_sendmsg+0x5b/0x60
[ 682.857060] __sys_sendto+0xf1/0x160
[ 682.857073] __x64_sys_sendto+0x24/0x30
[ 682.857087] do_syscall_64+0x3a/0x80
[ 682.857102] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 682.857117]
-> #0 (&pxmitpriv->lock){+.-.}-{2:2}:
[ 682.857142] __lock_acquire+0xfd9/0x1b50
[ 682.857158] lock_acquire+0xb4/0x2c0
[ 682.857172] _raw_spin_lock_bh+0x34/0x40
[ 682.857185] rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.857308] rtw_free_assoc_resources+0x53/0x110 [r8723bs]
[ 682.857415] cfg80211_rtw_disconnect+0x4b/0x70 [r8723bs]
[ 682.857522] cfg80211_disconnect+0x12e/0x2f0 [cfg80211]
[ 682.857759] cfg80211_leave+0x2b/0x40 [cfg80211]
[ 682.857961] cfg80211_netdev_notifier_call+0xa9/0x560 [cfg80211]
[ 682.858163] raw_notifier_call_chain+0x41/0x50
[ 682.858180] __dev_close_many+0x62/0x100
[ 682.858195] dev_close_many+0x7d/0x120
[ 682.858209] unregister_netdevice_many+0x416/0x680
[ 682.858225] unregister_netdevice_queue+0xab/0xf0
[ 682.858240] unregister_netdev+0x18/0x20
[ 682.858255] rtw_unregister_netdevs+0x28/0x40 [r8723bs]
[ 682.858360] rtw_dev_remove+0x24/0xd0 [r8723bs]
[ 682.858463] sdio_bus_remove+0x31/0xd0 [mmc_core]
[ 682.858532] device_release_driver_internal+0xf7/0x1d0
[ 682.858550] driver_detach+0x47/0x90
[ 682.858564] bus_remove_driver+0x77/0xd0
[ 682.858579] rtw_drv_halt+0xc/0x678 [r8723bs]
[ 682.858685] __x64_sys_delete_module+0x13f/0x250
[ 682.858699] do_syscall_64+0x3a/0x80
[ 682.858715] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 682.858729]
other info that might help us debug this:[ 682.858737] Possible unsafe locking scenario:
[ 682.858744] CPU0 CPU1
[ 682.858751] ---- ----
[ 682.858758] lock(&pstapriv->sta_hash_lock);
[ 682.858772] lock(&pxmitpriv->lock);
[ 682.858786] lock(&pstapriv->sta_hash_lock);
[ 682.858799] lock(&pxmitpriv->lock);
[ 682.858812]
*** DEADLOCK ***[ 682.858820] 5 locks held by modprobe/1770:
[ 682.858831] #0: ffff8d870697d980 (&dev->mutex){....}-{3:3},
at: device_release_driver_internal+0x1a/0x1d0
[ 682.858869] #1: ffffffffbdbbf1c8 (rtnl_mutex){+.+.}-{3:3},
at: unregister_netdev+0xe/0x20
[ 682.858906] #2: ffff8d87054ee5e8 (&rdev->wiphy.mtx){+.+.}-{3:3},
at: cfg80211_netdev_notifier_call+0x9e/0x560 [cfg80211]
[ 682.859131] #3: ffff8d870f2bc8f0 (&wdev->mtx){+.+.}-{3:3},
at: cfg80211_leave+0x20/0x40 [cfg80211]
[ 682.859354] #4: ffffb6d0003336a8 (&pstapriv->sta_hash_lock){+.-.}-{2:2},
at: rtw_free_assoc_resources+0x48/0x110 [r8723bs]
[ 682.859482]
stack backtrace:
[ 682.859491] CPU: 1 PID: 1770 Comm: modprobe Tainted: G
C OE 5.14.0-rc6+ #16
[ 682.859507] Hardware name: LENOVO 80NR/Madrid, BIOS DACN25WW 08/20/2015
[ 682.859517] Call Trace:
[ 682.859531] dump_stack_lvl+0x56/0x6f
[ 682.859551] check_noncircular+0xdb/0xf0
[ 682.859579] __lock_acquire+0xfd9/0x1b50
[ 682.859606] lock_acquire+0xb4/0x2c0
[ 682.859623] ? rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.859752] ? mark_held_locks+0x48/0x70
[ 682.859769] ? rtw_free_stainfo+0x4a/0x4a0 [r8723bs]
[ 682.859898] _raw_spin_lock_bh+0x34/0x40
[ 682.859914] ? rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.860039] rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.860171] rtw_free_assoc_resources+0x53/0x110 [r8723bs]
[ 682.860286] cfg80211_rtw_disconnect+0x4b/0x70 [r8723bs]
[ 682.860397] cfg80211_disconnect+0x12e/0x2f0 [cfg80211]
[ 682.860629] cfg80211_leave+0x2b/0x40 [cfg80211]
[ 682.860836] cfg80211_netdev_notifier_call+0xa9/0x560 [cfg80211]
[ 682.861048] ? __lock_acquire+0x4dc/0x1b50
[ 682.861070] ? lock_is_held_type+0xa8/0x110
[ 682.861089] ? lock_is_held_type+0xa8/0x110
[ 682.861104] ? find_held_lock+0x2d/0x90
[ 682.861120] ? packet_notifier+0x173/0x300
[ 682.861141] ? lock_release+0xb3/0x250
[ 682.861160] ? packet_notifier+0x192/0x300
[ 682.861184] raw_notifier_call_chain+0x41/0x50
[ 682.861205] __dev_close_many+0x62/0x100
[ 682.861224] dev_close_many+0x7d/0x120
[ 682.861245] unregister_netdevice_many+0x416/0x680
[ 682.861264] ? find_held_lock+0x2d/0x90
[ 682.861284] unregister_netdevice_queue+0xab/0xf0
[ 682.861306] unregister_netdev+0x18/0x20
[ 682.861325] rtw_unregister_netdevs+0x28/0x40 [r8723bs]
[ 682.861434] rtw_dev_remove+0x24/0xd0 [r8723bs]
[ 682.861542] sdio_bus_remove+0x31/0xd0 [mmc_core]
[ 682.861615] device_release_driver_internal+0xf7/0x1d0
[ 682.861637] driver_detach+0x47/0x90
[ 682.861656] bus_remove_driver+0x77/0xd0
[ 682.861674] rtw_drv_halt+0xc/0x678 [r8723bs]
[ 682.861782] __x64_sys_delete_module+0x13f/0x250
[ 682.861801] ? lockdep_hardirqs_on_prepare+0xf3/0x170
[ 682.861817] ? syscall_enter_from_user_mode+0x20/0x70
[ 682.861836] do_syscall_64+0x3a/0x80
[ 682.861855] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 682.861873] RIP: 0033:0x7f6dbe85400b
[ 682.861890] Code: 73 01 c3 48 8b 0d 6d 1e 0c 00 f7 d8 64 89
01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 3d
1e 0c 00 f7 d8 64 89 01 48
[ 682.861906] RSP: 002b:00007ffe7a82f538 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 682.861923] RAX: ffffffffffffffda RBX: 000055a64693bd20 RCX: 00007f6dbe85400b
[ 682.861935] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 000055a64693bd88
[ 682.861946] RBP: 000055a64693bd20 R08: 0000000000000000 R09: 0000000000000000
[ 682.861957] R10: 00007f6dbe8c7ac0 R11: 0000000000000206 R12: 000055a64693bd88
[ 682.861967] R13: 0000000000000000 R14: 000055a64693bd88 R15: 00007ffe7a831848This happens because when we enqueue a frame for transmission we do it under xmit_priv lock, then calling rtw_get_stainfo (needed for enqueuing) takes sta_hash_lock and this leads to the following lock dependency:
xmit_priv->lock -> sta_hash_lock
Turning off a connection will bring to callrtw_free_assoc_resources which will set up
the inverse dependency:
sta_hash_lock -> xmit_priv_lock
This could lead to a deadlock as lockdep complains.
Fix it by removing the xmit_priv->lock around rtw_xmitframe_enqueue call inside rtl8723bs_hal_xmit and put it in a smaller critical section inside rtw_xmit_classifier, the only place where xmit_priv data are actually accessed.
Replace spin_{lock,unlock}_bh(pxmitpriv->lock) in other tx paths leading to rtw_xmitframe_enqueue call with spin_{lock,unlock}_bh(psta->sleep_q.lock)
- it's not clear why accessing a sleep_q was protected by a spinlock on xmitpriv->lock.
This way is avoided the same faulty lock nesting
order.
Extra changes in v2 by Hans de Goede:
-Lift the taking of the struct __queue.lock spinlock out of
rtw_free_xmitframe_queue() into the callers this allows also protecting a bunch of related state in rtw_free_stainfo():
-Protect psta->sleepq_len on rtw_free_xmitframe_queue(&psta->sleep_q); -Protect struct tx_servq.tx_pending and tx_servq.qcnt when
calling rtw_free_xmitframe_queue(&tx_servq.sta_pending)
-This also allows moving the spin_lock_bh(&pxmitpriv->lock); to below
the sleep_q free-ing code, avoiding another ABBA locking issue
Tested-on: Lenovo Ideapad MiiX 300-10IBY
--- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 7 ++---- drivers/staging/rtl8723bs/core/rtw_recv.c | 10 +++------ drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 22 ++++++++++--------- drivers/staging/rtl8723bs/core/rtw_xmit.c | 16 ++++++-------- .../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 2 -- 5 files changed, 24 insertions(+), 33 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +2 -5
@@ -5922,7 +5922,6 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf)struct sta_info *psta_bmc;struct list_head *xmitframe_plist, *xmitframe_phead, *tmp;struct xmit_frame *pxmitframe =NULL ; -struct xmit_priv *pxmitpriv = &padapter->xmitpriv;struct sta_priv *pstapriv = &padapter->stapriv;/* for BC/MC Frames */
@@ -5933,8 +5932,7 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf)if ((pstapriv->tim_bitmap&BIT (0 )) && (psta_bmc->sleepq_len >0 )) {msleep (10 );/* 10ms, ATIM(HIQ) Windows */ -/* spin_lock_bh(&psta_bmc->sleep_q.lock); */ -spin_lock_bh (&pxmitpriv->lock); +spin_lock_bh (&psta_bmc->sleep_q.lock); xmitframe_phead =get_list_head (&psta_bmc->sleep_q);list_for_each_safe (xmitframe_plist, tmp, xmitframe_phead) {
@@ -5957,8 +5955,7 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf)rtw_hal_xmitframe_enqueue (padapter, pxmitframe); } -/* spin_unlock_bh(&psta_bmc->sleep_q.lock); */ -spin_unlock_bh (&pxmitpriv->lock); +spin_unlock_bh (&psta_bmc->sleep_q.lock);/* check hi queue and bmc_sleepq */ rtw_chk_hi_queue_cmd (padapter);
drivers/staging/rtl8723bs/core/rtw_recv.c +3 -7
@@ -953,10 +953,8 @@ static signed int validate_recv_ctrl_frame(struct adapter *padapter, union recv_if ((psta->state&WIFI_SLEEP_STATE ) && (pstapriv->sta_dz_bitmap&BIT (psta->aid))) {struct list_head *xmitframe_plist, *xmitframe_phead;struct xmit_frame *pxmitframe =NULL ; -struct xmit_priv *pxmitpriv = &padapter->xmitpriv; -/* spin_lock_bh(&psta->sleep_q.lock); */ -spin_lock_bh (&pxmitpriv->lock); +spin_lock_bh (&psta->sleep_q.lock); xmitframe_phead =get_list_head (&psta->sleep_q); xmitframe_plist =get_next (xmitframe_phead);
@@ -987,12 +985,10 @@ static signed int validate_recv_ctrl_frame(struct adapter *padapter, union recv_update_beacon (padapter,WLAN_EID_TIM ,NULL , true); } -/* spin_unlock_bh(&psta->sleep_q.lock); */ -spin_unlock_bh (&pxmitpriv->lock); +spin_unlock_bh (&psta->sleep_q.lock); }else { -/* spin_unlock_bh(&psta->sleep_q.lock); */ -spin_unlock_bh (&pxmitpriv->lock); +spin_unlock_bh (&psta->sleep_q.lock);if (pstapriv->tim_bitmap&BIT (psta->aid)) {if (psta->sleepq_len ==0 ) {
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +12 -10
@@ -289,46 +289,48 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)/* list_del_init(&psta->wakeup_list); */ -spin_lock_bh (&pxmitpriv->lock); - +spin_lock_bh (&psta->sleep_q.lock);rtw_free_xmitframe_queue (pxmitpriv, &psta->sleep_q); psta->sleepq_len =0 ; +spin_unlock_bh (&psta->sleep_q.lock); + +spin_lock_bh (&pxmitpriv->lock);/* vo */ -/* spin_lock_bh(&(pxmitpriv->vo_pending.lock)); */ +spin_lock_bh (&pstaxmitpriv->vo_q.sta_pending.lock);rtw_free_xmitframe_queue (pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);list_del_init (&(pstaxmitpriv->vo_q.tx_pending)); phwxmit = pxmitpriv->hwxmits; phwxmit->accnt -= pstaxmitpriv->vo_q.qcnt; pstaxmitpriv->vo_q.qcnt =0 ; -/* spin_unlock_bh(&(pxmitpriv->vo_pending.lock)); */ +spin_unlock_bh (&pstaxmitpriv->vo_q.sta_pending.lock);/* vi */ -/* spin_lock_bh(&(pxmitpriv->vi_pending.lock)); */ +spin_lock_bh (&pstaxmitpriv->vi_q.sta_pending.lock);rtw_free_xmitframe_queue (pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);list_del_init (&(pstaxmitpriv->vi_q.tx_pending)); phwxmit = pxmitpriv->hwxmits+1 ; phwxmit->accnt -= pstaxmitpriv->vi_q.qcnt; pstaxmitpriv->vi_q.qcnt =0 ; -/* spin_unlock_bh(&(pxmitpriv->vi_pending.lock)); */ +spin_unlock_bh (&pstaxmitpriv->vi_q.sta_pending.lock);/* be */ -/* spin_lock_bh(&(pxmitpriv->be_pending.lock)); */ +spin_lock_bh (&pstaxmitpriv->be_q.sta_pending.lock);rtw_free_xmitframe_queue (pxmitpriv, &pstaxmitpriv->be_q.sta_pending);list_del_init (&(pstaxmitpriv->be_q.tx_pending)); phwxmit = pxmitpriv->hwxmits+2 ; phwxmit->accnt -= pstaxmitpriv->be_q.qcnt; pstaxmitpriv->be_q.qcnt =0 ; -/* spin_unlock_bh(&(pxmitpriv->be_pending.lock)); */ +spin_unlock_bh (&pstaxmitpriv->be_q.sta_pending.lock);/* bk */ -/* spin_lock_bh(&(pxmitpriv->bk_pending.lock)); */ +spin_lock_bh (&pstaxmitpriv->bk_q.sta_pending.lock);rtw_free_xmitframe_queue (pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);list_del_init (&(pstaxmitpriv->bk_q.tx_pending)); phwxmit = pxmitpriv->hwxmits+3 ; phwxmit->accnt -= pstaxmitpriv->bk_q.qcnt; pstaxmitpriv->bk_q.qcnt =0 ; -/* spin_unlock_bh(&(pxmitpriv->bk_pending.lock)); */ +spin_unlock_bh (&pstaxmitpriv->bk_q.sta_pending.lock);spin_unlock_bh (&pxmitpriv->lock);
drivers/staging/rtl8723bs/core/rtw_xmit.c +7 -9
@@ -1723,15 +1723,12 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pframstruct list_head *plist, *phead, *tmp;struct xmit_frame *pxmitframe; -spin_lock_bh (&pframequeue->lock); - phead =get_list_head (pframequeue);list_for_each_safe (plist, tmp, phead) { pxmitframe = list_entry(plist, struct xmit_frame, list);rtw_free_xmitframe (pxmitpriv, pxmitframe); } -spin_unlock_bh (&pframequeue->lock); }s32 rtw_xmitframe_enqueue (struct adapter *padapter,struct xmit_frame *pxmitframe)
@@ -1786,6 +1783,7 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)struct sta_info *psta;struct tx_servq *ptxservq;struct pkt_attrib *pattrib = &pxmitframe->attrib; +struct xmit_priv *xmit_priv = &padapter->xmitpriv;struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits;signed int res = _SUCCESS;
@@ -1803,12 +1801,14 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe) ptxservq =rtw_get_sta_pending (padapter, psta, pattrib->priority, (u8 *)(&ac_index)); +spin_lock_bh (&xmit_priv->lock);if (list_empty (&ptxservq->tx_pending))list_add_tail (&ptxservq->tx_pending,get_list_head (phwxmits[ac_index].sta_queue));list_add_tail (&pxmitframe->list,get_list_head (&ptxservq->sta_pending)); ptxservq->qcnt++; phwxmits[ac_index].accnt++; +spin_unlock_bh (&xmit_priv->lock); exit:
@@ -2191,11 +2191,10 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)struct list_head *xmitframe_plist, *xmitframe_phead, *tmp;struct xmit_frame *pxmitframe =NULL ;struct sta_priv *pstapriv = &padapter->stapriv; -struct xmit_priv *pxmitpriv = &padapter->xmitpriv; psta_bmc =rtw_get_bcmc_stainfo (padapter); -spin_lock_bh (&pxmitpriv->lock); +spin_lock_bh (&psta->sleep_q.lock); xmitframe_phead =get_list_head (&psta->sleep_q);list_for_each_safe (xmitframe_plist, tmp, xmitframe_phead) {
@@ -2296,7 +2295,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) _exit: -spin_unlock_bh (&pxmitpriv->lock); +spin_unlock_bh (&psta->sleep_q.lock);if (update_mask)update_beacon (padapter,WLAN_EID_TIM ,NULL , true);
@@ -2308,9 +2307,8 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pststruct list_head *xmitframe_plist, *xmitframe_phead, *tmp;struct xmit_frame *pxmitframe =NULL ;struct sta_priv *pstapriv = &padapter->stapriv; -struct xmit_priv *pxmitpriv = &padapter->xmitpriv; -spin_lock_bh (&pxmitpriv->lock); +spin_lock_bh (&psta->sleep_q.lock); xmitframe_phead =get_list_head (&psta->sleep_q);list_for_each_safe (xmitframe_plist, tmp, xmitframe_phead) {
@@ -2363,7 +2361,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst } } -spin_unlock_bh (&pxmitpriv->lock); +spin_unlock_bh (&psta->sleep_q.lock); }void enqueue_pending_xmitbuf (struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitbuf)
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +0 -2
@@ -508,9 +508,7 @@ s32 rtl8723bs_hal_xmit(rtw_issue_addbareq_cmd (padapter, pxmitframe); } -spin_lock_bh (&pxmitpriv->lock); err =rtw_xmitframe_enqueue (padapter, pxmitframe); -spin_unlock_bh (&pxmitpriv->lock);if (err != _SUCCESS) {rtw_free_xmitframe (pxmitpriv, pxmitframe);
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 24/75 staging: rtl8723bs: remove a third possible deadlock
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit bdc1bbdbaa92df19a14d4c1902088c8432b46c6f ]
The assoc_timer takes the pmlmepriv->lock and various functions which take the pmlmepriv->scanned_queue.lock first take the pmlmepriv->lock, this means that we cannot have code which waits for the timer (timer_del_sync) while holding the pmlmepriv->scanned_queue.lock to avoid a triangle deadlock:
[ 363.139361] ======================================================
[ 363.139377] WARNING: possible circular locking dependency detected
[ 363.139396] 5.15.0-rc1+ #470 Tainted: G C E
[ 363.139413] ------------------------------------------------------
[ 363.139424] RTW_CMD_THREAD/2466 is trying to acquire lock:
[ 363.139441] ffffbacd00699038 (&pmlmepriv->lock){+.-.}-{2:2}, at: _rtw_join_timeout_handler+0x3c/0x160 [r8723bs]
[ 363.139598]
but task is already holding lock:
[ 363.139610] ffffbacd00128ea0 ((&pmlmepriv->assoc_timer)){+.-.}-{0:0}, at: call_timer_fn+0x5/0x260
[ 363.139673]
which lock already depends on the new lock.[ 363.139684]
the existing dependency chain (in reverse order) is:
[ 363.139696]
-> #2 ((&pmlmepriv->assoc_timer)){+.-.}-{0:0}:
[ 363.139734] del_timer_sync+0x59/0x100
[ 363.139762] rtw_joinbss_event_prehandle+0x342/0x640 [r8723bs]
[ 363.139870] report_join_res+0xdf/0x110 [r8723bs]
[ 363.139980] OnAssocRsp+0x17a/0x200 [r8723bs]
[ 363.140092] rtw_recv_entry+0x190/0x1120 [r8723bs]
[ 363.140209] rtl8723b_process_phy_info+0x3f9/0x750 [r8723bs]
[ 363.140318] tasklet_action_common.constprop.0+0xe8/0x110
[ 363.140345] __do_softirq+0xde/0x485
[ 363.140372] __irq_exit_rcu+0xd0/0x100
[ 363.140393] irq_exit_rcu+0xa/0x20
[ 363.140413] common_interrupt+0x83/0xa0
[ 363.140440] asm_common_interrupt+0x1e/0x40
[ 363.140463] finish_task_switch.isra.0+0x157/0x3d0
[ 363.140492] __schedule+0x447/0x1880
[ 363.140516] schedule+0x59/0xc0
[ 363.140537] smpboot_thread_fn+0x161/0x1c0
[ 363.140565] kthread+0x143/0x160
[ 363.140585] ret_from_fork+0x22/0x30
[ 363.140614]
-> #1 (&pmlmepriv->scanned_queue.lock){+.-.}-{2:2}:
[ 363.140653] _raw_spin_lock_bh+0x34/0x40
[ 363.140675] rtw_free_network_queue+0x31/0x80 [r8723bs]
[ 363.140776] rtw_sitesurvey_cmd+0x79/0x1e0 [r8723bs]
[ 363.140869] rtw_cfg80211_surveydone_event_callback+0x3cf/0x470 [r8723bs]
[ 363.140973] rdev_scan+0x42/0x1a0 [cfg80211]
[ 363.141307] nl80211_trigger_scan+0x566/0x660 [cfg80211]
[ 363.141635] genl_family_rcv_msg_doit+0xcd/0x110
[ 363.141661] genl_rcv_msg+0xce/0x1c0
[ 363.141680] netlink_rcv_skb+0x50/0xf0
[ 363.141699] genl_rcv+0x24/0x40
[ 363.141717] netlink_unicast+0x16d/0x230
[ 363.141736] netlink_sendmsg+0x22b/0x450
[ 363.141755] sock_sendmsg+0x5e/0x60
[ 363.141781] ____sys_sendmsg+0x22f/0x270
[ 363.141803] ___sys_sendmsg+0x81/0xc0
[ 363.141828] __sys_sendmsg+0x49/0x80
[ 363.141851] do_syscall_64+0x3b/0x90
[ 363.141873] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 363.141895]
-> #0 (&pmlmepriv->lock){+.-.}-{2:2}:
[ 363.141930] __lock_acquire+0x1158/0x1de0
[ 363.141954] lock_acquire+0xb5/0x2b0
[ 363.141974] _raw_spin_lock_bh+0x34/0x40
[ 363.141993] _rtw_join_timeout_handler+0x3c/0x160 [r8723bs]
[ 363.142097] call_timer_fn+0x94/0x260
[ 363.142122] __run_timers.part.0+0x1bf/0x290
[ 363.142147] run_timer_softirq+0x26/0x50
[ 363.142171] __do_softirq+0xde/0x485
[ 363.142193] __irq_exit_rcu+0xd0/0x100
[ 363.142215] irq_exit_rcu+0xa/0x20
[ 363.142235] sysvec_apic_timer_interrupt+0x72/0x90
[ 363.142260] asm_sysvec_apic_timer_interrupt+0x12/0x20
[ 363.142283] __module_address.part.0+0x0/0xd0
[ 363.142309] is_module_address+0x25/0x40
[ 363.142334] static_obj+0x4f/0x60
[ 363.142361] lockdep_init_map_type+0x47/0x220
[ 363.142382] __init_swait_queue_head+0x45/0x60
[ 363.142408] mmc_wait_for_req+0x4a/0xc0 [mmc_core]
[ 363.142504] mmc_wait_for_cmd+0x55/0x70 [mmc_core]
[ 363.142592] mmc_io_rw_direct+0x75/0xe0 [mmc_core]
[ 363.142691] sdio_writeb+0x2e/0x50 [mmc_core]
[ 363.142788] _sd_cmd52_write+0x62/0x80 [r8723bs]
[ 363.142885] sd_cmd52_write+0x6c/0xb0 [r8723bs]
[ 363.142981] rtl8723bs_set_hal_ops+0x982/0x9b0 [r8723bs]
[ 363.143089] rtw_write16+0x1e/0x30 [r8723bs]
[ 363.143184] SetHwReg8723B+0xcc9/0xd30 [r8723bs]
[ 363.143294] mlmeext_joinbss_event_callback+0x17a/0x1a0 [r8723bs]
[ 363.143405] rtw_joinbss_event_callback+0x11/0x20 [r8723bs]
[ 363.143507] mlme_evt_hdl+0x4d/0x70 [r8723bs]
[ 363.143620] rtw_cmd_thread+0x168/0x3c0 [r8723bs]
[ 363.143712] kthread+0x143/0x160
[ 363.143732] ret_from_fork+0x22/0x30
[ 363.143757]
other info that might help us debug this:[ 363.143768] Chain exists of:
&pmlmepriv->lock --> &pmlmepriv->scanned_queue.lock --> (&pmlmepriv->assoc_timer)[ 363.143809] Possible unsafe locking scenario:
[ 363.143819] CPU0 CPU1
[ 363.143831] ---- ----
[ 363.143841] lock((&pmlmepriv->assoc_timer));
[ 363.143862] lock(&pmlmepriv->scanned_queue.lock);
[ 363.143882] lock((&pmlmepriv->assoc_timer));
[ 363.143902] lock(&pmlmepriv->lock);
[ 363.143921]
*** DEADLOCK ***Make rtw_joinbss_event_prehandle() release the scanned_queue.lock before it deletes the timer to avoid this (it is still holding pmlmepriv->lock protecting against racing the timer).
--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +2 -5
@@ -1240,16 +1240,13 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)rtw_indicate_connect (adapter); } +spin_unlock_bh (&pmlmepriv->scanned_queue.lock); +/* s5. Cancel assoc_timer */ del_timer_sync (&pmlmepriv->assoc_timer); - }else {spin_unlock_bh (&(pmlmepriv->scanned_queue.lock)); - goto ignore_joinbss_callback; } - -spin_unlock_bh (&(pmlmepriv->scanned_queue.lock)); - }else if (pnetwork->join_res ==-4 ) {rtw_reset_securitypriv (adapter);_set_timer (&pmlmepriv->assoc_timer,1 );
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 25/75 ARM: BCM53016: Specify switch ports for Meraki MR32
In reply to Sasha LevinFrom: Christian Lamparter <[email protected]>
[ Upstream commit 6abc4ca5a28070945e0d68cb4160b309bfbf4b8b ]
the switch identifies itself as a BCM53012 (rev 5)... This patch has been tested & verified on OpenWrt's snapshot with Linux 5.10 (didn't test any older kernels). The MR32 is able to "talk to the network" as before with OpenWrt's SWITCHDEV b53 driver.
| b53-srab-switch 18007000.ethernet-switch: found switch: BCM53012, rev 5 | libphy: dsa slave smi: probed | b53-srab-switch 18007000.ethernet-switch poe (uninitialized): | PHY [dsa-0.0:00] driver [Generic PHY] (irq=POLL) | b53-srab-switch 18007000.ethernet-switch: Using legacy PHYLIB callbacks. | Please migrate to PHYLINK! | DSA: tree 0 setup
--- arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
arch/arm/boot/dts/bcm53016-meraki-mr32.dts +22 -0
@@ -195,3 +195,25 @@ }; }; }; + +&srab { + status = "okay"; + + ports { + port@0 { + reg = <0>; + label = "poe"; + }; + + port@5 { + reg = <5>; + label = "cpu"; + ethernet = <&gmac0>; + + fixed-link { + speed = <1000>; + duplex-full; + }; + }; + }; +};
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 26/75 arm64: dts: qcom: msm8998: Fix CPU/L2 idle state latency and residency
In reply to Sasha LevinFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 3f1dcaff642e75c1d2ad03f783fa8a3b1f56dd50 ]
The entry/exit latency and minimum residency in state for the idle states of MSM8998 were ..bad: first of all, for all of them the timings were written for CPU sleep but the min-residency-us param was miscalculated (supposedly, while porting this from downstream); Then, the power collapse states are setting PC on both the CPU cluster *and* the L2 cache, which have different timings: in the specific case of L2 the times are higher so these ones should be taken into account instead of the CPU ones.
This parameter misconfiguration was not giving particular issues because on MSM8998 there was no CPU scaling at all, so cluster/L2 power collapse was rarely (if ever) hit.
When CPU scaling is enabled, though, the wrong timings will produce SoC unstability shown to the user as random, apparently error-less, sudden reboots and/or lockups.
This set of parameters are stabilizing the SoC when CPU scaling is ON and when power collapse is frequently hit.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +12 -8
@@ -308,38 +308,42 @@ LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 { compatible = "arm,idle-state"; idle-state-name = "little-retention"; + /* CPU Retention (C2D), L2 Active */ arm,psci-suspend-param = <0x00000002>; entry-latency-us = <81>; exit-latency-us = <86>; - min-residency-us = <200>; + min-residency-us = <504>; }; LITTLE_CPU_SLEEP_1: cpu-sleep-0-1 { compatible = "arm,idle-state"; idle-state-name = "little-power-collapse"; + /* CPU + L2 Power Collapse (C3, D4) */ arm,psci-suspend-param = <0x40000003>; - entry-latency-us = <273>; - exit-latency-us = <612>; - min-residency-us = <1000>; + entry-latency-us = <814>; + exit-latency-us = <4562>; + min-residency-us = <9183>; local-timer-stop; }; BIG_CPU_SLEEP_0: cpu-sleep-1-0 { compatible = "arm,idle-state"; idle-state-name = "big-retention"; + /* CPU Retention (C2D), L2 Active */ arm,psci-suspend-param = <0x00000002>; entry-latency-us = <79>; exit-latency-us = <82>; - min-residency-us = <200>; + min-residency-us = <1302>; }; BIG_CPU_SLEEP_1: cpu-sleep-1-1 { compatible = "arm,idle-state"; idle-state-name = "big-power-collapse"; + /* CPU + L2 Power Collapse (C3, D4) */ arm,psci-suspend-param = <0x40000003>; - entry-latency-us = <336>; - exit-latency-us = <525>; - min-residency-us = <1000>; + entry-latency-us = <724>; + exit-latency-us = <2027>; + min-residency-us = <9419>; local-timer-stop; }; };
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 27/75 arm64: dts: qcom: ipq6018: Fix qcom,controlled-remotely property
In reply to Sasha LevinFrom: Shawn Guo <[email protected]>
[ Upstream commit 3509de752ea14c7e5781b3a56a4a0bf832f5723a ]
Property qcom,controlled-remotely should be boolean. Fix it.
--- arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +1 -1
@@ -200,7 +200,7 @@ clock-names = "bam_clk"; #dma-cells = <1>; qcom,ee = <1>; - qcom,controlled-remotely = <1>; + qcom,controlled-remotely; qcom,config-pipe-trust-reg = <0>; };
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 28/75 arm64: dts: qcom: sdm845: Fix qcom,controlled-remotely property
In reply to Sasha LevinFrom: Shawn Guo <[email protected]>
[ Upstream commit 1c8bf398b6b51eb085a49036ad8f9c000171cce1 ]
Property qcom,controlled-remotely should be boolean. Fix it.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -1
@@ -2320,7 +2320,7 @@ clock-names = "bam_clk"; #dma-cells = <1>; qcom,ee = <0>; - qcom,controlled-remotely = <1>; + qcom,controlled-remotely; iommus = <&apps_smmu 0x704 0x1>, <&apps_smmu 0x706 0x1>, <&apps_smmu 0x714 0x1>,
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 29/75 arm64: dts: qcom: msm8916: Add unit name for /soc node
In reply to Sasha LevinFrom: Stephan Gerhold <[email protected]>
[ Upstream commit 7a62bfebc8c94bdb6eb8f54f49889dc6b5b79601 ]
This fixes the following warning when building with W=1:
Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +1 -1
@@ -414,7 +414,7 @@ }; }; - soc: soc { + soc: soc@0 { #address-cells = <1>; #size-cells = <1>; ranges = <0 0 0 0xffffffff>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 30/75 arm64: dts: freescale: fix arm,sp805 compatible string
In reply to Sasha LevinFrom: Michael Walle <[email protected]>
[ Upstream commit 99a7cacc66cae92db40139b57689be2af75fc6b8 ]
According to Documentation/devicetree/bindings/watchdog/arm,sp805.yaml the compatible is:
compatible = "arm,sp805", "arm,primecell";
The current compatible string doesn't exist at all. Fix it.
--- arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 16 ++++++++-------- arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-)
arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi +8 -8
@@ -829,7 +829,7 @@ }; cluster1_core0_watchdog: wdt@c000000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc000000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(16)>,
@@ -839,7 +839,7 @@ }; cluster1_core1_watchdog: wdt@c010000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc010000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(16)>,
@@ -849,7 +849,7 @@ }; cluster1_core2_watchdog: wdt@c020000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc020000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(16)>,
@@ -859,7 +859,7 @@ }; cluster1_core3_watchdog: wdt@c030000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc030000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(16)>,
@@ -869,7 +869,7 @@ }; cluster2_core0_watchdog: wdt@c100000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc100000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(16)>,
@@ -879,7 +879,7 @@ }; cluster2_core1_watchdog: wdt@c110000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc110000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(16)>,
@@ -889,7 +889,7 @@ }; cluster2_core2_watchdog: wdt@c120000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc120000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(16)>,
@@ -899,7 +899,7 @@ }; cluster2_core3_watchdog: wdt@c130000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc130000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(16)>,
arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi +8 -8
@@ -387,7 +387,7 @@ }; cluster1_core0_watchdog: wdt@c000000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc000000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>,
@@ -397,7 +397,7 @@ }; cluster1_core1_watchdog: wdt@c010000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc010000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>,
@@ -407,7 +407,7 @@ }; cluster2_core0_watchdog: wdt@c100000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc100000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>,
@@ -417,7 +417,7 @@ }; cluster2_core1_watchdog: wdt@c110000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc110000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>,
@@ -427,7 +427,7 @@ }; cluster3_core0_watchdog: wdt@c200000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc200000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>,
@@ -437,7 +437,7 @@ }; cluster3_core1_watchdog: wdt@c210000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc210000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>,
@@ -447,7 +447,7 @@ }; cluster4_core0_watchdog: wdt@c300000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc300000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>,
@@ -457,7 +457,7 @@ }; cluster4_core1_watchdog: wdt@c310000 { - compatible = "arm,sp805-wdt", "arm,primecell"; + compatible = "arm,sp805", "arm,primecell"; reg = <0x0 0xc310000 0x0 0x1000>; clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>,
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 31/75 arm64: dts: ls1012a: Add serial alias for ls1012a-rdb
In reply to Sasha LevinFrom: Kuldeep Singh <[email protected]>
[ Upstream commit 7f31ae6e01da140e34d6513815253e811019f016 ]
U-boot atempts to read serial alias value for ls1012a-rdb but couldn't do so as it is not initialised and thus, FDT_ERR_NOTFOUND error is reported while booting linux.
Loading fdt from FIT Image at a0000000 ...
Description: ls1012ardb-dtb
Type: Flat Device Tree
Data Start: 0xab111474
Data Size: 11285 Bytes = 11 KiB
Architecture: AArch64
Load Address: 0x90000000
Loading fdt from 0xab111474 to 0x90000000
Booting using the fdt blob at 0x90000000
Uncompressing Kernel Image
Loading Device Tree to 000000008fffa000, end 000000008ffffc14 ... OK
WARNING: fdt_fixup_stdout: could not read serial0 alias: FDT_ERR_NOTFOUND
NOTICE: RNG: INSTANTIATEDStarting kernel ...
Fix the above error by specifying serial value to duart.
--- arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts +1 -0
@@ -15,6 +15,7 @@ compatible = "fsl,ls1012a-rdb", "fsl,ls1012a"; aliases { + serial0 = &duart0; mmc0 = &esdhc0; mmc1 = &esdhc1; };
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 32/75 RDMA/rxe: Separate HW and SW l/rkeys
In reply to Sasha LevinFrom: Bob Pearson <[email protected]>
[ Upstream commit 001345339f4ca85790a1644a74e33ae77ac116be ]
Separate software and simulated hardware lkeys and rkeys for MRs and MWs. This makes struct ib_mr and struct ib_mw isolated from hardware changes triggered by executing work requests.
This change fixes a bug seen in blktest.
--- drivers/infiniband/sw/rxe/rxe_loc.h | 1 + drivers/infiniband/sw/rxe/rxe_mr.c | 69 ++++++++++++++++++++++----- drivers/infiniband/sw/rxe/rxe_mw.c | 30 ++++++------ drivers/infiniband/sw/rxe/rxe_req.c | 14 ++---- drivers/infiniband/sw/rxe/rxe_verbs.h | 18 ++----- 5 files changed, 81 insertions(+), 51 deletions(-)
drivers/infiniband/sw/rxe/rxe_loc.h +1 -0
@@ -87,6 +87,7 @@ struct rxe_mr *lookup_mr(struct rxe_pd *pd, int access, u32 key,int mr_check_range (struct rxe_mr *mr,u64 iova,size_t length);int advance_dma_data (struct rxe_dma_info *dma,unsigned int length);int rxe_invalidate_mr (struct rxe_qp *qp,u32 rkey); +int rxe_reg_fast_mr (struct rxe_qp *qp,struct rxe_send_wqe *wqe);int rxe_dereg_mr (struct ib_mr *ibmr,struct ib_udata *udata);void rxe_mr_cleanup (struct rxe_pool_entry *arg);
drivers/infiniband/sw/rxe/rxe_mr.c +58 -11
99 lines not on this page · raw message
drivers/infiniband/sw/rxe/rxe_mw.c +14 -16
@@ -21,7 +21,7 @@ int rxe_alloc_mw(struct ib_mw *ibmw, struct ib_udata *udata) }rxe_add_index (mw); - ibmw->rkey = (mw->pelem.index <<8 ) |rxe_get_next_key (-1 ); + mw->rkey = ibmw->rkey = (mw->pelem.index <<8 ) |rxe_get_next_key (-1 ); mw->state = (mw->ibmw.type ==IB_MW_TYPE_2 ) ?RXE_MW_STATE_FREE :RXE_MW_STATE_VALID ;spin_lock_init (&mw->lock);
@@ -71,6 +71,8 @@ int rxe_dealloc_mw(struct ib_mw *ibmw)static int rxe_check_bind_mw (struct rxe_qp *qp,struct rxe_send_wqe *wqe,struct rxe_mw *mw,struct rxe_mr *mr) { +u32 key = wqe->wr.wr.mw.rkey &0xff ; +if (mw->ibmw.type ==IB_MW_TYPE_1 ) {if (unlikely (mw->state !=RXE_MW_STATE_VALID )) { pr_err_once(
@@ -108,7 +110,7 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, } } -if (unlikely ((wqe->wr.wr.mw.rkey &0xff ) == (mw->ibmw.rkey &0xff ))) { +if (unlikely (key == (mw->rkey &0xff ))) {pr_err_once ("attempt to bind MW with same key\n" );return -EINVAL ; }
@@ -161,13 +163,9 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe,static void rxe_do_bind_mw (struct rxe_qp *qp,struct rxe_send_wqe *wqe,struct rxe_mw *mw,struct rxe_mr *mr) { -u32 rkey; -u32 new_rkey; - - rkey = mw->ibmw.rkey; - new_rkey = (rkey &0xffffff00 ) | (wqe->wr.wr.mw.rkey &0x000000ff ); +u32 key = wqe->wr.wr.mw.rkey &0xff ; - mw->ibmw.rkey = new_rkey; + mw->rkey = (mw->rkey & ~0xff ) | key; mw->access = wqe->wr.wr.mw.access; mw->state =RXE_MW_STATE_VALID ; mw->addr = wqe->wr.wr.mw.addr;
@@ -197,29 +195,29 @@ int rxe_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe)struct rxe_mw *mw;struct rxe_mr *mr;struct rxe_dev *rxe =to_rdev (qp->ibqp.device); +u32 mw_rkey = wqe->wr.wr.mw.mw_rkey; +u32 mr_lkey = wqe->wr.wr.mw.mr_lkey;unsigned long flags; - mw =rxe_pool_get_index (&rxe->mw_pool, - wqe->wr.wr.mw.mw_rkey >>8 ); + mw =rxe_pool_get_index (&rxe->mw_pool, mw_rkey >>8 );if (unlikely (!mw)) { ret = -EINVAL ; goto err; } -if (unlikely (mw->ibmw.rkey != wqe->wr.wr.mw.mw_rkey)) { +if (unlikely (mw->rkey != mw_rkey)) { ret = -EINVAL ; goto err_drop_mw; }if (likely (wqe->wr.wr.mw.length)) { - mr =rxe_pool_get_index (&rxe->mr_pool, - wqe->wr.wr.mw.mr_lkey >>8 ); + mr =rxe_pool_get_index (&rxe->mr_pool, mr_lkey >>8 );if (unlikely (!mr)) { ret = -EINVAL ; goto err_drop_mw; } -if (unlikely (mr->ibmr.lkey != wqe->wr.wr.mw.mr_lkey)) { +if (unlikely (mr->lkey != mr_lkey)) { ret = -EINVAL ; goto err_drop_mr; }
@@ -292,7 +290,7 @@ int rxe_invalidate_mw(struct rxe_qp *qp, u32 rkey) goto err; } -if (rkey != mw->ibmw.rkey) { +if (rkey != mw->rkey) { ret = -EINVAL ; goto err_drop_ref; }
@@ -323,7 +321,7 @@ struct rxe_mw *rxe_lookup_mw(struct rxe_qp *qp, int access, u32 rkey)if (!mw)return NULL ; - if (unlikely((rxe_mw_rkey(mw) != rkey) || rxe_mw_pd(mw) != pd || + if (unlikely((mw->rkey != rkey) || rxe_mw_pd(mw) != pd || (mw->ibmw.type == IB_MW_TYPE_2 && mw->qp != qp) || (mw->length == 0) || (access && !(access & mw->access)) ||
drivers/infiniband/sw/rxe/rxe_req.c +5 -9
@@ -581,7 +581,6 @@ static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe,static int rxe_do_local_ops (struct rxe_qp *qp,struct rxe_send_wqe *wqe) {u8 opcode = wqe->wr.opcode; -struct rxe_mr *mr;u32 rkey;int ret;
@@ -599,14 +598,11 @@ static int rxe_do_local_ops(struct rxe_qp *qp, struct rxe_send_wqe *wqe) }break ;case IB_WR_REG_MR : - mr =to_rmr (wqe->wr.wr.reg.mr); -rxe_add_ref (mr); - mr->state =RXE_MR_STATE_VALID ; - mr->access = wqe->wr.wr.reg.access; - mr->ibmr.lkey = wqe->wr.wr.reg.key; - mr->ibmr.rkey = wqe->wr.wr.reg.key; - mr->iova = wqe->wr.wr.reg.mr->iova; -rxe_drop_ref (mr); + ret =rxe_reg_fast_mr (qp, wqe); +if (unlikely (ret)) { + wqe->status =IB_WC_LOC_QP_OP_ERR ; +return ret; + }break ;case IB_WR_BIND_MW : ret =rxe_bind_mw (qp, wqe);
drivers/infiniband/sw/rxe/rxe_verbs.h +3 -15
@@ -313,6 +313,8 @@ struct rxe_mr {struct ib_umem *umem; +u32 lkey; +u32 rkey;enum rxe_mr_state state;enum rxe_mr_type type;u64 va;
@@ -350,6 +352,7 @@ struct rxe_mw {enum rxe_mw_state state;struct rxe_qp *qp;/* Type 2 only */ struct rxe_mr *mr; +u32 rkey;int access;u64 addr;u64 length;
@@ -474,26 +477,11 @@ static inline struct rxe_pd *mr_pd(struct rxe_mr *mr)return to_rpd (mr->ibmr.pd); } -static inline u32 mr_lkey (struct rxe_mr *mr) -{ -return mr->ibmr.lkey; -} - -static inline u32 mr_rkey (struct rxe_mr *mr) -{ -return mr->ibmr.rkey; -} -static inline struct rxe_pd *rxe_mw_pd (struct rxe_mw *mw) {return to_rpd (mw->ibmw.pd); } -static inline u32 rxe_mw_rkey (struct rxe_mw *mw) -{ -return mw->ibmw.rkey; -} -int rxe_register_device (struct rxe_dev *rxe,const char *ibdev_name);void rxe_mc_cleanup (struct rxe_pool_entry *arg);
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 33/75 ASoC: SOF: Intel: hda-dai: fix potential locking issue
In reply to Sasha LevinFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit a20f3b10de61add5e14b6ce4df982f4df2a4cbbc ]
The initial hdac_stream code was adapted a third time with the same locking issues. Move the spin_lock outside the loops and make sure the fields are protected on read/write.
--- sound/soc/sof/intel/hda-dai.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
sound/soc/sof/intel/hda-dai.c +4 -3
@@ -68,6 +68,7 @@ static struct hdac_ext_stream *return NULL ; } +spin_lock_irq (&bus->reg_lock);list_for_each_entry (stream, &bus->stream_list, list) {struct hdac_ext_stream *hstream =stream_to_hdac_ext_stream (stream);
@@ -107,12 +108,12 @@ static struct hdac_ext_stream ** is updated in snd_hdac_ext_stream_decouple(). */ if (!res->decoupled) -snd_hdac_ext_stream_decouple (bus, res, true); -spin_lock_irq (&bus->reg_lock); +snd_hdac_ext_stream_decouple_locked (bus, res, true); + res->link_locked =1 ; res->link_substream = substream; -spin_unlock_irq (&bus->reg_lock); } +spin_unlock_irq (&bus->reg_lock);return res; }
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 34/75 scsi: core: Fix scsi_mode_sense() buffer length handling
In reply to Sasha LevinFrom: Damien Le Moal <[email protected]>
[ Upstream commit 17b49bcbf8351d3dbe57204468ac34f033ed60bc ]
Several problems exist with scsi_mode_sense() buffer length handling:
1) The allocation length field of the MODE SENSE(10) command is 16-bits, occupying bytes 7 and 8 of the CDB. With this command, access to mode pages larger than 255 bytes is thus possible. However, the CDB allocation length field is set by assigning len to byte 8 only, thus truncating buffer length larger than 255.
2) If scsi_mode_sense() is called with len smaller than 8 with sdev->use_10_for_ms set, or smaller than 4 otherwise, the buffer length is increased to 8 and 4 respectively, and the buffer is zero filled with these increased values, thus corrupting the memory following the buffer.
Fix these 2 problems by using put_unaligned_be16() to set the allocation length field of MODE SENSE(10) CDB and by returning an error when len is too small.
Furthermore, if len is larger than 255B, always try MODE SENSE(10) first, even if the device driver did not set sdev->use_10_for_ms. In case of invalid opcode error for MODE SENSE(10), access to mode pages larger than 255 bytes are not retried using MODE SENSE(6). To avoid buffer length overflows for the MODE_SENSE(10) case, check that len is smaller than 65535 bytes.
While at it, also fix the folowing:
* Use get_unaligned_be16() to retrieve the mode data length and block descriptor length fields of the mode sense reply header instead of using an open coded calculation.
* Fix the kdoc dbd argument explanation: the DBD bit stands for Disable Block Descriptor, which is the opposite of what the dbd argument description was.
--- drivers/scsi/scsi_lib.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/scsi/scsi_lib.c +15 -10
@@ -2070,7 +2070,7 @@ EXPORT_SYMBOL_GPL(scsi_mode_select);/** * scsi_mode_sense - issue a mode sense, falling back from 10 to six bytes if necessary. * @sdev: SCSI device to be queried -* @dbd: set if mode sense will allow block descriptors to be returned +* @dbd: set to prevent mode sense from returning block descriptors * @modepage: mode page being requested * @buffer: request buffer (may not be smaller than eight bytes) * @len: length of request buffer.
@@ -2105,18 +2105,18 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, sshdr = &my_sshdr; retry: - use_10_for_ms = sdev->use_10_for_ms; + use_10_for_ms = sdev->use_10_for_ms || len >255 ;if (use_10_for_ms) { -if (len <8 ) - len =8 ; +if (len <8 || len >65535 ) +return -EINVAL ; cmd[0 ] =MODE_SENSE_10 ; - cmd[8 ] = len; +put_unaligned_be16 (len, &cmd[7 ]); header_length =8 ; }else {if (len <4 ) - len =4 ; +return -EINVAL ; cmd[0 ] =MODE_SENSE ; cmd[4 ] = len;
@@ -2140,9 +2140,15 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,if ((sshdr->sense_key ==ILLEGAL_REQUEST ) && (sshdr->asc ==0x20 ) && (sshdr->ascq ==0 )) {/* -* Invalid command operation code +* Invalid command operation code: retry using +* MODE SENSE(6) if this was a MODE SENSE(10) +* request, except if the request mode page is +* too large for MODE SENSE single byte +* allocation length field. */ if (use_10_for_ms) { +if (len >255 ) +return -EIO ; sdev->use_10_for_ms =0 ; goto retry; }
@@ -2166,12 +2172,11 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, data->longlba =0 ; data->block_descriptor_length =0 ; }else if (use_10_for_ms) { - data->length = buffer[0 ]*256 + buffer[1 ] +2 ; + data->length =get_unaligned_be16 (&buffer[0 ]) +2 ; data->medium_type = buffer[2 ]; data->device_specific = buffer[3 ]; data->longlba = buffer[4 ] &0x01 ; - data->block_descriptor_length = buffer[6 ]*256 - + buffer[7 ]; + data->block_descriptor_length =get_unaligned_be16 (&buffer[6 ]); }else { data->length = buffer[0 ] +1 ; data->medium_type = buffer[1 ];
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 35/75 ALSA: usb-audio: disable implicit feedback sync for Behringer UFX1204 and UFX1604
In reply to Sasha LevinFrom: Geraldo Nascimento <[email protected]>
[ Upstream commit 28c369e60827f706cef4604a3e2848198f25bd26 ]
Behringer UFX1204 and UFX1604 have Synchronous endpoints to which current ALSA code applies implicit feedback sync as if they were Asynchronous endpoints. This breaks UAC compliance and is unneeded.
The commit 5e35dc0338d85ccebacf3f77eca1e5dea73155e8 and subsequent 1a15718b41df026cffd0e42cfdc38a1384ce19f9 were meant to clear up noise.
Unfortunately, noise persisted for those using higher sample rates and this was only solved by commit d2e8f641257d0d3af6e45d6ac2d6f9d56b8ea964
Since there are no more reports of noise, let's get rid of the implicit-fb quirks breaking UAC compliance.
--- sound/usb/implicit.c | 2 -- 1 file changed, 2 deletions(-)
sound/usb/implicit.c +0 -2
@@ -54,8 +54,6 @@ static const struct snd_usb_implicit_fb_match playback_implicit_fb_quirks[] = {/* Fixed EP */ /* FIXME: check the availability of generic matching */ -IMPLICIT_FB_FIXED_DEV (0x1397 ,0x0001 ,0x81 ,1 ),/* Behringer UFX1604 */ -IMPLICIT_FB_FIXED_DEV (0x1397 ,0x0002 ,0x81 ,1 ),/* Behringer UFX1204 */ IMPLICIT_FB_FIXED_DEV (0x2466 ,0x8010 ,0x81 ,2 ),/* Fractal Audio Axe-Fx III */ IMPLICIT_FB_FIXED_DEV (0x31e9 ,0x0001 ,0x81 ,2 ),/* Solid State Logic SSL2 */ IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0002, 0x81, 2), /* Solid State Logic SSL2+ */
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 36/75 clk: imx: imx6ul: Move csi_sel mux to correct base register
In reply to Sasha LevinFrom: Stefan Riedmueller <[email protected]>
[ Upstream commit 2f9d61869640f732599ec36b984c2b5c46067519 ]
The csi_sel mux register is located in the CCM register base and not the CCM_ANALOG register base. So move it to the correct position in code.
Otherwise changing the parent of the csi clock can lead to a complete system failure due to the CCM_ANALOG_PLL_SYS_TOG register being falsely modified.
Also remove the SET_RATE_PARENT flag since one possible supply for the csi_sel mux is the system PLL which we don't want to modify.
--- drivers/clk/imx/clk-imx6ul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx6ul.c +1 -1
@@ -161,7 +161,6 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) hws[IMX6UL_PLL5_BYPASS ] =imx_clk_hw_mux_flags ("pll5_bypass" , base +0xa0 ,16 ,1 , pll5_bypass_sels,ARRAY_SIZE (pll5_bypass_sels),CLK_SET_RATE_PARENT ); hws[IMX6UL_PLL6_BYPASS ] =imx_clk_hw_mux_flags ("pll6_bypass" , base +0xe0 ,16 ,1 , pll6_bypass_sels,ARRAY_SIZE (pll6_bypass_sels),CLK_SET_RATE_PARENT ); hws[IMX6UL_PLL7_BYPASS ] =imx_clk_hw_mux_flags ("pll7_bypass" , base +0x20 ,16 ,1 , pll7_bypass_sels,ARRAY_SIZE (pll7_bypass_sels),CLK_SET_RATE_PARENT ); - hws[IMX6UL_CLK_CSI_SEL ] =imx_clk_hw_mux_flags ("csi_sel" , base +0x3c ,9 ,2 , csi_sels,ARRAY_SIZE (csi_sels),CLK_SET_RATE_PARENT );/* Do not bypass PLLs initially */ clk_set_parent (hws[IMX6UL_PLL1_BYPASS ]->clk, hws[IMX6UL_CLK_PLL1 ]->clk);
@@ -270,6 +269,7 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) hws[IMX6UL_CLK_ECSPI_SEL ] =imx_clk_hw_mux ("ecspi_sel" , base +0x38 ,18 ,1 , ecspi_sels,ARRAY_SIZE (ecspi_sels)); hws[IMX6UL_CLK_LCDIF_PRE_SEL ] =imx_clk_hw_mux_flags ("lcdif_pre_sel" , base +0x38 ,15 ,3 , lcdif_pre_sels,ARRAY_SIZE (lcdif_pre_sels),CLK_SET_RATE_PARENT ); hws[IMX6UL_CLK_LCDIF_SEL ] =imx_clk_hw_mux ("lcdif_sel" , base +0x38 ,9 ,3 , lcdif_sels,ARRAY_SIZE (lcdif_sels)); + hws[IMX6UL_CLK_CSI_SEL ] =imx_clk_hw_mux ("csi_sel" , base +0x3c ,9 ,2 , csi_sels,ARRAY_SIZE (csi_sels)); hws[IMX6UL_CLK_LDB_DI0_DIV_SEL ] =imx_clk_hw_mux ("ldb_di0" , base +0x20 ,10 ,1 , ldb_di0_div_sels,ARRAY_SIZE (ldb_di0_div_sels)); hws[IMX6UL_CLK_LDB_DI1_DIV_SEL ] =imx_clk_hw_mux ("ldb_di1" , base +0x20 ,11 ,1 , ldb_di1_div_sels,ARRAY_SIZE (ldb_di1_div_sels));
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 37/75 ASoC: es8316: Use IRQF_NO_AUTOEN when requesting the IRQ
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 1cf2aa665901054b140eb71748661ceae99b6b5a ]
Use the new IRQF_NO_AUTOEN flag when requesting the IRQ, rather then disabling it immediately after requesting it.
This fixes a possible race where the IRQ might trigger between requesting and disabling it; and this also leads to a small code cleanup.
--- sound/soc/codecs/es8316.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
sound/soc/codecs/es8316.c +2 -5
@@ -811,12 +811,9 @@ static int es8316_i2c_probe(struct i2c_client *i2c_client,mutex_init (&es8316->lock); ret =devm_request_threaded_irq (dev, es8316->irq,NULL , es8316_irq, -IRQF_TRIGGER_HIGH |IRQF_ONESHOT , +IRQF_TRIGGER_HIGH |IRQF_ONESHOT |IRQF_NO_AUTOEN ,"es8316" , es8316); -if (ret ==0 ) { -/* Gets re-enabled by es8316_set_jack() */ -disable_irq (es8316->irq); - }else { +if (ret) {dev_warn (dev,"Failed to get IRQ %d: %d\n" , es8316->irq, ret); es8316->irq = -ENXIO ; }
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 38/75 ASoC: rt5651: Use IRQF_NO_AUTOEN when requesting the IRQ
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 6e037b72cf4ea6c28a131ea021d63ee4e7e6fa64 ]
Use the new IRQF_NO_AUTOEN flag when requesting the IRQ, rather then disabling it immediately after requesting it.
This fixes a possible race where the IRQ might trigger between requesting and disabling it; and this also leads to a small code cleanup.
--- sound/soc/codecs/rt5651.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
sound/soc/codecs/rt5651.c +2 -5
@@ -2261,11 +2261,8 @@ static int rt5651_i2c_probe(struct i2c_client *i2c, ret =devm_request_irq (&i2c->dev, rt5651->irq, rt5651_irq,IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING - |IRQF_ONESHOT ,"rt5651" , rt5651); -if (ret ==0 ) { -/* Gets re-enabled by rt5651_set_jack() */ -disable_irq (rt5651->irq); - }else { + |IRQF_ONESHOT |IRQF_NO_AUTOEN ,"rt5651" , rt5651); +if (ret) {dev_warn (&i2c->dev,"Failed to reguest IRQ %d: %d\n" , rt5651->irq, ret); rt5651->irq = -ENXIO ;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 39/75 ASoC: nau8824: Add DMI quirk mechanism for active-high jack-detect
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 92d3360108f1839ca40451bad20ff67dd24a1964 ]
Add a quirk mechanism to allow specifying that active-high jack-detection should be used on platforms where this info is not available in devicetree.
And add an entry for the Cyberbook T116 tablet to the DMI table, so that jack-detection will work properly on this tablet.
--- sound/soc/codecs/nau8824.c | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
sound/soc/codecs/nau8824.c +40 -0
@@ -8,6 +8,7 @@#include <linux/module.h> #include <linux/delay.h> +#include <linux/dmi.h> #include <linux/init.h> #include <linux/i2c.h> #include <linux/regmap.h>
@@ -27,6 +28,12 @@#include "nau8824.h" +#define NAU8824_JD_ACTIVE_HIGH BIT(0) + +static int nau8824_quirk; +static int quirk_override =-1 ; +module_param_named (quirk, quirk_override, uint,0444 ); +MODULE_PARM_DESC (quirk,"Board-specific quirk override" );static int nau8824_config_sysclk (struct nau8824 *nau8824,int clk_id,unsigned int freq);
@@ -1845,6 +1852,34 @@ static int nau8824_read_device_properties(struct device *dev,return 0 ; } +/* Please keep this list alphabetically sorted */ +static const struct dmi_system_id nau8824_quirk_table[] = { + { +/* Cyberbook T116 rugged tablet */ + .matches = { +DMI_EXACT_MATCH (DMI_BOARD_VENDOR ,"Default string" ), +DMI_EXACT_MATCH (DMI_BOARD_NAME ,"Cherry Trail CR" ), +DMI_EXACT_MATCH (DMI_PRODUCT_SKU ,"20170531" ), + }, + .driver_data = (void *)(NAU8824_JD_ACTIVE_HIGH ), + }, + {} +}; + +static void nau8824_check_quirks (void ) +{ +const struct dmi_system_id *dmi_id; + +if (quirk_override !=-1 ) { + nau8824_quirk = quirk_override; +return ; + } + + dmi_id =dmi_first_match (nau8824_quirk_table); +if (dmi_id) + nau8824_quirk = (unsigned long )dmi_id->driver_data; +} +static int nau8824_i2c_probe (struct i2c_client *i2c,const struct i2c_device_id *id) {
@@ -1869,6 +1904,11 @@ static int nau8824_i2c_probe(struct i2c_client *i2c, nau8824->irq = i2c->irq;sema_init (&nau8824->jd_sem,1 ); +nau8824_check_quirks (); + +if (nau8824_quirk &NAU8824_JD_ACTIVE_HIGH ) + nau8824->jkdet_polarity =0 ; +nau8824_print_device_properties (nau8824); ret =regmap_read (nau8824->regmap,NAU8824_REG_I2C_DEVICE_ID , &value);
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 40/75 scsi: advansys: Fix kernel pointer leak
In reply to Sasha LevinFrom: Guo Zhi <[email protected]>
[ Upstream commit d4996c6eac4c81b8872043e9391563f67f13e406 ]
Pointers should be printed with %p or %px rather than cast to 'unsigned long' and printed with %lx.
Change %lx to %p to print the hashed pointer.
--- drivers/scsi/advansys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/advansys.c +2 -2
@@ -3308,8 +3308,8 @@ static void asc_prt_adv_board_info(struct seq_file *m, struct Scsi_Host *shost) shost->host_no);seq_printf (m, -" iop_base 0x%lx, cable_detect: %X, err_code %u\n" , - (unsigned long )v->iop_base, +" iop_base 0x%p, cable_detect: %X, err_code %u\n" , + v->iop_base,AdvReadWordRegister (iop_base,IOPW_SCSI_CFG1 ) &CABLE_DETECT , v->err_code);
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 41/75 scsi: smartpqi: Add controller handshake during kdump
In reply to Sasha LevinFrom: Mahesh Rajashekhara <[email protected]>
[ Upstream commit 9ee5d6e9ac52a3c8625697535f8e35864d9fd38c ]
Correct kdump hangs when controller is locked up.
There are occasions when a controller reboot (controller soft reset) is issued when a controller firmware crash dump is in progress.
This leads to incomplete controller firmware crash dump:
- When the controller crash dump is in progress, and a kdump is initiated, the driver issues inbound doorbell reset to bring back the controller in SIS mode.
- If the controller is in locked up state, the inbound doorbell reset does not work causing controller initialization failures. This results in the driver hanging waiting for SIS mode.
To avoid an incomplete controller crash dump, add in a controller crash dump handshake:
- Controller will indicate start and end of the controller crash dump by setting some register bits.
- Driver will look these bits when a kdump is initiated. If a controller crash dump is in progress, the driver will wait for the controller crash dump to complete before issuing the controller soft reset then complete driver initialization.
--- drivers/scsi/smartpqi/smartpqi_init.c | 41 +++++++++++++++++++-- drivers/scsi/smartpqi/smartpqi_sis.c | 51 +++++++++++++++++++++++++++ drivers/scsi/smartpqi/smartpqi_sis.h | 1 + 3 files changed, 91 insertions(+), 2 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +39 -2
@@ -234,15 +234,46 @@ static inline bool pqi_is_hba_lunid(u8 *scsi3addr)return pqi_scsi3addr_equal (scsi3addr,RAID_CTLR_LUNID ); } +#define PQI_DRIVER_SCRATCH_PQI_MODE 0x1 +#define PQI_DRIVER_SCRATCH_FW_TRIAGE_SUPPORTED 0x2 +static inline enum pqi_ctrl_mode pqi_get_ctrl_mode (struct pqi_ctrl_info *ctrl_info) { -return sis_read_driver_scratch (ctrl_info); +return sis_read_driver_scratch (ctrl_info) &PQI_DRIVER_SCRATCH_PQI_MODE ?PQI_MODE :SIS_MODE ; }static inline void pqi_save_ctrl_mode (struct pqi_ctrl_info *ctrl_info,enum pqi_ctrl_mode mode) { -sis_write_driver_scratch (ctrl_info, mode); +u32 driver_scratch; + + driver_scratch =sis_read_driver_scratch (ctrl_info); + +if (mode ==PQI_MODE ) + driver_scratch |=PQI_DRIVER_SCRATCH_PQI_MODE ; +else + driver_scratch &= ~PQI_DRIVER_SCRATCH_PQI_MODE ; + +sis_write_driver_scratch (ctrl_info, driver_scratch); +} + +static inline bool pqi_is_fw_triage_supported (struct pqi_ctrl_info *ctrl_info) +{ +return (sis_read_driver_scratch (ctrl_info) &PQI_DRIVER_SCRATCH_FW_TRIAGE_SUPPORTED ) !=0 ; +} + +static inline void pqi_save_fw_triage_setting (struct pqi_ctrl_info *ctrl_info,bool is_supported) +{ +u32 driver_scratch; + + driver_scratch =sis_read_driver_scratch (ctrl_info); + +if (is_supported) + driver_scratch |=PQI_DRIVER_SCRATCH_FW_TRIAGE_SUPPORTED ; +else + driver_scratch &= ~PQI_DRIVER_SCRATCH_FW_TRIAGE_SUPPORTED ; + +sis_write_driver_scratch (ctrl_info, driver_scratch); }static inline void pqi_ctrl_block_scan (struct pqi_ctrl_info *ctrl_info)
@@ -7300,6 +7331,7 @@ static void pqi_ctrl_update_feature_flags(struct pqi_ctrl_info *ctrl_info, ctrl_info->unique_wwid_in_report_phys_lun_supported = firmware_feature->enabled;break ; +pqi_save_fw_triage_setting (ctrl_info, firmware_feature->enabled); }pqi_firmware_feature_status (ctrl_info, firmware_feature);
@@ -7626,6 +7658,11 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)u32 product_id;if (reset_devices) { +if (pqi_is_fw_triage_supported (ctrl_info)) { + rc =sis_wait_for_fw_triage_completion (ctrl_info); +if (rc) +return rc; + }sis_soft_reset (ctrl_info);msleep (PQI_POST_RESET_DELAY_SECS *PQI_HZ ); }else {
drivers/scsi/smartpqi/smartpqi_sis.c +51 -0
75 lines not on this page · raw message
drivers/scsi/smartpqi/smartpqi_sis.h +1 -0
@@ -28,5 +28,6 @@ void sis_write_driver_scratch(struct pqi_ctrl_info *ctrl_info, u32 value);u32 sis_read_driver_scratch (struct pqi_ctrl_info *ctrl_info);void sis_soft_reset (struct pqi_ctrl_info *ctrl_info);u32 sis_get_product_id (struct pqi_ctrl_info *ctrl_info); +int sis_wait_for_fw_triage_completion (struct pqi_ctrl_info *ctrl_info);#endif /* _SMARTPQI_SIS_H */
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 42/75 arm64: dts: imx8mm-kontron: Fix reset delays for ethernet PHY
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 315e7b884190a6c9c28e95ad3b724dde9e922b99 ]
According to the datasheet the VSC8531 PHY expects a reset pulse of 100 ns and a delay of 15 ms after the reset has been deasserted. Set the matching values in the devicetree.
--- arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts +2 -2
@@ -123,8 +123,8 @@ ethphy: ethernet-phy@0 { reg = <0>; - reset-assert-us = <100>; - reset-deassert-us = <100>; + reset-assert-us = <1>; + reset-deassert-us = <15000>; reset-gpios = <&gpio4 27 GPIO_ACTIVE_LOW>; }; };
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 43/75 ALSA: intel-dsp-config: add quirk for APL/GLK/TGL devices based on ES8336 codec
In reply to Sasha LevinFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 9d36ceab94151f07cf3fcb067213ac87937adf12 ]
These devices are based on an I2C/I2S device, we need to force the use of the SOF driver otherwise the legacy HDaudio driver will be loaded - only HDMI will be supported.
--- sound/hda/intel-dsp-config.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
sound/hda/intel-dsp-config.c +20 -2
@@ -31,6 +31,7 @@ struct config_entry {u16 device;u8 acpi_hid[ACPI_ID_LEN ];const struct dmi_system_id *dmi_table; +u8 codec_hid[ACPI_ID_LEN ]; };/*
@@ -56,7 +57,7 @@ static const struct config_entry config_table[] = {/* * Apollolake (Broxton-P) * the legacy HDAudio driver is used except on Up Squared (SOF) and -* Chromebooks (SST) +* Chromebooks (SST), as well as devices based on the ES8336 codec */ #if IS_ENABLED (CONFIG_SND_SOC_SOF_APOLLOLAKE ) {
@@ -73,6 +74,11 @@ static const struct config_entry config_table[] = { {} } }, + { + .flags = FLAG_SOF, + .device = 0x5a98, + .codec_hid = "ESSX8336", + }, #endif#if IS_ENABLED (CONFIG_SND_SOC_INTEL_APL ) {
@@ -137,7 +143,7 @@ static const struct config_entry config_table[] = {/* * Geminilake uses legacy HDAudio driver except for Google -* Chromebooks +* Chromebooks and devices based on the ES8336 codec */ /* Geminilake */ #if IS_ENABLED (CONFIG_SND_SOC_SOF_GEMINILAKE )
@@ -154,6 +160,11 @@ static const struct config_entry config_table[] = { {} } }, + { + .flags = FLAG_SOF, + .device = 0x3198, + .codec_hid = "ESSX8336", + }, #endif/*
@@ -311,6 +322,11 @@ static const struct config_entry config_table[] = { .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, .device = 0x43c8, }, + { + .flags = FLAG_SOF, + .device = 0xa0c8, + .codec_hid = "ESSX8336", + },#endif /* Elkhart Lake */
@@ -354,6 +370,8 @@ static const struct config_entry *snd_intel_dsp_find_configcontinue ;if (table->dmi_table && !dmi_check_system (table->dmi_table))continue ; +if (table->codec_hid[0 ] && !acpi_dev_present (table->codec_hid,NULL ,-1 )) +continue ;return table; }return NULL ;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 44/75 ASoC: Intel: soc-acpi: add missing quirk for TGL SDCA single amp
In reply to Sasha LevinFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit f2470679b070a77ea22f8b791fae7084c2340c7d ]
We don't have a configuration for a single amp on link1.
--- .../intel/common/soc-acpi-intel-tgl-match.c | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+)
sound/soc/intel/common/soc-acpi-intel-tgl-match.c +41 -0
@@ -155,6 +155,15 @@ static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = { } }; +static const struct snd_soc_acpi_adr_device rt1316_1_single_adr[] = { + { + .adr =0x000131025D131601ull , + .num_endpoints =1 , + .endpoints = &single_endpoint, + .name_prefix ="rt1316-1" + } +}; +static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = { { .adr =0x000131025D131601ull ,/* unique ID is set for some reason */
@@ -310,6 +319,25 @@ static const struct snd_soc_acpi_link_adr tgl_3_in_1_sdca[] = { {} }; +static const struct snd_soc_acpi_link_adr tgl_3_in_1_sdca_mono[] = { + { + .mask =BIT (0 ), + .num_adr =ARRAY_SIZE (rt711_sdca_0_adr), + .adr_d = rt711_sdca_0_adr, + }, + { + .mask =BIT (1 ), + .num_adr =ARRAY_SIZE (rt1316_1_single_adr), + .adr_d = rt1316_1_single_adr, + }, + { + .mask =BIT (3 ), + .num_adr =ARRAY_SIZE (rt714_3_adr), + .adr_d = rt714_3_adr, + }, + {} +}; +static const struct snd_soc_acpi_codecs tgl_max98373_amp = { .num_codecs =1 , .codecs = {"MX98373" }
@@ -380,6 +408,19 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-tgl-rt711-rt1316-rt714.tplg", }, + { +/* +* link_mask should be 0xB, but all links are enabled by BIOS. +* This entry will be selected if there is no rt1316 amplifier exposed +* on link2 since it will fail to match the above entry. +*/ + + .link_mask = 0xF, /* 4 active links required */ + .links = tgl_3_in_1_sdca_mono, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-tgl-rt711-l0-rt1316-l1-mono-rt714-l3.tplg", + }, + { .link_mask = 0x3, /* rt711 on link 0 and 1 rt1308 on link 1 */ .links = tgl_hp,
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 45/75 ASoC: Intel: sof_sdw: add missing quirk for Dell SKU 0A45
In reply to Sasha LevinFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 64ba6d2ce72ffde70dc5a1794917bf1573203716 ]
This device is based on SDCA codecs but with a single amplifier instead of two.
--- sound/soc/intel/boards/sof_sdw.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/soc/intel/boards/sof_sdw.c +10 -0
@@ -189,6 +189,16 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {SOF_RT715_DAI_ID_FIX | SOF_SDW_FOUR_SPK), }, + { + .callback = sof_sdw_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc" ), +DMI_EXACT_MATCH (DMI_PRODUCT_SKU ,"0A45" ) + }, + .driver_data = (void *)(SOF_SDW_TGL_HDMI | +RT711_JD2 | + SOF_RT715_DAI_ID_FIX), + }, /* AlderLake devices */ { .callback = sof_sdw_quirk_cb,
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 46/75 firmware_loader: fix pre-allocated buf built-in firmware use
In reply to Sasha LevinFrom: Luis Chamberlain <[email protected]>
[ Upstream commit f7a07f7b96033df7709042ff38e998720a3f7119 ]
The firmware_loader can be used with a pre-allocated buffer through the use of the API calls:
o request_firmware_into_buf()
o request_partial_firmware_into_buf()
If the firmware was built-in and present, our current check for if the built-in firmware fits into the pre-allocated buffer does not return any errors, and we proceed to tell the caller that everything worked fine. It's a lie and no firmware would end up being copied into the pre-allocated buffer. So if the caller trust the result it may end up writing a bunch of 0's to a device!
Fix this by making the function that checks for the pre-allocated buffer return non-void. Since the typical use case is when no pre-allocated buffer is provided make this return successfully for that case. If the built-in firmware does *not* fit into the pre-allocated buffer size return a failure as we should have been doing before.
I'm not aware of users of the built-in firmware using the API calls with a pre-allocated buffer, as such I doubt this fixes any real life issue. But you never know... perhaps some oddball private tree might use it.
In so far as upstream is concerned this just fixes our code for correctness.
--- drivers/base/firmware_loader/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/base/firmware_loader/main.c +7 -6
@@ -100,12 +100,15 @@ static struct firmware_cache fw_cache;extern struct builtin_fw __start_builtin_fw[];extern struct builtin_fw __end_builtin_fw[]; -static void fw_copy_to_prealloc_buf (struct firmware *fw, +static bool fw_copy_to_prealloc_buf (struct firmware *fw,void *buf,size_t size) { -if (!buf || size < fw->size) -return ; +if (!buf) +return true; +if (size < fw->size) +return false;memcpy (buf, fw->data, fw->size); +return true; } static bool fw_get_builtin_firmware(struct firmware *fw, const char *name,
@@ -117,9 +120,7 @@ static bool fw_get_builtin_firmware(struct firmware *fw, const char *name,if (strcmp (name, b_fw->name) ==0 ) { fw->size = b_fw->size; fw->data = b_fw->data; -fw_copy_to_prealloc_buf (fw, buf, size); - -return true; +return fw_copy_to_prealloc_buf (fw, buf, size); } }
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 47/75 cpuidle: tegra: Check whether PMC is ready
In reply to Sasha LevinFrom: Dmitry Osipenko <[email protected]>
[ Upstream commit bdb1ffdad3b73e4d0538098fc02e2ea87a6b27cd ]
Check whether PMC is ready before proceeding with the cpuidle registration. This fixes racing with the PMC driver probe order, which results in a disabled deepest CC6 idling state if cpuidle driver is probed before the PMC.
--- drivers/cpuidle/cpuidle-tegra.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/cpuidle/cpuidle-tegra.c +3 -0
@@ -337,6 +337,9 @@ static void tegra_cpuidle_setup_tegra114_c7_state(void)static int tegra_cpuidle_probe (struct platform_device *pdev) { +if (tegra_pmc_get_suspend_mode () ==TEGRA_SUSPEND_NOT_READY ) +return -EPROBE_DEFER ; +/* LP2 could be disabled in device-tree */ if (tegra_pmc_get_suspend_mode () <TEGRA_SUSPEND_LP2 )tegra_cpuidle_disable_state (TEGRA_CC6 );
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 48/75 HID: multitouch: disable sticky fingers for UPERFECT Y
In reply to Sasha LevinFrom: José Expósito <[email protected]>
[ Upstream commit 08b9a61a87bc339a73c584d8924c86ab36d204a7 ]
When a finger is on the screen, the UPERFECT Y portable touchscreen monitor reports a contact in the first place. However, after this initial report, contacts are not reported at the refresh rate of the screen as required by the Windows 8 specs.
This behaviour triggers the release_timer, removing the fingers even though they are still present.
To avoid it, add a new class, similar to MT_CLS_WIN_8 but without the MT_QUIRK_STICKY_FINGERS quirk for this device.
--- drivers/hid/hid-ids.h | 3 +++ drivers/hid/hid-multitouch.c | 13 +++++++++++++ 2 files changed, 16 insertions(+)
drivers/hid/hid-ids.h +3 -0
@@ -1273,6 +1273,9 @@#define USB_DEVICE_ID_WEIDA_8752 0xC300#define USB_DEVICE_ID_WEIDA_8755 0xC301 +#define USB_VENDOR_ID_WINBOND 0x0416 +#define USB_DEVICE_ID_TSTP_MTOUCH 0xc168 +#define USB_VENDOR_ID_WISEGROUP 0x0925#define USB_DEVICE_ID_SMARTJOY_PLUS 0x0005#define USB_DEVICE_ID_SUPER_JOY_BOX_3 0x8888
drivers/hid/hid-multitouch.c +13 -0
@@ -193,6 +193,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);/* reserved 0x0014 */ #define MT_CLS_WIN_8_FORCE_MULTI_INPUT 0x0015#define MT_CLS_WIN_8_DISABLE_WAKEUP 0x0016 +#define MT_CLS_WIN_8_NO_STICKY_FINGERS 0x0017/* vendor specific classes */ #define MT_CLS_3M 0x0101
@@ -294,6 +295,13 @@ static const struct mt_class mt_classes[] = {MT_QUIRK_WIN8_PTP_BUTTONS | MT_QUIRK_DISABLE_WAKEUP, .export_all_inputs = true }, + { .name = MT_CLS_WIN_8_NO_STICKY_FINGERS, + .quirks =MT_QUIRK_ALWAYS_VALID | +MT_QUIRK_IGNORE_DUPLICATES | +MT_QUIRK_HOVERING | +MT_QUIRK_CONTACT_CNT_ACCURATE | + MT_QUIRK_WIN8_PTP_BUTTONS, + .export_all_inputs = true },/* * vendor specific classes
@@ -2120,6 +2128,11 @@ static const struct hid_device_id mt_devices[] = { MT_USB_DEVICE(USB_VENDOR_ID_VTL, USB_DEVICE_ID_VTL_MULTITOUCH_FF3F) }, +/* Winbond Electronics Corp. */ + { .driver_data = MT_CLS_WIN_8_NO_STICKY_FINGERS, +HID_DEVICE (HID_BUS_ANY ,HID_GROUP_MULTITOUCH_WIN_8 , + USB_VENDOR_ID_WINBOND, USB_DEVICE_ID_TSTP_MTOUCH) }, + /* Wistron panels */ { .driver_data = MT_CLS_NSMU, MT_USB_DEVICE(USB_VENDOR_ID_WISTRON,
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 49/75 ALSA: usb-audio: Add support for the Pioneer DJM 750MK2 Mixer/Soundcard
In reply to Sasha LevinFrom: William Overton <[email protected]>
[ Upstream commit 6d27788160362a7ee6c0d317636fe4b1ddbe59a7 ]
The kernel already has support for very similar Pioneer djm products and this work is based on that.
Added device to quirks-table.h and added control info to mixer_quirks.c.
Tested on my hardware and all working.
--- sound/usb/mixer_quirks.c | 34 +++++++++++++++++++++++ sound/usb/quirks-table.h | 58 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+)
sound/usb/mixer_quirks.c +34 -0
@@ -2654,6 +2654,7 @@ static int snd_bbfpro_controls_create(struct usb_mixer_interface *mixer)#define SND_DJM_750_IDX 0x1#define SND_DJM_850_IDX 0x2#define SND_DJM_900NXS2_IDX 0x3 +#define SND_DJM_750MK2_IDX 0x4#define SND_DJM_CTL (_name, suffix, _default_value, _windex) { \
@@ -2843,10 +2844,40 @@ static const struct snd_djm_ctl snd_djm_ctls_900nxs2[] = { SND_DJM_CTL("Ch5 Input", 900nxs2_cap5, 3, SND_DJM_WINDEX_CAP) }; +// DJM-750MK2 +static const u16 snd_djm_opts_750mk2_cap1[] = { +0x0100 ,0x0102 ,0x0103 ,0x0106 ,0x0107 ,0x0108 ,0x0109 ,0x010a }; +static const u16 snd_djm_opts_750mk2_cap2[] = { +0x0200 ,0x0202 ,0x0203 ,0x0206 ,0x0207 ,0x0208 ,0x0209 ,0x020a }; +static const u16 snd_djm_opts_750mk2_cap3[] = { +0x0300 ,0x0302 ,0x0303 ,0x0306 ,0x0307 ,0x0308 ,0x0309 ,0x030a }; +static const u16 snd_djm_opts_750mk2_cap4[] = { +0x0400 ,0x0402 ,0x0403 ,0x0406 ,0x0407 ,0x0408 ,0x0409 ,0x040a }; +static const u16 snd_djm_opts_750mk2_cap5[] = { +0x0507 ,0x0508 ,0x0509 ,0x050a ,0x0511 ,0x0512 ,0x0513 ,0x0514 }; + +static const u16 snd_djm_opts_750mk2_pb1[] = {0x0100 ,0x0101 ,0x0104 }; +static const u16 snd_djm_opts_750mk2_pb2[] = {0x0200 ,0x0201 ,0x0204 }; +static const u16 snd_djm_opts_750mk2_pb3[] = {0x0300 ,0x0301 ,0x0304 }; + + +static const struct snd_djm_ctl snd_djm_ctls_750mk2[] = { +SND_DJM_CTL ("Capture Level" , cap_level,0 ,SND_DJM_WINDEX_CAPLVL ), + SND_DJM_CTL("Ch1 Input", 750mk2_cap1, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch2 Input", 750mk2_cap2, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch3 Input", 750mk2_cap3, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch4 Input", 750mk2_cap4, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch5 Input", 750mk2_cap5, 3, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch1 Output", 750mk2_pb1, 0, SND_DJM_WINDEX_PB), + SND_DJM_CTL("Ch2 Output", 750mk2_pb2, 1, SND_DJM_WINDEX_PB), + SND_DJM_CTL("Ch3 Output", 750mk2_pb3, 2, SND_DJM_WINDEX_PB) +}; +static const struct snd_djm_device snd_djm_devices[] = { SND_DJM_DEVICE(250mk2),SND_DJM_DEVICE (750 ), + SND_DJM_DEVICE(750mk2),SND_DJM_DEVICE (850 ), SND_DJM_DEVICE(900nxs2) };
@@ -3094,6 +3125,9 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)case USB_ID (0x08e4 ,0x017f ):/* Pioneer DJ DJM-750 */ err =snd_djm_controls_create (mixer,SND_DJM_750_IDX );break ; +case USB_ID (0x2b73 ,0x001b ):/* Pioneer DJ DJM-750MK2 */ + err =snd_djm_controls_create (mixer,SND_DJM_750MK2_IDX ); +break ;case USB_ID (0x08e4 ,0x0163 ):/* Pioneer DJ DJM-850 */ err =snd_djm_controls_create (mixer,SND_DJM_850_IDX );break ;
sound/usb/quirks-table.h +58 -0
64 lines not on this page · raw message
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 50/75 ARM: dts: omap: fix gpmc,mux-add-data type
In reply to Sasha LevinFrom: Roger Quadros <[email protected]>
[ Upstream commit 51b9e22ffd3c4c56cbb7caae9750f70e55ffa603 ]
gpmc,mux-add-data is not boolean.
Fixes the below errors flagged by dtbs_check.
"ethernet@4,0:gpmc,mux-add-data: True is not of type 'array'"
--- arch/arm/boot/dts/omap-gpmc-smsc9221.dtsi | 2 +- arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/omap-gpmc-smsc9221.dtsi +1 -1
@@ -29,7 +29,7 @@ compatible = "smsc,lan9221","smsc,lan9115"; bank-width = <2>; - gpmc,mux-add-data; + gpmc,mux-add-data = <0>; gpmc,cs-on-ns = <0>; gpmc,cs-rd-off-ns = <42>; gpmc,cs-wr-off-ns = <36>;
arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi +1 -1
@@ -22,7 +22,7 @@ compatible = "smsc,lan9221","smsc,lan9115"; bank-width = <2>; - gpmc,mux-add-data; + gpmc,mux-add-data = <0>; gpmc,cs-on-ns = <0>; gpmc,cs-rd-off-ns = <42>; gpmc,cs-wr-off-ns = <36>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 51/75 usb: host: ohci-tmio: check return value after calling platform_get_resource()
In reply to Sasha LevinFrom: Yang Yingliang <[email protected]>
[ Upstream commit 9eff2b2e59fda25051ab36cd1cb5014661df657b ]
It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value.
--- drivers/usb/host/ohci-tmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-tmio.c +1 -1
@@ -199,7 +199,7 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)if (usb_disabled ())return -ENODEV ; -if (!cell) +if (!cell || !regs || !config || !sram)return -EINVAL ;if (irq <0 )
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 52/75 ARM: dts: ls1021a: move thermal-zones node out of soc/
In reply to Sasha LevinFrom: Li Yang <[email protected]>
[ Upstream commit 1ee1500ef717eefb5d9bdaf97905cb81b4e69aa4 ]
This fixes dtbs-check error from simple-bus schema:
soc: thermal-zones: {'type': 'object'} is not allowed for {'cpu-thermal': ..... }
From schema: /home/leo/.local/lib/python3.8/site-packages/dtschema/schemas/simple-bus.yaml
--- arch/arm/boot/dts/ls1021a.dtsi | 66 +++++++++++++++++----------------- 1 file changed, 33 insertions(+), 33 deletions(-)
arch/arm/boot/dts/ls1021a.dtsi +33 -33
@@ -329,39 +329,6 @@ #thermal-sensor-cells = <1>; }; - thermal-zones { - cpu_thermal: cpu-thermal { - polling-delay-passive = <1000>; - polling-delay = <5000>; - - thermal-sensors = <&tmu 0>; - - trips { - cpu_alert: cpu-alert { - temperature = <85000>; - hysteresis = <2000>; - type = "passive"; - }; - cpu_crit: cpu-crit { - temperature = <95000>; - hysteresis = <2000>; - type = "critical"; - }; - }; - - cooling-maps { - map0 { - trip = <&cpu_alert>; - cooling-device = - <&cpu0 THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>, - <&cpu1 THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>; - }; - }; - }; - }; - dspi0: spi@2100000 { compatible = "fsl,ls1021a-v1.0-dspi"; #address-cells = <1>;
@@ -1016,4 +983,37 @@ big-endian; }; }; + + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + + thermal-sensors = <&tmu 0>; + + trips { + cpu_alert: cpu-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit: cpu-crit { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&cpu_alert>; + cooling-device = + <&cpu0 THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>; + }; + }; + }; + }; };
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 53/75 ARM: dts: ls1021a-tsn: use generic "jedec,spi-nor" compatible for flash
In reply to Sasha LevinFrom: Li Yang <[email protected]>
[ Upstream commit 05e63b48b20fa70726be505a7660d1a07bc1cffb ]
We cannot list all the possible chips used in different board revisions, just use the generic "jedec,spi-nor" compatible instead. This also fixes dtbs_check error:
['jedec,spi-nor', 's25fl256s1', 's25fl512s'] is too long
--- arch/arm/boot/dts/ls1021a-tsn.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/ls1021a-tsn.dts +1 -1
@@ -251,7 +251,7 @@ flash@0 { /* Rev. A uses 64MB flash, Rev. B & C use 32MB flash */ - compatible = "jedec,spi-nor", "s25fl256s1", "s25fl512s"; + compatible = "jedec,spi-nor"; spi-max-frequency = <20000000>; #address-cells = <1>; #size-cells = <1>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 54/75 ALSA: ISA: not for M68K
In reply to Sasha LevinFrom: Randy Dunlap <[email protected]>
[ Upstream commit 3c05f1477e62ea5a0a8797ba6a545b1dc751fb31 ]
On m68k, compiling drivers under SND_ISA causes build errors:
../sound/core/isadma.c: In function 'snd_dma_program':../sound/core/isadma.c:33:17: error: implicit declaration of function 'claim_dma_lock' [-Werror=implicit-function-declaration]
33 | flags = claim_dma_lock();
| ^~~~~~~~~~~~~~
../sound/core/isadma.c:41:9: error: implicit declaration of function 'release_dma_lock' [-Werror=implicit-function-declaration]
41 | release_dma_lock(flags);
| ^~~~~~~~~~~~~~~~../sound/isa/sb/sb16_main.c: In function 'snd_sb16_playback_prepare':../sound/isa/sb/sb16_main.c:253:72: error: 'DMA_AUTOINIT' undeclared (first use in this function)
253 | snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT);
| ^~~~~~~~~~~~../sound/isa/sb/sb16_main.c:253:72: note: each undeclared identifier is reported only once for each function it appears in ../sound/isa/sb/sb16_main.c: In function 'snd_sb16_capture_prepare':../sound/isa/sb/sb16_main.c:322:71: error: 'DMA_AUTOINIT' undeclared (first use in this function)
322 | snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT);
| ^~~~~~~~~~~~
and more...
--- sound/core/Makefile | 2 ++ sound/isa/Kconfig | 2 +- sound/pci/Kconfig | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
sound/core/Makefile +2 -0
@@ -9,7 +9,9 @@ ifneq ($(CONFIG_SND_PROC_FS),) snd-y += info.o snd-$(CONFIG_SND_OSSEMUL) += info_oss.o endif +ifneq ($(CONFIG_M68K),y) snd-$(CONFIG_ISA_DMA_API) += isadma.o +endif snd-$(CONFIG_SND_OSSEMUL) += sound_oss.o snd-$(CONFIG_SND_VMASTER) += vmaster.o snd-$(CONFIG_SND_JACK) += ctljack.o jack.o
sound/isa/Kconfig +1 -1
@@ -22,7 +22,7 @@ config SND_SB16_DSP menuconfig SND_ISA bool "ISA sound devices" depends on ISA || COMPILE_TEST - depends on ISA_DMA_API + depends on ISA_DMA_API && !M68K default y help Support for sound devices connected via the ISA bus.
sound/pci/Kconfig +1 -0
@@ -279,6 +279,7 @@ config SND_CS46XX_NEW_DSP config SND_CS5530 tristate "CS5530 Audio" depends on ISA_DMA_API && (X86_32 || COMPILE_TEST) + depends on !M68K select SND_SB16_DSP help Say Y here to include support for audio on Cyrix/NatSemi CS5530 chips.
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 55/75 iommu/vt-d: Do not falsely log intel_iommu is unsupported kernel option
In reply to Sasha LevinFrom: Tvrtko Ursulin <[email protected]>
[ Upstream commit 5240aed2cd2594fb392239f11b9681e5e1591619 ]
Handling of intel_iommu kernel command line option should return "true" to indicate option is valid and so avoid logging it as unknown by the core parsing code.
Also log unknown sub-options at the notice level to let user know of potential typos or similar.
--- drivers/iommu/intel/iommu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iommu/intel/iommu.c +5 -1
@@ -439,6 +439,7 @@ static int __init intel_iommu_setup(char *str) {if (!str)return -EINVAL ; +while (*str) {if (!strncmp (str,"on" ,2 )) { dmar_disabled =0 ;
@@ -465,13 +466,16 @@ static int __init intel_iommu_setup(char *str) }else if (!strncmp (str,"tboot_noforce" ,13 )) {pr_info ("Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n" ); intel_iommu_tboot_noforce =1 ; + }else { +pr_notice ("Unknown option - '%s'\n" , str); } str +=strcspn (str,"," );while (*str ==',' ) str++; } -return 0 ; + +return 1 ; }__setup ("intel_iommu=" , intel_iommu_setup);
Signature · 6 lines
2.33.0 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 56/75 tty: tty_buffer: Fix the softlockup issue in flush_to_ldisc
In reply to Sasha LevinFrom: Guanghui Feng <[email protected]>
[ Upstream commit 3968ddcf05fb4b9409cd1859feb06a5b0550a1c1 ]
When running ltp testcase(ltp/testcases/kernel/pty/pty04.c) with arm64, there is a soft lockup, which look like this one:
Workqueue: events_unbound flush_to_ldisc Call trace: dump_backtrace+0x0/0x1ec show_stack+0x24/0x30 dump_stack+0xd0/0x128 panic+0x15c/0x374 watchdog_timer_fn+0x2b8/0x304 __run_hrtimer+0x88/0x2c0 __hrtimer_run_queues+0xa4/0x120 hrtimer_interrupt+0xfc/0x270 arch_timer_handler_phys+0x40/0x50 handle_percpu_devid_irq+0x94/0x220 __handle_domain_irq+0x88/0xf0 gic_handle_irq+0x84/0xfc el1_irq+0xc8/0x180 slip_unesc+0x80/0x214 [slip] tty_ldisc_receive_buf+0x64/0x80 tty_port_default_receive_buf+0x50/0x90 flush_to_ldisc+0xbc/0x110 process_one_work+0x1d4/0x4b0 worker_thread+0x180/0x430 kthread+0x11c/0x120
In the testcase pty04, The first process call the write syscall to send data to the pty master. At the same time, the workqueue will do the flush_to_ldisc to pop data in a loop until there is no more data left. When the sender and workqueue running in different core, the sender sends data fastly in full time which will result in workqueue doing work in loop for a long time and occuring softlockup in flush_to_ldisc with kernel configured without preempt. So I add need_resched check and cond_resched in the flush_to_ldisc loop to avoid it.
--- drivers/tty/tty_buffer.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/tty_buffer.c +3 -0
@@ -544,6 +544,9 @@ static void flush_to_ldisc(struct work_struct *work)if (!count)break ; head->read += count; + +if (need_resched ()) +cond_resched (); }mutex_unlock (&buf->lock);
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 57/75 MIPS: sni: Fix the build
In reply to Sasha LevinFrom: Bart Van Assche <[email protected]>
[ Upstream commit c91cf42f61dc77b289784ea7b15a8531defa41c0 ]
This patch fixes the following gcc 10 build error:
arch/mips/sni/time.c: In function ‘a20r_set_periodic’:arch/mips/sni/time.c:15:26: error: unsigned conversion from ‘int’ to ‘u8’ {aka ‘volatile unsigned char’} changes value from ‘576’ to ‘64’ [-Werror=overflow]
15 | #define SNI_COUNTER0_DIV ((SNI_CLOCK_TICK_RATE / SNI_COUNTER2_DIV) / HZ)
| ^arch/mips/sni/time.c:21:45: note: in expansion of macro ‘SNI_COUNTER0_DIV’
21 | *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV;
| ^~~~~~~~~~~~~~~~--- arch/mips/sni/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/sni/time.c +2 -2
@@ -18,14 +18,14 @@ static int a20r_set_periodic(struct clock_event_device *evt) { *(volatile u8 *)(A20R_PT_CLOCK_BASE +12 ) =0x34 ;wmb (); - *(volatile u8 *)(A20R_PT_CLOCK_BASE +0 ) =SNI_COUNTER0_DIV ; + *(volatile u8 *)(A20R_PT_CLOCK_BASE +0 ) =SNI_COUNTER0_DIV &0xff ;wmb (); *(volatile u8 *)(A20R_PT_CLOCK_BASE +0 ) =SNI_COUNTER0_DIV >>8 ;wmb (); *(volatile u8 *)(A20R_PT_CLOCK_BASE +12 ) =0xb4 ;wmb (); - *(volatile u8 *)(A20R_PT_CLOCK_BASE +8 ) =SNI_COUNTER2_DIV ; + *(volatile u8 *)(A20R_PT_CLOCK_BASE +8 ) =SNI_COUNTER2_DIV &0xff ;wmb (); *(volatile u8 *)(A20R_PT_CLOCK_BASE +8 ) =SNI_COUNTER2_DIV >>8 ;wmb ();
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 58/75 scsi: scsi_debug: Fix out-of-bound read in resp_readcap16()
In reply to Sasha LevinFrom: Ye Bin <[email protected]>
[ Upstream commit 4e3ace0051e7e504b55d239daab8789dd89b863c ]
The following warning was observed running syzkaller:
[ 3813.830724] sg_write: data in/out 65466/242 bytes for SCSI command 0x9e-- guessing data in; [ 3813.830724] program syz-executor not setting count and/or reply_len properly [ 3813.836956] ================================================================== [ 3813.839465] BUG: KASAN: stack-out-of-bounds in sg_copy_buffer+0x157/0x1e0 [ 3813.841773] Read of size 4096 at addr ffff8883cf80f540 by task syz-executor/1549 [ 3813.846612] Call Trace: [ 3813.846995] dump_stack+0x108/0x15f [ 3813.847524] print_address_description+0xa5/0x372 [ 3813.848243] kasan_report.cold+0x236/0x2a8 [ 3813.849439] check_memory_region+0x240/0x270 [ 3813.850094] memcpy+0x30/0x80 [ 3813.850553] sg_copy_buffer+0x157/0x1e0 [ 3813.853032] sg_copy_from_buffer+0x13/0x20 [ 3813.853660] fill_from_dev_buffer+0x135/0x370 [ 3813.854329] resp_readcap16+0x1ac/0x280 [ 3813.856917] schedule_resp+0x41f/0x1630 [ 3813.858203] scsi_debug_queuecommand+0xb32/0x17e0 [ 3813.862699] scsi_dispatch_cmd+0x330/0x950 [ 3813.863329] scsi_request_fn+0xd8e/0x1710 [ 3813.863946] __blk_run_queue+0x10b/0x230 [ 3813.864544] blk_execute_rq_nowait+0x1d8/0x400 [ 3813.865220] sg_common_write.isra.0+0xe61/0x2420 [ 3813.871637] sg_write+0x6c8/0xef0 [ 3813.878853] __vfs_write+0xe4/0x800 [ 3813.883487] vfs_write+0x17b/0x530 [ 3813.884008] ksys_write+0x103/0x270 [ 3813.886268] __x64_sys_write+0x77/0xc0 [ 3813.886841] do_syscall_64+0x106/0x360 [ 3813.887415] entry_SYSCALL_64_after_hwframe+0x44/0xa9
This issue can be reproduced with the following syzkaller log:
r0 = openat(0xffffffffffffff9c, &(0x7f0000000040)='./file0\x00', 0x26e1, 0x0)
r1 = syz_open_procfs(0xffffffffffffffff, &(0x7f0000000000)='fd/3\x00')open_by_handle_at(r1, &(0x7f00000003c0)=ANY=[@ANYRESHEX], 0x602000)
r2 = syz_open_dev$sg(&(0x7f0000000000), 0x0, 0x40782)
write$binfmt_aout(r2, &(0x7f0000000340)=ANY=[@ANYBLOB="00000000deff000000000000000000000000000000000000000000000000000047f007af9e107a41ec395f1bded7be24277a1501ff6196a83366f4e6362bc0ff2b247f68a972989b094b2da4fb3607fcf611a22dd04310d28c75039d"], 0x126)
In resp_readcap16() we get "int alloc_len" value -1104926854, and then pass the huge arr_len to fill_from_dev_buffer(), but arr is only 32 bytes. This leads to OOB in sg_copy_buffer().
To solve this issue, define alloc_len as u32.
--- drivers/scsi/scsi_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/scsi_debug.c +2 -2
@@ -1856,7 +1856,7 @@ static int resp_readcap16(struct scsi_cmnd *scp, {unsigned char *cmd = scp->cmnd;unsigned char arr[SDEBUG_READCAP16_ARR_SZ ]; -int alloc_len; +u32 alloc_len; alloc_len =get_unaligned_be32 (cmd +10 );/* following just in case virtual_gb changed */
@@ -1885,7 +1885,7 @@ static int resp_readcap16(struct scsi_cmnd *scp, }return fill_from_dev_buffer (scp, arr, -min_t (int, alloc_len,SDEBUG_READCAP16_ARR_SZ )); +min_t (u32, alloc_len,SDEBUG_READCAP16_ARR_SZ )); }#define SDEBUG_MAX_TGTPGS_ARR_SZ 1412
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 59/75 scsi: scsi_debug: Fix out-of-bound read in resp_report_tgtpgs()
In reply to Sasha LevinFrom: Ye Bin <[email protected]>
[ Upstream commit f347c26836c270199de1599c3cd466bb7747caa9 ]
The following issue was observed running syzkaller:
BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:377 [inline] BUG: KASAN: slab-out-of-bounds in sg_copy_buffer+0x150/0x1c0 lib/scatterlist.c:831 Read of size 2132 at addr ffff8880aea95dc8 by task syz-executor.0/9815 CPU: 0 PID: 9815 Comm: syz-executor.0 Not tainted 4.19.202-00874-gfc0fe04215a9 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xe4/0x14a lib/dump_stack.c:118 print_address_description+0x73/0x280 mm/kasan/report.c:253 kasan_report_error mm/kasan/report.c:352 [inline] kasan_report+0x272/0x370 mm/kasan/report.c:410 memcpy+0x1f/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:377 [inline] sg_copy_buffer+0x150/0x1c0 lib/scatterlist.c:831 fill_from_dev_buffer+0x14f/0x340 drivers/scsi/scsi_debug.c:1021 resp_report_tgtpgs+0x5aa/0x770 drivers/scsi/scsi_debug.c:1772 schedule_resp+0x464/0x12f0 drivers/scsi/scsi_debug.c:4429 scsi_debug_queuecommand+0x467/0x1390 drivers/scsi/scsi_debug.c:5835 scsi_dispatch_cmd+0x3fc/0x9b0 drivers/scsi/scsi_lib.c:1896 scsi_request_fn+0x1042/0x1810 drivers/scsi/scsi_lib.c:2034 __blk_run_queue_uncond block/blk-core.c:464 [inline] __blk_run_queue+0x1a4/0x380 block/blk-core.c:484 blk_execute_rq_nowait+0x1c2/0x2d0 block/blk-exec.c:78 sg_common_write.isra.19+0xd74/0x1dc0 drivers/scsi/sg.c:847 sg_write.part.23+0x6e0/0xd00 drivers/scsi/sg.c:716 sg_write+0x64/0xa0 drivers/scsi/sg.c:622 __vfs_write+0xed/0x690 fs/read_write.c:485 kill_bdev:block_device:00000000e138492c vfs_write+0x184/0x4c0 fs/read_write.c:549 ksys_write+0x107/0x240 fs/read_write.c:599 do_syscall_64+0xc2/0x560 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe
We get 'alen' from command its type is int. If userspace passes a large length we will get a negative 'alen'.
Switch n, alen, and rlen to u32.
--- drivers/scsi/scsi_debug.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/scsi/scsi_debug.c +4 -3
@@ -1896,8 +1896,9 @@ static int resp_report_tgtpgs(struct scsi_cmnd *scp,unsigned char *cmd = scp->cmnd;unsigned char *arr;int host_no = devip->sdbg_host->shost->host_no; -int n, ret, alen, rlen;int port_group_a, port_group_b, port_a, port_b; +u32 alen, n, rlen; +int ret; alen =get_unaligned_be32 (cmd +6 ); arr =kzalloc (SDEBUG_MAX_TGTPGS_ARR_SZ ,GFP_ATOMIC );
@@ -1959,9 +1960,9 @@ static int resp_report_tgtpgs(struct scsi_cmnd *scp,* - The constructed command length * - The maximum array size */ - rlen =min_t (int, alen, n); + rlen =min (alen, n); ret =fill_from_dev_buffer (scp, arr, -min_t (int, rlen,SDEBUG_MAX_TGTPGS_ARR_SZ )); +min_t (u32, rlen,SDEBUG_MAX_TGTPGS_ARR_SZ ));kfree (arr);return ret; }
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 60/75 scsi: target: Fix ordered tag handling
In reply to Sasha LevinFrom: Mike Christie <[email protected]>
[ Upstream commit ed1227e080990ffec5bf39006ec8a57358e6689a ]
This patch fixes the following bugs:
1. If there are multiple ordered cmds queued and multiple simple cmds completing, target_restart_delayed_cmds() could be called on different CPUs and each instance could start a ordered cmd. They could then run in different orders than they were queued.
2. target_restart_delayed_cmds() and target_handle_task_attr() can race where:
1. target_handle_task_attr() has passed the simple_cmds == 0 check.
2. transport_complete_task_attr() then decrements simple_cmds to 0.
3. transport_complete_task_attr() runs target_restart_delayed_cmds() and it does not see any cmds on the delayed_cmd_list.
4. target_handle_task_attr() adds the cmd to the delayed_cmd_list.
The cmd will then end up timing out.
3. If we are sent > 1 ordered cmds and simple_cmds == 0, we can execute them out of order, because target_handle_task_attr() will hit that simple_cmds check first and return false for all ordered cmds sent.
4. We run target_restart_delayed_cmds() after every cmd completion, so if there is more than 1 simple cmd running, we start executing ordered cmds after that first cmd instead of waiting for all of them to complete.
5. Ordered cmds are not supposed to start until HEAD OF QUEUE and all older cmds have completed, and not just simple.
6. It's not a bug but it doesn't make sense to take the delayed_cmd_lock for every cmd completion when ordered cmds are almost never used. Just replacing that lock with an atomic increases IOPs by up to 10% when completions are spread over multiple CPUs and there are multiple sessions/ mqs/thread accessing the same device.
This patch moves the queued delayed handling to a per device work to serialze the cmd executions for each device and adds a new counter to track HEAD_OF_QUEUE and SIMPLE cmds. We can then check the new counter to determine when to run the work on the completion path.
--- drivers/target/target_core_device.c | 2 + drivers/target/target_core_internal.h | 1 + drivers/target/target_core_transport.c | 76 ++++++++++++++++++-------- include/target/target_core_base.h | 6 +- 4 files changed, 61 insertions(+), 24 deletions(-)
drivers/target/target_core_device.c +2 -0
@@ -772,6 +772,8 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)INIT_LIST_HEAD (&dev->t10_alua.lba_map_list);spin_lock_init (&dev->t10_alua.lba_map_lock); +INIT_WORK (&dev->delayed_cmd_work, target_do_delayed_work); + dev->t10_wwn.t10_dev = dev;/* * Use OpenFabrics IEEE Company ID: 00 14 05
drivers/target/target_core_internal.h +1 -0
@@ -151,6 +151,7 @@ int transport_dump_vpd_ident(struct t10_vpd *, unsigned char *, int);void transport_clear_lun_ref (struct se_lun *);sense_reason_t target_cmd_size_check (struct se_cmd *cmd,unsigned int size);void target_qf_do_work (struct work_struct *work); +void target_do_delayed_work (struct work_struct *work);bool target_check_wce (struct se_device *dev);bool target_check_fua (struct se_device *dev);void __target_execute_cmd (struct se_cmd *,bool );
drivers/target/target_core_transport.c +54 -22
142 lines not on this page · raw message
include/target/target_core_base.h +4 -2
@@ -808,8 +808,9 @@ struct se_device {atomic_long_t read_bytes;atomic_long_t write_bytes;/* Active commands on this virtual SE device */ -atomic_t simple_cmds; -atomic_t dev_ordered_sync; +atomic_t non_ordered; +bool ordered_sync_in_progress; +atomic_t delayed_cmd_count;atomic_t dev_qf_count;u32 export_count;spinlock_t delayed_cmd_lock;
@@ -830,6 +831,7 @@ struct se_device {struct list_head dev_sep_list;struct list_head dev_tmr_list;struct work_struct qf_work_queue; +struct work_struct delayed_cmd_work;struct list_head delayed_cmd_list;struct list_head qf_cmd_list;/* Pointer to associated SE HBA */
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 61/75 scsi: target: Fix alua_tg_pt_gps_count tracking
In reply to Sasha LevinFrom: Mike Christie <[email protected]>
[ Upstream commit 1283c0d1a32bb924324481586b5d6e8e76f676ba ]
We can't free the tg_pt_gp in core_alua_set_tg_pt_gp_id() because it's still accessed via configfs. Its release must go through the normal configfs/refcount process.
The max alua_tg_pt_gps_count check should probably have been done in core_alua_allocate_tg_pt_gp(), but with the current code userspace could have created 0x0000ffff + 1 groups, but only set the id for 0x0000ffff. Then it could have deleted a group with an ID set, and then set the ID for that extra group and it would work ok.
It's unlikely, but just in case this patch continues to allow that type of behavior, and just fixes the kfree() while in use bug.
--- drivers/target/target_core_alua.c | 1 - 1 file changed, 1 deletion(-)
drivers/target/target_core_alua.c +0 -1
@@ -1700,7 +1700,6 @@ int core_alua_set_tg_pt_gp_id(pr_err ("Maximum ALUA alua_tg_pt_gps_count:" " 0x0000ffff reached\n" );spin_unlock (&dev->t10_alua.tg_pt_gps_lock); -kmem_cache_free (t10_alua_tg_pt_gp_cache, tg_pt_gp);return -ENOSPC ; } again:
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 62/75 iio: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr()
In reply to Sasha LevinFrom: Teng Qi <[email protected]>
[ Upstream commit 94be878c882d8d784ff44c639bf55f3b029f85af ]
The length of hw->settings->odr_table is 2 and ref_sensor->id is an enum variable whose value is between 0 and 5.
However, the value ST_LSM6DSX_ID_MAX (i.e. 5) is not caught properly in
switch (sensor->id) {
If ref_sensor->id is ST_LSM6DSX_ID_MAX, an array overflow will ocurrs in function st_lsm6dsx_check_odr():
odr_table = &sensor->hw->settings->odr_table[sensor->id];
and in function st_lsm6dsx_set_odr():
reg = &hw->settings->odr_table[ref_sensor->id].reg;
To avoid this array overflow, handle ST_LSM6DSX_ID_GYRO explicitly and return -EINVAL for the default case.
The enum value ST_LSM6DSX_ID_MAX is only present as an easy way to check the limit and as such is never used, however this is not locally obvious.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +4 -2
@@ -1279,6 +1279,8 @@ st_lsm6dsx_set_odr(struct st_lsm6dsx_sensor *sensor, u32 req_odr)int err;switch (sensor->id) { +case ST_LSM6DSX_ID_GYRO : +break ;case ST_LSM6DSX_ID_EXT0 :case ST_LSM6DSX_ID_EXT1 :case ST_LSM6DSX_ID_EXT2 :
@@ -1304,8 +1306,8 @@ st_lsm6dsx_set_odr(struct st_lsm6dsx_sensor *sensor, u32 req_odr) }break ; } -default : -break ; +default :/* should never occur */ +return -EINVAL ; }if (req_odr >0 ) {
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 63/75 RDMA/core: Use kvzalloc when allocating the struct ib_port
In reply to Sasha LevinFrom: wangyugui <[email protected]>
[ Upstream commit 911a81c9c7092bfd75432ce79b2ef879127ea065 ]
The 'struct attribute' flex array contains some struct lock_class_key's which become big when lockdep is turned on. Big enough that some drivers will not load when CONFIG_PROVE_LOCKING=y because they cannot allocate enough memory:
WARNING: CPU: 36 PID: 8 at mm/page_alloc.c:5350 __alloc_pages+0x27e/0x3e0 Call Trace: kmalloc_order+0x2a/0xb0 kmalloc_order_trace+0x19/0xf0 __kmalloc+0x231/0x270 ib_setup_port_attrs+0xd8/0x870 [ib_core] ib_register_device+0x419/0x4e0 [ib_core] bnxt_re_task+0x208/0x2d0 [bnxt_re]
--- drivers/infiniband/core/sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/core/sysfs.c +2 -2
@@ -757,7 +757,7 @@ static void ib_port_release(struct kobject *kobj)if (port->hw_stats_data)kfree (port->hw_stats_data->stats);kfree (port->hw_stats_data); -kfree (port); +kvfree (port); }static void ib_port_gid_attr_release (struct kobject *kobj)
@@ -1189,7 +1189,7 @@ static struct ib_port *setup_port(struct ib_core_device *coredev, int port_num,struct ib_port *p;int ret; - p =kzalloc (struct_size (p, attrs_list, + p =kvzalloc (struct_size (p, attrs_list, attr->gid_tbl_len + attr->pkey_tbl_len),GFP_KERNEL );if (!p)
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 64/75 scsi: lpfc: Fix use-after-free in lpfc_unreg_rpi() routine
In reply to Sasha LevinFrom: James Smart <[email protected]>
[ Upstream commit 79b20beccea3a3938a8500acef4e6b9d7c66142f ]
An error is detected with the following report when unloading the driver:
"KASAN: use-after-free in lpfc_unreg_rpi+0x1b1b"
The NLP_REG_LOGIN_SEND nlp_flag is set in lpfc_reg_fab_ctrl_node(), but the flag is not cleared upon completion of the login.
This allows a second call to lpfc_unreg_rpi() to proceed with nlp_rpi set to LPFC_RPI_ALLOW_ERROR. This results in a use after free access when used as an rpi_ids array index.
Fix by clearing the NLP_REG_LOGIN_SEND nlp_flag in lpfc_mbx_cmpl_fc_reg_login().
--- drivers/scsi/lpfc/lpfc_hbadisc.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/lpfc/lpfc_hbadisc.c +1 -0
@@ -4340,6 +4340,7 @@ lpfc_mbx_cmpl_fc_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ndlp->nlp_state); ndlp->nlp_flag |=NLP_RPI_REGISTERED ; + ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND ; ndlp->nlp_type |=NLP_FABRIC ;lpfc_nlp_set_state (vport, ndlp,NLP_STE_UNMAPPED_NODE );
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 65/75 scsi: lpfc: Fix link down processing to address NULL pointer dereference
In reply to Sasha LevinFrom: James Smart <[email protected]>
[ Upstream commit 1854f53ccd88ad4e7568ddfafafffe71f1ceb0a6 ]
If an FC link down transition while PLOGIs are outstanding to fabric well known addresses, outstanding ABTS requests may result in a NULL pointer dereference. Driver unload requests may hang with repeated "2878" log messages.
The Link down processing results in ABTS requests for outstanding ELS requests. The Abort WQEs are sent for the ELSs before the driver had set the link state to down. Thus the driver is sending the Abort with the expectation that an ABTS will be sent on the wire. The Abort request is stalled waiting for the link to come up. In some conditions the driver may auto-complete the ELSs thus if the link does come up, the Abort completions may reference an invalid structure.
Fix by ensuring that Abort set the flag to avoid link traffic if issued due to conditions where the link failed.
--- drivers/scsi/lpfc/lpfc_sli.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/scsi/lpfc/lpfc_sli.c +7 -7
@@ -11722,17 +11722,17 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,/* ABTS WQE must go to the same WQ as the WQE to be aborted */ abtsiocbp->hba_wqidx = cmdiocb->hba_wqidx; -if (cmdiocb->iocb_flag &LPFC_IO_FCP ) { - abtsiocbp->iocb_flag |=LPFC_IO_FCP ; - abtsiocbp->iocb_flag |=LPFC_USE_FCPWQIDX ; - } +if (cmdiocb->iocb_flag &LPFC_IO_FCP ) + abtsiocbp->iocb_flag |= (LPFC_IO_FCP |LPFC_USE_FCPWQIDX );if (cmdiocb->iocb_flag &LPFC_IO_FOF ) abtsiocbp->iocb_flag |=LPFC_IO_FOF ; -if (phba->link_state >=LPFC_LINK_UP ) - iabt->ulpCommand =CMD_ABORT_XRI_CN ; -else +if (phba->link_state <LPFC_LINK_UP || + (phba->sli_rev ==LPFC_SLI_REV4 && + phba->sli4_hba.link_state.status ==LPFC_FC_LA_TYPE_LINK_DOWN )) iabt->ulpCommand =CMD_CLOSE_XRI_CN ; +else + iabt->ulpCommand =CMD_ABORT_XRI_CN ;if (cmpl) abtsiocbp->iocb_cmpl = cmpl;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 66/75 memory: tegra20-emc: Add runtime dependency on devfreq governor module
In reply to Sasha LevinFrom: Dmitry Osipenko <[email protected]>
[ Upstream commit 14b43c20c283de36131da0cb44f3170b9ffa7630 ]
Tegra20 EMC driver uses simple devfreq governor. Add simple devfreq governor to the list of the Tegra20 EMC driver module softdeps to allow userspace initramfs tools like dracut to automatically pull the devfreq module into ramfs image together with the EMC module.
--- drivers/memory/tegra/tegra20-emc.c | 1 + 1 file changed, 1 insertion(+)
drivers/memory/tegra/tegra20-emc.c +1 -0
@@ -1117,4 +1117,5 @@ module_platform_driver(tegra_emc_driver);MODULE_AUTHOR ("Dmitry Osipenko <[email protected]>" );MODULE_DESCRIPTION ("NVIDIA Tegra20 EMC driver" ); +MODULE_SOFTDEP ("pre: governor_simpleondemand" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 67/75 powerpc/5200: dts: fix memory node unit name
In reply to Sasha LevinFrom: Anatolij Gustschin <[email protected]>
[ Upstream commit aed2886a5e9ffc8269a4220bff1e9e030d3d2eb1 ]
Fixes build warnings:
Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name
--- arch/powerpc/boot/dts/charon.dts | 2 +- arch/powerpc/boot/dts/digsy_mtc.dts | 2 +- arch/powerpc/boot/dts/lite5200.dts | 2 +- arch/powerpc/boot/dts/lite5200b.dts | 2 +- arch/powerpc/boot/dts/media5200.dts | 2 +- arch/powerpc/boot/dts/mpc5200b.dtsi | 2 +- arch/powerpc/boot/dts/o2d.dts | 2 +- arch/powerpc/boot/dts/o2d.dtsi | 2 +- arch/powerpc/boot/dts/o2dnt2.dts | 2 +- arch/powerpc/boot/dts/o3dnt.dts | 2 +- arch/powerpc/boot/dts/pcm032.dts | 2 +- arch/powerpc/boot/dts/tqm5200.dts | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-)
arch/powerpc/boot/dts/charon.dts +1 -1
@@ -35,7 +35,7 @@ }; }; - memory { + memory@0 { device_type = "memory"; reg = <0x00000000 0x08000000>; // 128MB };
arch/powerpc/boot/dts/digsy_mtc.dts +1 -1
@@ -16,7 +16,7 @@ model = "intercontrol,digsy-mtc"; compatible = "intercontrol,digsy-mtc"; - memory { + memory@0 { reg = <0x00000000 0x02000000>; // 32MB };
arch/powerpc/boot/dts/lite5200.dts +1 -1
@@ -32,7 +32,7 @@ }; }; - memory { + memory@0 { device_type = "memory"; reg = <0x00000000 0x04000000>; // 64MB };
arch/powerpc/boot/dts/lite5200b.dts +1 -1
@@ -31,7 +31,7 @@ led4 { gpios = <&gpio_simple 2 1>; }; }; - memory { + memory@0 { reg = <0x00000000 0x10000000>; // 256MB };
arch/powerpc/boot/dts/media5200.dts +1 -1
@@ -32,7 +32,7 @@ }; }; - memory { + memory@0 { reg = <0x00000000 0x08000000>; // 128MB RAM };
arch/powerpc/boot/dts/mpc5200b.dtsi +1 -1
@@ -33,7 +33,7 @@ }; }; - memory: memory { + memory: memory@0 { device_type = "memory"; reg = <0x00000000 0x04000000>; // 64MB };
arch/powerpc/boot/dts/o2d.dts +1 -1
@@ -12,7 +12,7 @@ model = "ifm,o2d"; compatible = "ifm,o2d"; - memory { + memory@0 { reg = <0x00000000 0x08000000>; // 128MB };
arch/powerpc/boot/dts/o2d.dtsi +1 -1
@@ -19,7 +19,7 @@ model = "ifm,o2d"; compatible = "ifm,o2d"; - memory { + memory@0 { reg = <0x00000000 0x04000000>; // 64MB };
arch/powerpc/boot/dts/o2dnt2.dts +1 -1
@@ -12,7 +12,7 @@ model = "ifm,o2dnt2"; compatible = "ifm,o2d"; - memory { + memory@0 { reg = <0x00000000 0x08000000>; // 128MB };
arch/powerpc/boot/dts/o3dnt.dts +1 -1
@@ -12,7 +12,7 @@ model = "ifm,o3dnt"; compatible = "ifm,o2d"; - memory { + memory@0 { reg = <0x00000000 0x04000000>; // 64MB };
arch/powerpc/boot/dts/pcm032.dts +1 -1
@@ -20,7 +20,7 @@ model = "phytec,pcm032"; compatible = "phytec,pcm032"; - memory { + memory@0 { reg = <0x00000000 0x08000000>; // 128MB };
arch/powerpc/boot/dts/tqm5200.dts +1 -1
@@ -32,7 +32,7 @@ }; }; - memory { + memory@0 { device_type = "memory"; reg = <0x00000000 0x04000000>; // 64MB };
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 68/75 arm64: dts: qcom: msm8916: Add CPU ACC and SAW/SPM
In reply to Sasha LevinFrom: Stephan Gerhold <[email protected]>
[ Upstream commit a22f9a766e1dc61f8f6ee2edfe83d4d23d78e059 ]
Add the device tree nodes necessary for SMP bring-up and cpuidle without PSCI on ARM32. The hardware is typically controlled by the PSCI implementation in the TrustZone firmware and is therefore marked as status = "reserved" by default (from the device tree specification):
"Indicates that the device is operational, but should not be used.
Typically this is used for devices that are controlled by another software component, such as platform firmware."
Since this is part of the MSM8916 SoC it should be added to msm8916.dtsi but in practice these nodes should only get enabled via an extra include on ARM32.
This is necessary for some devices with signed firmware which is missing both ARM64 and PSCI support and can therefore only boot ARM32 kernels.
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+)
arch/arm64/boot/dts/qcom/msm8916.dtsi +56 -0
@@ -124,6 +124,8 @@ #cooling-cells = <2>; power-domains = <&CPU_PD0>; power-domain-names = "psci"; + qcom,acc = <&cpu0_acc>; + qcom,saw = <&cpu0_saw>; }; CPU1: cpu@1 {
@@ -137,6 +139,8 @@ #cooling-cells = <2>; power-domains = <&CPU_PD1>; power-domain-names = "psci"; + qcom,acc = <&cpu1_acc>; + qcom,saw = <&cpu1_saw>; }; CPU2: cpu@2 {
@@ -150,6 +154,8 @@ #cooling-cells = <2>; power-domains = <&CPU_PD2>; power-domain-names = "psci"; + qcom,acc = <&cpu2_acc>; + qcom,saw = <&cpu2_saw>; }; CPU3: cpu@3 {
@@ -163,6 +169,8 @@ #cooling-cells = <2>; power-domains = <&CPU_PD3>; power-domain-names = "psci"; + qcom,acc = <&cpu3_acc>; + qcom,saw = <&cpu3_saw>; }; L2_0: l2-cache {
@@ -1844,6 +1852,54 @@ status = "disabled"; }; }; + + cpu0_acc: power-manager@b088000 { + compatible = "qcom,msm8916-acc"; + reg = <0x0b088000 0x1000>; + status = "reserved"; /* Controlled by PSCI firmware */ + }; + + cpu0_saw: power-manager@b089000 { + compatible = "qcom,msm8916-saw2-v3.0-cpu", "qcom,saw2"; + reg = <0x0b089000 0x1000>; + status = "reserved"; /* Controlled by PSCI firmware */ + }; + + cpu1_acc: power-manager@b098000 { + compatible = "qcom,msm8916-acc"; + reg = <0x0b098000 0x1000>; + status = "reserved"; /* Controlled by PSCI firmware */ + }; + + cpu1_saw: power-manager@b099000 { + compatible = "qcom,msm8916-saw2-v3.0-cpu", "qcom,saw2"; + reg = <0x0b099000 0x1000>; + status = "reserved"; /* Controlled by PSCI firmware */ + }; + + cpu2_acc: power-manager@b0a8000 { + compatible = "qcom,msm8916-acc"; + reg = <0x0b0a8000 0x1000>; + status = "reserved"; /* Controlled by PSCI firmware */ + }; + + cpu2_saw: power-manager@b0a9000 { + compatible = "qcom,msm8916-saw2-v3.0-cpu", "qcom,saw2"; + reg = <0x0b0a9000 0x1000>; + status = "reserved"; /* Controlled by PSCI firmware */ + }; + + cpu3_acc: power-manager@b0b8000 { + compatible = "qcom,msm8916-acc"; + reg = <0x0b0b8000 0x1000>; + status = "reserved"; /* Controlled by PSCI firmware */ + }; + + cpu3_saw: power-manager@b0b9000 { + compatible = "qcom,msm8916-saw2-v3.0-cpu", "qcom,saw2"; + reg = <0x0b0b9000 0x1000>; + status = "reserved"; /* Controlled by PSCI firmware */ + }; }; thermal-zones {
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 69/75 ARM: dts: qcom: fix memory and mdio nodes naming for RB3011
In reply to Sasha LevinFrom: David Heidelberg <[email protected]>
[ Upstream commit 14a1f6c9d8017ffbf388e82e1a1f023196d98612 ]
Fixes warnings regarding to memory and mdio nodes and apply new naming following dt-schema.
--- arch/arm/boot/dts/qcom-ipq8064-rb3011.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/qcom-ipq8064-rb3011.dts +3 -3
@@ -19,12 +19,12 @@ stdout-path = "serial0:115200n8"; }; - memory@0 { + memory@42000000 { reg = <0x42000000 0x3e000000>; device_type = "memory"; }; - mdio0: mdio@0 { + mdio0: mdio-0 { status = "okay"; compatible = "virtual,mdio-gpio"; gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH>,
@@ -91,7 +91,7 @@ }; }; - mdio1: mdio@1 { + mdio1: mdio-1 { status = "okay"; compatible = "virtual,mdio-gpio"; gpios = <&qcom_pinmux 11 GPIO_ACTIVE_HIGH>,
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 70/75 ALSA: gus: fix null pointer dereference on pointer block
In reply to Sasha LevinFrom: Chengfeng Ye <[email protected]>
[ Upstream commit a0d21bb3279476c777434c40d969ea88ca64f9aa ]
The pointer block return from snd_gf1_dma_next_block could be null, so there is a potential null pointer dereference issue. Fix this by adding a null check before dereference.
--- sound/isa/gus/gus_dma.c | 2 ++ 1 file changed, 2 insertions(+)
sound/isa/gus/gus_dma.c +2 -0
@@ -126,6 +126,8 @@ static void snd_gf1_dma_interrupt(struct snd_gus_card * gus) } block =snd_gf1_dma_next_block (gus);spin_unlock (&gus->dma_lock); +if (!block) +return ;snd_gf1_dma_program (gus, block->addr, block->buf_addr, block->count, (unsigned short ) block->cmd);kfree (block);#if 0
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 71/75 ALSA: usb-audio: fix null pointer dereference on pointer cs_desc
In reply to Sasha LevinFrom: Chengfeng Ye <[email protected]>
[ Upstream commit b97053df0f04747c3c1e021ecbe99db675342954 ]
The pointer cs_desc return from snd_usb_find_clock_source could be null, so there is a potential null pointer dereference issue. Fix this by adding a null check before dereference.
--- sound/usb/clock.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/usb/clock.c +4 -0
@@ -499,6 +499,10 @@ int snd_usb_set_sample_rate_v2v3(struct snd_usb_audio *chip,union uac23_clock_source_desc *cs_desc; cs_desc =snd_usb_find_clock_source (chip, clock, fmt->protocol); + +if (!cs_desc) +return 0 ; +if (fmt->protocol ==UAC_VERSION_3 ) bmControls =le32_to_cpu (cs_desc->v3.bmControls);else
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 72/75 clk: at91: sama7g5: remove prescaler part of master clock
In reply to Sasha LevinFrom: Claudiu Beznea <[email protected]>
[ Upstream commit facb87ad75603813bc3b1314f5a87377f020fcb8 ]
On SAMA7G5 the prescaler part of master clock has been implemented as a changeable one. Everytime the prescaler is changed the PMC_SR.MCKRDY bit must be polled. Value 1 for PMC_SR.MCKRDY means the prescaler update is done. Driver polls for this bit until it becomes 1. On SAMA7G5 it has been discovered that in some conditions the PMC_SR.MCKRDY is not rising but the rate it provides it's stable. The workaround is to add a timeout when polling for PMC_SR.MCKRDY. At the moment, for SAMA7G5, the prescaler will be removed from Linux clock tree as all the frequencies for CPU could be obtained from PLL and also there will be less overhead when changing frequency via DVFS.
--- drivers/clk/at91/sama7g5.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/clk/at91/sama7g5.c +1 -10
@@ -982,16 +982,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) } parent_names[0 ] ="cpupll_divpmcck" ; - hw =at91_clk_register_master_pres (regmap,"cpuck" ,1 , parent_names, - &mck0_layout, &mck0_characteristics, - &pmc_mck0_lock, -CLK_SET_RATE_PARENT ,0 ); -if (IS_ERR (hw)) - goto err_free; - - sama7g5_pmc->chws[PMC_CPU ] = hw; - - hw =at91_clk_register_master_div (regmap,"mck0" ,"cpuck" , + hw =at91_clk_register_master_div (regmap,"mck0" ,"cpupll_divpmcck" , &mck0_layout, &mck0_characteristics, &pmc_mck0_lock,0 );if (IS_ERR (hw))
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 73/75 powerpc/dcr: Use cmplwi instead of 3-argument cmpli
In reply to Sasha LevinFrom: Michael Ellerman <[email protected]>
[ Upstream commit fef071be57dc43679a32d5b0e6ee176d6f12e9f2 ]
In dcr-low.S we use cmpli with three arguments, instead of four arguments as defined in the ISA:
cmpli cr0,r3,1024
This appears to be a PPC440-ism, looking at the "PPC440x5 CPU Core User’s Manual" it shows cmpli having no L field, but implied to be 0 due to the core being 32-bit. It mentions that the ISA defines four arguments and recommends using cmplwi.
It also corresponds to the old POWER instruction set, which had no L field there, a reserved bit instead.
dcr-low.S is only built 32-bit, because it is only built when DCR_NATIVE=y, which is only selected by 40x and 44x. Looking at the generated code (with gcc/gas) we see cmplwi as expected.
Although gas is happy with the 3-argument version when building for 32-bit, the LLVM assembler is not and errors out with:
arch/powerpc/sysdev/dcr-low.S:27:10: error: invalid operand for instruction
cmpli 0,%r3,1024; ...
^
Switch to the cmplwi extended opcode, which avoids any confusion when reading the ISA, fixes the issue with the LLVM assembler, and also means the code could be built 64-bit in future (though that's very unlikely).
--- arch/powerpc/sysdev/dcr-low.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/sysdev/dcr-low.S +1 -1
@@ -11,7 +11,7 @@ #include <asm/export.h> #define DCR_ACCESS_PROLOG(table) \ - cmpli cr0,r3,1024; \ + cmplwi cr0,r3,1024; \ rlwinm r3,r3,4,18,27; \ lis r5,table@h; \ ori r5,r5,table@l; \
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 74/75 powerpc/8xx: Fix Oops with STRICT_KERNEL_RWX without DEBUG_RODATA_TEST
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit c12ab8dbc492b992e1ea717db933cee568780c47 ]
Until now, all tests involving CONFIG_STRICT_KERNEL_RWX were done with DEBUG_RODATA_TEST to check the result. But now that CONFIG_STRICT_KERNEL_RWX is selected by default, it came without CONFIG_DEBUG_RODATA_TEST and led to the following Oops
[ 6.830908] Freeing unused kernel image (initmem) memory: 352K [ 6.840077] BUG: Unable to handle kernel data access on write at 0xc1285200 [ 6.846836] Faulting instruction address: 0xc0004b6c [ 6.851745] Oops: Kernel access of bad area, sig: 11 [#1] [ 6.857075] BE PAGE_SIZE=16K PREEMPT CMPC885 [ 6.861348] SAF3000 DIE NOTIFICATION [ 6.864830] CPU: 0 PID: 1 Comm: swapper Not tainted 5.15.0-rc5-s3k-dev-02255-g2747d7b7916f #451 [ 6.873429] NIP: c0004b6c LR: c0004b60 CTR: 00000000 [ 6.878419] REGS: c902be60 TRAP: 0300 Not tainted (5.15.0-rc5-s3k-dev-02255-g2747d7b7916f) [ 6.886852] MSR: 00009032 <EE,ME,IR,DR,RI> CR: 53000335 XER: 8000ff40 [ 6.893564] DAR: c1285200 DSISR: 82000000 [ 6.893564] GPR00: 0c000000 c902bf20 c20f4000 08000000 00000001 04001f00 c1800000 00000035 [ 6.893564] GPR08: ff0001ff c1280000 00000002 c0004b60 00001000 00000000 c0004b1c 00000000 [ 6.893564] GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 6.893564] GPR24: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 c1060000 [ 6.932034] NIP [c0004b6c] kernel_init+0x50/0x138 [ 6.936682] LR [c0004b60] kernel_init+0x44/0x138 [ 6.941245] Call Trace: [ 6.943653] [c902bf20] [c0004b60] kernel_init+0x44/0x138 (unreliable) [ 6.950022] [c902bf30] [c001122c] ret_from_kernel_thread+0x5c/0x64 [ 6.956135] Instruction dump: [ 6.959060] 48ffc521 48045469 4800d8cd 3d20c086 89295fa0 2c090000 41820058 480796c9 [ 6.966890] 4800e48d 3d20c128 39400002 3fe0c106 <91495200> 3bff8000 4806fa1d 481f7d75 [ 6.974902] ---[ end trace 1e397bacba4aa610 ]---
0xc1285200 corresponds to 'system_state' global var that the kernel is trying to set to SYSTEM_RUNNING. This var is above the RO/RW limit so it shouldn't Oops.
It oopses because the dirty bit is missing.
--- arch/powerpc/kernel/head_8xx.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/head_8xx.S +1 -1
@@ -755,7 +755,7 @@ _GLOBAL(mmu_pin_tlb) cmplw r6, r9 bdnzt lt, 2b -4: LOAD_REG_IMMEDIATE(r8, 0xf0 | _PAGE_SPS | _PAGE_SH | _PAGE_PRESENT) +4: LOAD_REG_IMMEDIATE(r8, 0xf0 | _PAGE_DIRTY | _PAGE_SPS | _PAGE_SH | _PAGE_PRESENT) 2: ori r0, r6, MD_EVALID mtspr SPRN_MD_CTR, r5 mtspr SPRN_MD_EPN, r0
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 75/75 HID: playstation: require multicolor LED functionality
In reply to Sasha LevinFrom: Jiri Kosina <[email protected]>
[ Upstream commit d7f1f9fec09adc1d77092cb2db0e56e2a4efd262 ]
The driver requires multicolor LED support; express that in Kconfig.
--- drivers/hid/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/hid/Kconfig +1 -0
@@ -867,6 +867,7 @@ config HID_PLANTRONICS config HID_PLAYSTATION tristate "PlayStation HID Driver" depends on HID + depends on LEDS_CLASS_MULTICOLOR select CRC32 select POWER_SUPPLY help
Signature · 1 line
2.33.0