mirror of
https://github.com/armbian/build.git
synced 2025-08-15 23:56:57 +02:00
19947 lines
630 KiB
Diff
19947 lines
630 KiB
Diff
diff --git a/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml b/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
|
|
index e850a8894758df..bb40bb9e036ee0 100644
|
|
--- a/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
|
|
+++ b/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
|
|
@@ -27,7 +27,7 @@ properties:
|
|
description: |
|
|
For multicolor LED support this property should be defined as either
|
|
LED_COLOR_ID_RGB or LED_COLOR_ID_MULTI which can be found in
|
|
- include/linux/leds/common.h.
|
|
+ include/dt-bindings/leds/common.h.
|
|
enum: [ 8, 9 ]
|
|
|
|
required:
|
|
diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml
|
|
index 05747e012516e2..ab26b1bd567fd9 100644
|
|
--- a/Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml
|
|
+++ b/Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml
|
|
@@ -50,15 +50,15 @@ properties:
|
|
minimum: 0
|
|
maximum: 1
|
|
|
|
- rohm,charger-sense-resistor-ohms:
|
|
- minimum: 10000000
|
|
- maximum: 50000000
|
|
+ rohm,charger-sense-resistor-micro-ohms:
|
|
+ minimum: 10000
|
|
+ maximum: 50000
|
|
description: |
|
|
- BD71827 and BD71828 have SAR ADC for measuring charging currents.
|
|
- External sense resistor (RSENSE in data sheet) should be used. If
|
|
- something other but 30MOhm resistor is used the resistance value
|
|
- should be given here in Ohms.
|
|
- default: 30000000
|
|
+ BD71815 has SAR ADC for measuring charging currents. External sense
|
|
+ resistor (RSENSE in data sheet) should be used. If something other
|
|
+ but a 30 mOhm resistor is used the resistance value should be given
|
|
+ here in micro Ohms.
|
|
+ default: 30000
|
|
|
|
regulators:
|
|
$ref: ../regulator/rohm,bd71815-regulator.yaml
|
|
@@ -67,7 +67,7 @@ properties:
|
|
|
|
gpio-reserved-ranges:
|
|
description: |
|
|
- Usage of BD71828 GPIO pins can be changed via OTP. This property can be
|
|
+ Usage of BD71815 GPIO pins can be changed via OTP. This property can be
|
|
used to mark the pins which should not be configured for GPIO. Please see
|
|
the ../gpio/gpio.txt for more information.
|
|
|
|
@@ -113,7 +113,7 @@ examples:
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
|
|
- rohm,charger-sense-resistor-ohms = <10000000>;
|
|
+ rohm,charger-sense-resistor-micro-ohms = <10000>;
|
|
|
|
regulators {
|
|
buck1: buck1 {
|
|
diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
|
|
index 58ae298cd2fcf4..23884b8184a9df 100644
|
|
--- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
|
|
+++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
|
|
@@ -25,7 +25,7 @@ properties:
|
|
"#address-cells":
|
|
const: 1
|
|
description: |
|
|
- The cell is the slot ID if a function subnode is used.
|
|
+ The cell is the SDIO function number if a function subnode is used.
|
|
|
|
"#size-cells":
|
|
const: 0
|
|
diff --git a/Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml b/Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml
|
|
index 6317daf76d1fbe..2bed57a347827e 100644
|
|
--- a/Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml
|
|
+++ b/Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml
|
|
@@ -31,10 +31,6 @@ properties:
|
|
$ref: regulator.yaml#
|
|
unevaluatedProperties: false
|
|
|
|
- properties:
|
|
- regulator-compatible:
|
|
- pattern: "^vbuck[1-4]$"
|
|
-
|
|
additionalProperties: false
|
|
|
|
required:
|
|
@@ -52,7 +48,6 @@ examples:
|
|
|
|
regulators {
|
|
vbuck1 {
|
|
- regulator-compatible = "vbuck1";
|
|
regulator-min-microvolt = <300000>;
|
|
regulator-max-microvolt = <1193750>;
|
|
regulator-enable-ramp-delay = <256>;
|
|
@@ -60,7 +55,6 @@ examples:
|
|
};
|
|
|
|
vbuck3 {
|
|
- regulator-compatible = "vbuck3";
|
|
regulator-min-microvolt = <300000>;
|
|
regulator-max-microvolt = <1193750>;
|
|
regulator-enable-ramp-delay = <256>;
|
|
diff --git a/Makefile b/Makefile
|
|
index b8041104f248d3..d679a3dd5a582b 100644
|
|
--- a/Makefile
|
|
+++ b/Makefile
|
|
@@ -1,7 +1,7 @@
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
VERSION = 6
|
|
PATCHLEVEL = 6
|
|
-SUBLEVEL = 75
|
|
+SUBLEVEL = 76
|
|
EXTRAVERSION =
|
|
NAME = Pinguïn Aangedreven
|
|
|
|
@@ -518,7 +518,7 @@ KGZIP = gzip
|
|
KBZIP2 = bzip2
|
|
KLZOP = lzop
|
|
LZMA = lzma
|
|
-LZ4 = lz4c
|
|
+LZ4 = lz4
|
|
XZ = xz
|
|
ZSTD = zstd
|
|
|
|
diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts
|
|
index 64075cc41d9275..f5d38a9f47638e 100644
|
|
--- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts
|
|
+++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts
|
|
@@ -284,12 +284,12 @@ &i2c10 {
|
|
&i2c11 {
|
|
status = "okay";
|
|
power-sensor@10 {
|
|
- compatible = "adi, adm1272";
|
|
+ compatible = "adi,adm1272";
|
|
reg = <0x10>;
|
|
};
|
|
|
|
power-sensor@12 {
|
|
- compatible = "adi, adm1272";
|
|
+ compatible = "adi,adm1272";
|
|
reg = <0x12>;
|
|
};
|
|
|
|
@@ -454,22 +454,20 @@ adc@1f {
|
|
};
|
|
|
|
pwm@20{
|
|
- compatible = "max31790";
|
|
+ compatible = "maxim,max31790";
|
|
reg = <0x20>;
|
|
- #address-cells = <1>;
|
|
- #size-cells = <0>;
|
|
};
|
|
|
|
gpio@22{
|
|
compatible = "ti,tca6424";
|
|
reg = <0x22>;
|
|
+ gpio-controller;
|
|
+ #gpio-cells = <2>;
|
|
};
|
|
|
|
pwm@23{
|
|
- compatible = "max31790";
|
|
+ compatible = "maxim,max31790";
|
|
reg = <0x23>;
|
|
- #address-cells = <1>;
|
|
- #size-cells = <0>;
|
|
};
|
|
|
|
adc@33 {
|
|
@@ -504,22 +502,20 @@ adc@1f {
|
|
};
|
|
|
|
pwm@20{
|
|
- compatible = "max31790";
|
|
+ compatible = "maxim,max31790";
|
|
reg = <0x20>;
|
|
- #address-cells = <1>;
|
|
- #size-cells = <0>;
|
|
};
|
|
|
|
gpio@22{
|
|
compatible = "ti,tca6424";
|
|
reg = <0x22>;
|
|
+ gpio-controller;
|
|
+ #gpio-cells = <2>;
|
|
};
|
|
|
|
pwm@23{
|
|
- compatible = "max31790";
|
|
+ compatible = "maxim,max31790";
|
|
reg = <0x23>;
|
|
- #address-cells = <1>;
|
|
- #size-cells = <0>;
|
|
};
|
|
|
|
adc@33 {
|
|
diff --git a/arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi b/arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi
|
|
index f36063c57c7f28..72c55e5187ca89 100644
|
|
--- a/arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi
|
|
+++ b/arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi
|
|
@@ -440,7 +440,7 @@ gmac0: ethernet@ff800000 {
|
|
clocks = <&l4_mp_clk>, <&peri_emac_ptp_clk>;
|
|
clock-names = "stmmaceth", "ptp_ref";
|
|
resets = <&rst EMAC0_RESET>, <&rst EMAC0_OCP_RESET>;
|
|
- reset-names = "stmmaceth", "ahb";
|
|
+ reset-names = "stmmaceth", "stmmaceth-ocp";
|
|
snps,axi-config = <&socfpga_axi_setup>;
|
|
status = "disabled";
|
|
};
|
|
@@ -460,7 +460,7 @@ gmac1: ethernet@ff802000 {
|
|
clocks = <&l4_mp_clk>, <&peri_emac_ptp_clk>;
|
|
clock-names = "stmmaceth", "ptp_ref";
|
|
resets = <&rst EMAC1_RESET>, <&rst EMAC1_OCP_RESET>;
|
|
- reset-names = "stmmaceth", "ahb";
|
|
+ reset-names = "stmmaceth", "stmmaceth-ocp";
|
|
snps,axi-config = <&socfpga_axi_setup>;
|
|
status = "disabled";
|
|
};
|
|
@@ -480,7 +480,7 @@ gmac2: ethernet@ff804000 {
|
|
clocks = <&l4_mp_clk>, <&peri_emac_ptp_clk>;
|
|
clock-names = "stmmaceth", "ptp_ref";
|
|
resets = <&rst EMAC2_RESET>, <&rst EMAC2_OCP_RESET>;
|
|
- reset-names = "stmmaceth", "ahb";
|
|
+ reset-names = "stmmaceth", "stmmaceth-ocp";
|
|
snps,axi-config = <&socfpga_axi_setup>;
|
|
status = "disabled";
|
|
};
|
|
diff --git a/arch/arm/boot/dts/mediatek/mt7623.dtsi b/arch/arm/boot/dts/mediatek/mt7623.dtsi
|
|
index f0b4a09004b317..9c5a52ce9351aa 100644
|
|
--- a/arch/arm/boot/dts/mediatek/mt7623.dtsi
|
|
+++ b/arch/arm/boot/dts/mediatek/mt7623.dtsi
|
|
@@ -308,7 +308,7 @@ pwrap: pwrap@1000d000 {
|
|
clock-names = "spi", "wrap";
|
|
};
|
|
|
|
- cir: cir@10013000 {
|
|
+ cir: ir-receiver@10013000 {
|
|
compatible = "mediatek,mt7623-cir";
|
|
reg = <0 0x10013000 0 0x1000>;
|
|
interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_LOW>;
|
|
diff --git a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts
|
|
index e055b9e2fe3446..35a933eec5738f 100644
|
|
--- a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts
|
|
+++ b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts
|
|
@@ -197,7 +197,7 @@ qspi1_flash: flash@0 {
|
|
|
|
&sdmmc0 {
|
|
bus-width = <4>;
|
|
- mmc-ddr-3_3v;
|
|
+ no-1-8-v;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&pinctrl_sdmmc0_default>;
|
|
status = "okay";
|
|
diff --git a/arch/arm/boot/dts/st/stm32mp151.dtsi b/arch/arm/boot/dts/st/stm32mp151.dtsi
|
|
index aec7fa5ab5d8c6..fe79d5d40c1160 100644
|
|
--- a/arch/arm/boot/dts/st/stm32mp151.dtsi
|
|
+++ b/arch/arm/boot/dts/st/stm32mp151.dtsi
|
|
@@ -1165,7 +1165,7 @@ ipcc: mailbox@4c001000 {
|
|
reg = <0x4c001000 0x400>;
|
|
st,proc-id = <0>;
|
|
interrupts-extended =
|
|
- <&exti 61 1>,
|
|
+ <&exti 61 IRQ_TYPE_LEVEL_HIGH>,
|
|
<&intc GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
|
interrupt-names = "rx", "tx";
|
|
clocks = <&rcc IPCC>;
|
|
diff --git a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-drc02.dtsi b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-drc02.dtsi
|
|
index 35b1034aa3cf63..e4e114d8c3371e 100644
|
|
--- a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-drc02.dtsi
|
|
+++ b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-drc02.dtsi
|
|
@@ -6,18 +6,6 @@
|
|
#include <dt-bindings/input/input.h>
|
|
#include <dt-bindings/pwm/pwm.h>
|
|
|
|
-/ {
|
|
- aliases {
|
|
- serial0 = &uart4;
|
|
- serial1 = &usart3;
|
|
- serial2 = &uart8;
|
|
- };
|
|
-
|
|
- chosen {
|
|
- stdout-path = "serial0:115200n8";
|
|
- };
|
|
-};
|
|
-
|
|
&adc {
|
|
status = "disabled";
|
|
};
|
|
diff --git a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-pdk2.dtsi b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-pdk2.dtsi
|
|
index 46b87a27d8b378..7050582837d58f 100644
|
|
--- a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-pdk2.dtsi
|
|
+++ b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-pdk2.dtsi
|
|
@@ -7,16 +7,6 @@
|
|
#include <dt-bindings/pwm/pwm.h>
|
|
|
|
/ {
|
|
- aliases {
|
|
- serial0 = &uart4;
|
|
- serial1 = &usart3;
|
|
- serial2 = &uart8;
|
|
- };
|
|
-
|
|
- chosen {
|
|
- stdout-path = "serial0:115200n8";
|
|
- };
|
|
-
|
|
clk_ext_audio_codec: clock-codec {
|
|
compatible = "fixed-clock";
|
|
#clock-cells = <0>;
|
|
diff --git a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-picoitx.dtsi b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-picoitx.dtsi
|
|
index abc595350e71a0..81743a448607b0 100644
|
|
--- a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-picoitx.dtsi
|
|
+++ b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-picoitx.dtsi
|
|
@@ -7,16 +7,6 @@
|
|
#include <dt-bindings/pwm/pwm.h>
|
|
|
|
/ {
|
|
- aliases {
|
|
- serial0 = &uart4;
|
|
- serial1 = &usart3;
|
|
- serial2 = &uart8;
|
|
- };
|
|
-
|
|
- chosen {
|
|
- stdout-path = "serial0:115200n8";
|
|
- };
|
|
-
|
|
led {
|
|
compatible = "gpio-leds";
|
|
|
|
diff --git a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi
|
|
index 74a11ccc5333f8..142d4a8731f8d4 100644
|
|
--- a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi
|
|
+++ b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi
|
|
@@ -14,6 +14,13 @@ aliases {
|
|
ethernet1 = &ksz8851;
|
|
rtc0 = &hwrtc;
|
|
rtc1 = &rtc;
|
|
+ serial0 = &uart4;
|
|
+ serial1 = &uart8;
|
|
+ serial2 = &usart3;
|
|
+ };
|
|
+
|
|
+ chosen {
|
|
+ stdout-path = "serial0:115200n8";
|
|
};
|
|
|
|
memory@c0000000 {
|
|
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
|
|
index 1a26af0fabc710..22ecaf09d00f96 100644
|
|
--- a/arch/arm/mach-at91/pm.c
|
|
+++ b/arch/arm/mach-at91/pm.c
|
|
@@ -591,7 +591,21 @@ static int at91_suspend_finish(unsigned long val)
|
|
return 0;
|
|
}
|
|
|
|
-static void at91_pm_switch_ba_to_vbat(void)
|
|
+/**
|
|
+ * at91_pm_switch_ba_to_auto() - Configure Backup Unit Power Switch
|
|
+ * to automatic/hardware mode.
|
|
+ *
|
|
+ * The Backup Unit Power Switch can be managed either by software or hardware.
|
|
+ * Enabling hardware mode allows the automatic transition of power between
|
|
+ * VDDANA (or VDDIN33) and VDDBU (or VBAT, respectively), based on the
|
|
+ * availability of these power sources.
|
|
+ *
|
|
+ * If the Backup Unit Power Switch is already in automatic mode, no action is
|
|
+ * required. If it is in software-controlled mode, it is switched to automatic
|
|
+ * mode to enhance safety and eliminate the need for toggling between power
|
|
+ * sources.
|
|
+ */
|
|
+static void at91_pm_switch_ba_to_auto(void)
|
|
{
|
|
unsigned int offset = offsetof(struct at91_pm_sfrbu_regs, pswbu);
|
|
unsigned int val;
|
|
@@ -602,24 +616,19 @@ static void at91_pm_switch_ba_to_vbat(void)
|
|
|
|
val = readl(soc_pm.data.sfrbu + offset);
|
|
|
|
- /* Already on VBAT. */
|
|
- if (!(val & soc_pm.sfrbu_regs.pswbu.state))
|
|
+ /* Already on auto/hardware. */
|
|
+ if (!(val & soc_pm.sfrbu_regs.pswbu.ctrl))
|
|
return;
|
|
|
|
- val &= ~soc_pm.sfrbu_regs.pswbu.softsw;
|
|
- val |= soc_pm.sfrbu_regs.pswbu.key | soc_pm.sfrbu_regs.pswbu.ctrl;
|
|
+ val &= ~soc_pm.sfrbu_regs.pswbu.ctrl;
|
|
+ val |= soc_pm.sfrbu_regs.pswbu.key;
|
|
writel(val, soc_pm.data.sfrbu + offset);
|
|
-
|
|
- /* Wait for update. */
|
|
- val = readl(soc_pm.data.sfrbu + offset);
|
|
- while (val & soc_pm.sfrbu_regs.pswbu.state)
|
|
- val = readl(soc_pm.data.sfrbu + offset);
|
|
}
|
|
|
|
static void at91_pm_suspend(suspend_state_t state)
|
|
{
|
|
if (soc_pm.data.mode == AT91_PM_BACKUP) {
|
|
- at91_pm_switch_ba_to_vbat();
|
|
+ at91_pm_switch_ba_to_auto();
|
|
|
|
cpu_suspend(0, at91_suspend_finish);
|
|
|
|
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
|
|
index 3312ef93355da7..a5bf5554800fe1 100644
|
|
--- a/arch/arm/mach-omap1/board-nokia770.c
|
|
+++ b/arch/arm/mach-omap1/board-nokia770.c
|
|
@@ -289,7 +289,7 @@ static struct gpiod_lookup_table nokia770_irq_gpio_table = {
|
|
GPIO_LOOKUP("gpio-0-15", 15, "ads7846_irq",
|
|
GPIO_ACTIVE_HIGH),
|
|
/* GPIO used for retu IRQ */
|
|
- GPIO_LOOKUP("gpio-48-63", 15, "retu_irq",
|
|
+ GPIO_LOOKUP("gpio-48-63", 14, "retu_irq",
|
|
GPIO_ACTIVE_HIGH),
|
|
/* GPIO used for tahvo IRQ */
|
|
GPIO_LOOKUP("gpio-32-47", 8, "tahvo_irq",
|
|
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
|
|
index 50ed2e9f10ed08..6a69d005249441 100644
|
|
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
|
|
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
|
|
@@ -390,6 +390,8 @@ &sound {
|
|
&tcon0 {
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&lcd_rgb666_pins>;
|
|
+ assigned-clocks = <&ccu CLK_TCON0>;
|
|
+ assigned-clock-parents = <&ccu CLK_PLL_VIDEO0_2X>;
|
|
|
|
status = "okay";
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
|
|
index 1128030e4c25b5..d3e5eed84f3648 100644
|
|
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
|
|
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
|
|
@@ -369,6 +369,8 @@ &sound {
|
|
&tcon0 {
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&lcd_rgb666_pins>;
|
|
+ assigned-clocks = <&ccu CLK_TCON0>;
|
|
+ assigned-clock-parents = <&ccu CLK_PLL_VIDEO0_2X>;
|
|
|
|
status = "okay";
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
|
index 57ac18738c995b..7103298f6a1c27 100644
|
|
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
|
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
|
@@ -410,6 +410,8 @@ tcon0: lcd-controller@1c0c000 {
|
|
clock-names = "ahb", "tcon-ch0";
|
|
clock-output-names = "tcon-data-clock";
|
|
#clock-cells = <0>;
|
|
+ assigned-clocks = <&ccu CLK_TCON0>;
|
|
+ assigned-clock-parents = <&ccu CLK_PLL_MIPI>;
|
|
resets = <&ccu RST_BUS_TCON0>, <&ccu RST_BUS_LVDS>;
|
|
reset-names = "lcd", "lvds";
|
|
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
|
|
index 111495622cacdc..8df919d39e5ba1 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
|
|
@@ -938,7 +938,7 @@ pmic: pmic {
|
|
interrupt-controller;
|
|
#interrupt-cells = <2>;
|
|
|
|
- clock: mt6397clock {
|
|
+ clock: clocks {
|
|
compatible = "mediatek,mt6397-clk";
|
|
#clock-cells = <1>;
|
|
};
|
|
@@ -949,11 +949,10 @@ pio6397: pinctrl {
|
|
#gpio-cells = <2>;
|
|
};
|
|
|
|
- regulator: mt6397regulator {
|
|
+ regulators {
|
|
compatible = "mediatek,mt6397-regulator";
|
|
|
|
mt6397_vpca15_reg: buck_vpca15 {
|
|
- regulator-compatible = "buck_vpca15";
|
|
regulator-name = "vpca15";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -963,7 +962,6 @@ mt6397_vpca15_reg: buck_vpca15 {
|
|
};
|
|
|
|
mt6397_vpca7_reg: buck_vpca7 {
|
|
- regulator-compatible = "buck_vpca7";
|
|
regulator-name = "vpca7";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -973,7 +971,6 @@ mt6397_vpca7_reg: buck_vpca7 {
|
|
};
|
|
|
|
mt6397_vsramca15_reg: buck_vsramca15 {
|
|
- regulator-compatible = "buck_vsramca15";
|
|
regulator-name = "vsramca15";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -982,7 +979,6 @@ mt6397_vsramca15_reg: buck_vsramca15 {
|
|
};
|
|
|
|
mt6397_vsramca7_reg: buck_vsramca7 {
|
|
- regulator-compatible = "buck_vsramca7";
|
|
regulator-name = "vsramca7";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -991,7 +987,6 @@ mt6397_vsramca7_reg: buck_vsramca7 {
|
|
};
|
|
|
|
mt6397_vcore_reg: buck_vcore {
|
|
- regulator-compatible = "buck_vcore";
|
|
regulator-name = "vcore";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -1000,7 +995,6 @@ mt6397_vcore_reg: buck_vcore {
|
|
};
|
|
|
|
mt6397_vgpu_reg: buck_vgpu {
|
|
- regulator-compatible = "buck_vgpu";
|
|
regulator-name = "vgpu";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -1009,7 +1003,6 @@ mt6397_vgpu_reg: buck_vgpu {
|
|
};
|
|
|
|
mt6397_vdrm_reg: buck_vdrm {
|
|
- regulator-compatible = "buck_vdrm";
|
|
regulator-name = "vdrm";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <1400000>;
|
|
@@ -1018,7 +1011,6 @@ mt6397_vdrm_reg: buck_vdrm {
|
|
};
|
|
|
|
mt6397_vio18_reg: buck_vio18 {
|
|
- regulator-compatible = "buck_vio18";
|
|
regulator-name = "vio18";
|
|
regulator-min-microvolt = <1620000>;
|
|
regulator-max-microvolt = <1980000>;
|
|
@@ -1027,18 +1019,15 @@ mt6397_vio18_reg: buck_vio18 {
|
|
};
|
|
|
|
mt6397_vtcxo_reg: ldo_vtcxo {
|
|
- regulator-compatible = "ldo_vtcxo";
|
|
regulator-name = "vtcxo";
|
|
regulator-always-on;
|
|
};
|
|
|
|
mt6397_va28_reg: ldo_va28 {
|
|
- regulator-compatible = "ldo_va28";
|
|
regulator-name = "va28";
|
|
};
|
|
|
|
mt6397_vcama_reg: ldo_vcama {
|
|
- regulator-compatible = "ldo_vcama";
|
|
regulator-name = "vcama";
|
|
regulator-min-microvolt = <1800000>;
|
|
regulator-max-microvolt = <1800000>;
|
|
@@ -1046,18 +1035,15 @@ mt6397_vcama_reg: ldo_vcama {
|
|
};
|
|
|
|
mt6397_vio28_reg: ldo_vio28 {
|
|
- regulator-compatible = "ldo_vio28";
|
|
regulator-name = "vio28";
|
|
regulator-always-on;
|
|
};
|
|
|
|
mt6397_vusb_reg: ldo_vusb {
|
|
- regulator-compatible = "ldo_vusb";
|
|
regulator-name = "vusb";
|
|
};
|
|
|
|
mt6397_vmc_reg: ldo_vmc {
|
|
- regulator-compatible = "ldo_vmc";
|
|
regulator-name = "vmc";
|
|
regulator-min-microvolt = <1800000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -1065,7 +1051,6 @@ mt6397_vmc_reg: ldo_vmc {
|
|
};
|
|
|
|
mt6397_vmch_reg: ldo_vmch {
|
|
- regulator-compatible = "ldo_vmch";
|
|
regulator-name = "vmch";
|
|
regulator-min-microvolt = <3000000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -1073,7 +1058,6 @@ mt6397_vmch_reg: ldo_vmch {
|
|
};
|
|
|
|
mt6397_vemc_3v3_reg: ldo_vemc3v3 {
|
|
- regulator-compatible = "ldo_vemc3v3";
|
|
regulator-name = "vemc_3v3";
|
|
regulator-min-microvolt = <3000000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -1081,7 +1065,6 @@ mt6397_vemc_3v3_reg: ldo_vemc3v3 {
|
|
};
|
|
|
|
mt6397_vgp1_reg: ldo_vgp1 {
|
|
- regulator-compatible = "ldo_vgp1";
|
|
regulator-name = "vcamd";
|
|
regulator-min-microvolt = <1800000>;
|
|
regulator-max-microvolt = <1800000>;
|
|
@@ -1089,7 +1072,6 @@ mt6397_vgp1_reg: ldo_vgp1 {
|
|
};
|
|
|
|
mt6397_vgp2_reg: ldo_vgp2 {
|
|
- regulator-compatible = "ldo_vgp2";
|
|
regulator-name = "vcamio";
|
|
regulator-min-microvolt = <3300000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -1097,7 +1079,6 @@ mt6397_vgp2_reg: ldo_vgp2 {
|
|
};
|
|
|
|
mt6397_vgp3_reg: ldo_vgp3 {
|
|
- regulator-compatible = "ldo_vgp3";
|
|
regulator-name = "vcamaf";
|
|
regulator-min-microvolt = <1800000>;
|
|
regulator-max-microvolt = <1800000>;
|
|
@@ -1105,7 +1086,6 @@ mt6397_vgp3_reg: ldo_vgp3 {
|
|
};
|
|
|
|
mt6397_vgp4_reg: ldo_vgp4 {
|
|
- regulator-compatible = "ldo_vgp4";
|
|
regulator-name = "vgp4";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -1113,7 +1093,6 @@ mt6397_vgp4_reg: ldo_vgp4 {
|
|
};
|
|
|
|
mt6397_vgp5_reg: ldo_vgp5 {
|
|
- regulator-compatible = "ldo_vgp5";
|
|
regulator-name = "vgp5";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <3000000>;
|
|
@@ -1121,7 +1100,6 @@ mt6397_vgp5_reg: ldo_vgp5 {
|
|
};
|
|
|
|
mt6397_vgp6_reg: ldo_vgp6 {
|
|
- regulator-compatible = "ldo_vgp6";
|
|
regulator-name = "vgp6";
|
|
regulator-min-microvolt = <3300000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -1130,7 +1108,6 @@ mt6397_vgp6_reg: ldo_vgp6 {
|
|
};
|
|
|
|
mt6397_vibr_reg: ldo_vibr {
|
|
- regulator-compatible = "ldo_vibr";
|
|
regulator-name = "vibr";
|
|
regulator-min-microvolt = <1300000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -1138,7 +1115,7 @@ mt6397_vibr_reg: ldo_vibr {
|
|
};
|
|
};
|
|
|
|
- rtc: mt6397rtc {
|
|
+ rtc: rtc {
|
|
compatible = "mediatek,mt6397-rtc";
|
|
};
|
|
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
|
|
index d258c80213b264..f6a70f22bd0c48 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
|
|
@@ -308,11 +308,10 @@ pmic: pmic {
|
|
interrupt-controller;
|
|
#interrupt-cells = <2>;
|
|
|
|
- mt6397regulator: mt6397regulator {
|
|
+ regulators {
|
|
compatible = "mediatek,mt6397-regulator";
|
|
|
|
mt6397_vpca15_reg: buck_vpca15 {
|
|
- regulator-compatible = "buck_vpca15";
|
|
regulator-name = "vpca15";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -321,7 +320,6 @@ mt6397_vpca15_reg: buck_vpca15 {
|
|
};
|
|
|
|
mt6397_vpca7_reg: buck_vpca7 {
|
|
- regulator-compatible = "buck_vpca7";
|
|
regulator-name = "vpca7";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -330,7 +328,6 @@ mt6397_vpca7_reg: buck_vpca7 {
|
|
};
|
|
|
|
mt6397_vsramca15_reg: buck_vsramca15 {
|
|
- regulator-compatible = "buck_vsramca15";
|
|
regulator-name = "vsramca15";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -339,7 +336,6 @@ mt6397_vsramca15_reg: buck_vsramca15 {
|
|
};
|
|
|
|
mt6397_vsramca7_reg: buck_vsramca7 {
|
|
- regulator-compatible = "buck_vsramca7";
|
|
regulator-name = "vsramca7";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -348,7 +344,6 @@ mt6397_vsramca7_reg: buck_vsramca7 {
|
|
};
|
|
|
|
mt6397_vcore_reg: buck_vcore {
|
|
- regulator-compatible = "buck_vcore";
|
|
regulator-name = "vcore";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -357,7 +352,6 @@ mt6397_vcore_reg: buck_vcore {
|
|
};
|
|
|
|
mt6397_vgpu_reg: buck_vgpu {
|
|
- regulator-compatible = "buck_vgpu";
|
|
regulator-name = "vgpu";
|
|
regulator-min-microvolt = < 700000>;
|
|
regulator-max-microvolt = <1350000>;
|
|
@@ -366,7 +360,6 @@ mt6397_vgpu_reg: buck_vgpu {
|
|
};
|
|
|
|
mt6397_vdrm_reg: buck_vdrm {
|
|
- regulator-compatible = "buck_vdrm";
|
|
regulator-name = "vdrm";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <1400000>;
|
|
@@ -375,7 +368,6 @@ mt6397_vdrm_reg: buck_vdrm {
|
|
};
|
|
|
|
mt6397_vio18_reg: buck_vio18 {
|
|
- regulator-compatible = "buck_vio18";
|
|
regulator-name = "vio18";
|
|
regulator-min-microvolt = <1620000>;
|
|
regulator-max-microvolt = <1980000>;
|
|
@@ -384,19 +376,16 @@ mt6397_vio18_reg: buck_vio18 {
|
|
};
|
|
|
|
mt6397_vtcxo_reg: ldo_vtcxo {
|
|
- regulator-compatible = "ldo_vtcxo";
|
|
regulator-name = "vtcxo";
|
|
regulator-always-on;
|
|
};
|
|
|
|
mt6397_va28_reg: ldo_va28 {
|
|
- regulator-compatible = "ldo_va28";
|
|
regulator-name = "va28";
|
|
regulator-always-on;
|
|
};
|
|
|
|
mt6397_vcama_reg: ldo_vcama {
|
|
- regulator-compatible = "ldo_vcama";
|
|
regulator-name = "vcama";
|
|
regulator-min-microvolt = <1500000>;
|
|
regulator-max-microvolt = <2800000>;
|
|
@@ -404,18 +393,15 @@ mt6397_vcama_reg: ldo_vcama {
|
|
};
|
|
|
|
mt6397_vio28_reg: ldo_vio28 {
|
|
- regulator-compatible = "ldo_vio28";
|
|
regulator-name = "vio28";
|
|
regulator-always-on;
|
|
};
|
|
|
|
mt6397_vusb_reg: ldo_vusb {
|
|
- regulator-compatible = "ldo_vusb";
|
|
regulator-name = "vusb";
|
|
};
|
|
|
|
mt6397_vmc_reg: ldo_vmc {
|
|
- regulator-compatible = "ldo_vmc";
|
|
regulator-name = "vmc";
|
|
regulator-min-microvolt = <1800000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -423,7 +409,6 @@ mt6397_vmc_reg: ldo_vmc {
|
|
};
|
|
|
|
mt6397_vmch_reg: ldo_vmch {
|
|
- regulator-compatible = "ldo_vmch";
|
|
regulator-name = "vmch";
|
|
regulator-min-microvolt = <3000000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -431,7 +416,6 @@ mt6397_vmch_reg: ldo_vmch {
|
|
};
|
|
|
|
mt6397_vemc_3v3_reg: ldo_vemc3v3 {
|
|
- regulator-compatible = "ldo_vemc3v3";
|
|
regulator-name = "vemc_3v3";
|
|
regulator-min-microvolt = <3000000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -439,7 +423,6 @@ mt6397_vemc_3v3_reg: ldo_vemc3v3 {
|
|
};
|
|
|
|
mt6397_vgp1_reg: ldo_vgp1 {
|
|
- regulator-compatible = "ldo_vgp1";
|
|
regulator-name = "vcamd";
|
|
regulator-min-microvolt = <1220000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -447,7 +430,6 @@ mt6397_vgp1_reg: ldo_vgp1 {
|
|
};
|
|
|
|
mt6397_vgp2_reg: ldo_vgp2 {
|
|
- regulator-compatible = "ldo_vgp2";
|
|
regulator-name = "vcamio";
|
|
regulator-min-microvolt = <1000000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -455,7 +437,6 @@ mt6397_vgp2_reg: ldo_vgp2 {
|
|
};
|
|
|
|
mt6397_vgp3_reg: ldo_vgp3 {
|
|
- regulator-compatible = "ldo_vgp3";
|
|
regulator-name = "vcamaf";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -463,7 +444,6 @@ mt6397_vgp3_reg: ldo_vgp3 {
|
|
};
|
|
|
|
mt6397_vgp4_reg: ldo_vgp4 {
|
|
- regulator-compatible = "ldo_vgp4";
|
|
regulator-name = "vgp4";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -471,7 +451,6 @@ mt6397_vgp4_reg: ldo_vgp4 {
|
|
};
|
|
|
|
mt6397_vgp5_reg: ldo_vgp5 {
|
|
- regulator-compatible = "ldo_vgp5";
|
|
regulator-name = "vgp5";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <3000000>;
|
|
@@ -479,7 +458,6 @@ mt6397_vgp5_reg: ldo_vgp5 {
|
|
};
|
|
|
|
mt6397_vgp6_reg: ldo_vgp6 {
|
|
- regulator-compatible = "ldo_vgp6";
|
|
regulator-name = "vgp6";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
@@ -487,7 +465,6 @@ mt6397_vgp6_reg: ldo_vgp6 {
|
|
};
|
|
|
|
mt6397_vibr_reg: ldo_vibr {
|
|
- regulator-compatible = "ldo_vibr";
|
|
regulator-name = "vibr";
|
|
regulator-min-microvolt = <1300000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts
|
|
index 9a166dccd727c7..8f95b7270c3fa8 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts
|
|
@@ -27,6 +27,10 @@ &touchscreen {
|
|
hid-descr-addr = <0x0001>;
|
|
};
|
|
|
|
+&mt6358codec {
|
|
+ mediatek,dmic-mode = <1>; /* one-wire */
|
|
+};
|
|
+
|
|
&qca_wifi {
|
|
qcom,ath10k-calibration-variant = "GO_DAMU";
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts
|
|
index 8fa89db03e6399..328294245a79d2 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts
|
|
@@ -11,3 +11,18 @@ / {
|
|
model = "Google kenzo sku17 board";
|
|
compatible = "google,juniper-sku17", "google,juniper", "mediatek,mt8183";
|
|
};
|
|
+
|
|
+&i2c0 {
|
|
+ touchscreen@40 {
|
|
+ compatible = "hid-over-i2c";
|
|
+ reg = <0x40>;
|
|
+
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&touchscreen_pins>;
|
|
+
|
|
+ interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>;
|
|
+
|
|
+ post-power-on-delay-ms = <70>;
|
|
+ hid-descr-addr = <0x0001>;
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi
|
|
index 76d33540166f90..c942e461a177ef 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi
|
|
@@ -6,6 +6,21 @@
|
|
/dts-v1/;
|
|
#include "mt8183-kukui-jacuzzi.dtsi"
|
|
|
|
+&i2c0 {
|
|
+ touchscreen@40 {
|
|
+ compatible = "hid-over-i2c";
|
|
+ reg = <0x40>;
|
|
+
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&touchscreen_pins>;
|
|
+
|
|
+ interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>;
|
|
+
|
|
+ post-power-on-delay-ms = <70>;
|
|
+ hid-descr-addr = <0x0001>;
|
|
+ };
|
|
+};
|
|
+
|
|
&i2c2 {
|
|
trackpad@2c {
|
|
compatible = "hid-over-i2c";
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi
|
|
index 629c4b7ecbc629..8e0575f8c1b275 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi
|
|
@@ -39,8 +39,6 @@ pp1800_mipibrdg: pp1800-mipibrdg {
|
|
pp3300_panel: pp3300-panel {
|
|
compatible = "regulator-fixed";
|
|
regulator-name = "pp3300_panel";
|
|
- regulator-min-microvolt = <3300000>;
|
|
- regulator-max-microvolt = <3300000>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&pp3300_panel_pins>;
|
|
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
|
|
index 8721a5ffca30a7..d1b6355148620b 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
|
|
@@ -1026,7 +1026,8 @@ pwrap: pwrap@1000d000 {
|
|
};
|
|
|
|
keyboard: keyboard@10010000 {
|
|
- compatible = "mediatek,mt6779-keypad";
|
|
+ compatible = "mediatek,mt8183-keypad",
|
|
+ "mediatek,mt6779-keypad";
|
|
reg = <0 0x10010000 0 0x1000>;
|
|
interrupts = <GIC_SPI 186 IRQ_TYPE_EDGE_FALLING>;
|
|
clocks = <&clk26m>;
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
|
|
index 2c184f9e0fc390..a63c59bc8e9782 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
|
|
@@ -1545,6 +1545,8 @@ ssusb0: usb@11201000 {
|
|
#address-cells = <2>;
|
|
#size-cells = <2>;
|
|
ranges;
|
|
+ wakeup-source;
|
|
+ mediatek,syscon-wakeup = <&pericfg 0x420 2>;
|
|
status = "disabled";
|
|
|
|
usb_host0: usb@11200000 {
|
|
@@ -1558,8 +1560,6 @@ usb_host0: usb@11200000 {
|
|
<&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_XHCI>;
|
|
clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck";
|
|
interrupts = <GIC_SPI 294 IRQ_TYPE_LEVEL_HIGH 0>;
|
|
- mediatek,syscon-wakeup = <&pericfg 0x420 2>;
|
|
- wakeup-source;
|
|
status = "disabled";
|
|
};
|
|
};
|
|
@@ -1611,6 +1611,8 @@ ssusb1: usb@11281000 {
|
|
#address-cells = <2>;
|
|
#size-cells = <2>;
|
|
ranges;
|
|
+ wakeup-source;
|
|
+ mediatek,syscon-wakeup = <&pericfg 0x424 2>;
|
|
status = "disabled";
|
|
|
|
usb_host1: usb@11280000 {
|
|
@@ -1624,8 +1626,6 @@ usb_host1: usb@11280000 {
|
|
<&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_XHCI>;
|
|
clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck","xhci_ck";
|
|
interrupts = <GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH 0>;
|
|
- mediatek,syscon-wakeup = <&pericfg 0x424 2>;
|
|
- wakeup-source;
|
|
status = "disabled";
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
|
|
index 6b4b7a7cd35efb..54e3ec168fa9a4 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
|
|
@@ -1391,7 +1391,6 @@ mt6315_6: pmic@6 {
|
|
|
|
regulators {
|
|
mt6315_6_vbuck1: vbuck1 {
|
|
- regulator-compatible = "vbuck1";
|
|
regulator-name = "Vbcpu";
|
|
regulator-min-microvolt = <400000>;
|
|
regulator-max-microvolt = <1193750>;
|
|
@@ -1401,7 +1400,6 @@ mt6315_6_vbuck1: vbuck1 {
|
|
};
|
|
|
|
mt6315_6_vbuck3: vbuck3 {
|
|
- regulator-compatible = "vbuck3";
|
|
regulator-name = "Vlcpu";
|
|
regulator-min-microvolt = <400000>;
|
|
regulator-max-microvolt = <1193750>;
|
|
@@ -1418,7 +1416,6 @@ mt6315_7: pmic@7 {
|
|
|
|
regulators {
|
|
mt6315_7_vbuck1: vbuck1 {
|
|
- regulator-compatible = "vbuck1";
|
|
regulator-name = "Vgpu";
|
|
regulator-min-microvolt = <400000>;
|
|
regulator-max-microvolt = <800000>;
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
|
|
index b21663b46b5192..e3b30543c2c647 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
|
|
@@ -1203,7 +1203,6 @@ mt6315@6 {
|
|
|
|
regulators {
|
|
mt6315_6_vbuck1: vbuck1 {
|
|
- regulator-compatible = "vbuck1";
|
|
regulator-name = "Vbcpu";
|
|
regulator-min-microvolt = <400000>;
|
|
regulator-max-microvolt = <1193750>;
|
|
@@ -1221,7 +1220,6 @@ mt6315@7 {
|
|
|
|
regulators {
|
|
mt6315_7_vbuck1: vbuck1 {
|
|
- regulator-compatible = "vbuck1";
|
|
regulator-name = "Vgpu";
|
|
regulator-min-microvolt = <400000>;
|
|
regulator-max-microvolt = <1193750>;
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
|
|
index 9079e48aea23ea..f56aeb81c4168f 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
|
|
@@ -137,7 +137,6 @@ charger {
|
|
richtek,vinovp-microvolt = <14500000>;
|
|
|
|
otg_vbus_regulator: usb-otg-vbus-regulator {
|
|
- regulator-compatible = "usb-otg-vbus";
|
|
regulator-name = "usb-otg-vbus";
|
|
regulator-min-microvolt = <4425000>;
|
|
regulator-max-microvolt = <5825000>;
|
|
@@ -149,7 +148,6 @@ regulator {
|
|
LDO_VIN3-supply = <&mt6360_buck2>;
|
|
|
|
mt6360_buck1: buck1 {
|
|
- regulator-compatible = "BUCK1";
|
|
regulator-name = "mt6360,buck1";
|
|
regulator-min-microvolt = <300000>;
|
|
regulator-max-microvolt = <1300000>;
|
|
@@ -160,7 +158,6 @@ MT6360_OPMODE_LP
|
|
};
|
|
|
|
mt6360_buck2: buck2 {
|
|
- regulator-compatible = "BUCK2";
|
|
regulator-name = "mt6360,buck2";
|
|
regulator-min-microvolt = <300000>;
|
|
regulator-max-microvolt = <1300000>;
|
|
@@ -171,7 +168,6 @@ MT6360_OPMODE_LP
|
|
};
|
|
|
|
mt6360_ldo1: ldo1 {
|
|
- regulator-compatible = "LDO1";
|
|
regulator-name = "mt6360,ldo1";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <3600000>;
|
|
@@ -180,7 +176,6 @@ mt6360_ldo1: ldo1 {
|
|
};
|
|
|
|
mt6360_ldo2: ldo2 {
|
|
- regulator-compatible = "LDO2";
|
|
regulator-name = "mt6360,ldo2";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <3600000>;
|
|
@@ -189,7 +184,6 @@ mt6360_ldo2: ldo2 {
|
|
};
|
|
|
|
mt6360_ldo3: ldo3 {
|
|
- regulator-compatible = "LDO3";
|
|
regulator-name = "mt6360,ldo3";
|
|
regulator-min-microvolt = <1200000>;
|
|
regulator-max-microvolt = <3600000>;
|
|
@@ -198,7 +192,6 @@ mt6360_ldo3: ldo3 {
|
|
};
|
|
|
|
mt6360_ldo5: ldo5 {
|
|
- regulator-compatible = "LDO5";
|
|
regulator-name = "mt6360,ldo5";
|
|
regulator-min-microvolt = <2700000>;
|
|
regulator-max-microvolt = <3600000>;
|
|
@@ -207,7 +200,6 @@ mt6360_ldo5: ldo5 {
|
|
};
|
|
|
|
mt6360_ldo6: ldo6 {
|
|
- regulator-compatible = "LDO6";
|
|
regulator-name = "mt6360,ldo6";
|
|
regulator-min-microvolt = <500000>;
|
|
regulator-max-microvolt = <2100000>;
|
|
@@ -216,7 +208,6 @@ mt6360_ldo6: ldo6 {
|
|
};
|
|
|
|
mt6360_ldo7: ldo7 {
|
|
- regulator-compatible = "LDO7";
|
|
regulator-name = "mt6360,ldo7";
|
|
regulator-min-microvolt = <500000>;
|
|
regulator-max-microvolt = <2100000>;
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
|
|
index 5a087404ccc2d9..7ba30209ba9a9a 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
|
|
@@ -1572,9 +1572,6 @@ pcie1: pcie@112f8000 {
|
|
phy-names = "pcie-phy";
|
|
power-domains = <&spm MT8195_POWER_DOMAIN_PCIE_MAC_P1>;
|
|
|
|
- resets = <&infracfg_ao MT8195_INFRA_RST2_PCIE_P1_SWRST>;
|
|
- reset-names = "mac";
|
|
-
|
|
#interrupt-cells = <1>;
|
|
interrupt-map-mask = <0 0 0 7>;
|
|
interrupt-map = <0 0 0 1 &pcie_intc1 0>,
|
|
@@ -2680,7 +2677,7 @@ larb20: larb@1b010000 {
|
|
};
|
|
|
|
ovl0: ovl@1c000000 {
|
|
- compatible = "mediatek,mt8195-disp-ovl", "mediatek,mt8183-disp-ovl";
|
|
+ compatible = "mediatek,mt8195-disp-ovl";
|
|
reg = <0 0x1c000000 0 0x1000>;
|
|
interrupts = <GIC_SPI 636 IRQ_TYPE_LEVEL_HIGH 0>;
|
|
power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS0>;
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
|
|
index 413496c9206954..62c5b50d3c5fbe 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
|
|
@@ -334,7 +334,8 @@ pwrap: pwrap@1000d000 {
|
|
};
|
|
|
|
keypad: keypad@10010000 {
|
|
- compatible = "mediatek,mt6779-keypad";
|
|
+ compatible = "mediatek,mt8365-keypad",
|
|
+ "mediatek,mt6779-keypad";
|
|
reg = <0 0x10010000 0 0x1000>;
|
|
wakeup-source;
|
|
interrupts = <GIC_SPI 124 IRQ_TYPE_EDGE_FALLING>;
|
|
diff --git a/arch/arm64/boot/dts/mediatek/mt8516.dtsi b/arch/arm64/boot/dts/mediatek/mt8516.dtsi
|
|
index 9cbd6dd8f671aa..6b89505a64379f 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/mt8516.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/mt8516.dtsi
|
|
@@ -144,10 +144,10 @@ reserved-memory {
|
|
#size-cells = <2>;
|
|
ranges;
|
|
|
|
- /* 128 KiB reserved for ARM Trusted Firmware (BL31) */
|
|
+ /* 192 KiB reserved for ARM Trusted Firmware (BL31) */
|
|
bl31_secmon_reserved: secmon@43000000 {
|
|
no-map;
|
|
- reg = <0 0x43000000 0 0x20000>;
|
|
+ reg = <0 0x43000000 0 0x30000>;
|
|
};
|
|
};
|
|
|
|
@@ -206,7 +206,7 @@ watchdog@10007000 {
|
|
compatible = "mediatek,mt8516-wdt",
|
|
"mediatek,mt6589-wdt";
|
|
reg = <0 0x10007000 0 0x1000>;
|
|
- interrupts = <GIC_SPI 198 IRQ_TYPE_EDGE_FALLING>;
|
|
+ interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_LOW>;
|
|
#reset-cells = <1>;
|
|
};
|
|
|
|
@@ -268,7 +268,7 @@ gic: interrupt-controller@10310000 {
|
|
interrupt-parent = <&gic>;
|
|
interrupt-controller;
|
|
reg = <0 0x10310000 0 0x1000>,
|
|
- <0 0x10320000 0 0x1000>,
|
|
+ <0 0x1032f000 0 0x2000>,
|
|
<0 0x10340000 0 0x2000>,
|
|
<0 0x10360000 0 0x2000>;
|
|
interrupts = <GIC_PPI 9
|
|
@@ -344,6 +344,7 @@ i2c0: i2c@11009000 {
|
|
reg = <0 0x11009000 0 0x90>,
|
|
<0 0x11000180 0 0x80>;
|
|
interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_LOW>;
|
|
+ clock-div = <2>;
|
|
clocks = <&topckgen CLK_TOP_I2C0>,
|
|
<&topckgen CLK_TOP_APDMA>;
|
|
clock-names = "main", "dma";
|
|
@@ -358,6 +359,7 @@ i2c1: i2c@1100a000 {
|
|
reg = <0 0x1100a000 0 0x90>,
|
|
<0 0x11000200 0 0x80>;
|
|
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_LOW>;
|
|
+ clock-div = <2>;
|
|
clocks = <&topckgen CLK_TOP_I2C1>,
|
|
<&topckgen CLK_TOP_APDMA>;
|
|
clock-names = "main", "dma";
|
|
@@ -372,6 +374,7 @@ i2c2: i2c@1100b000 {
|
|
reg = <0 0x1100b000 0 0x90>,
|
|
<0 0x11000280 0 0x80>;
|
|
interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_LOW>;
|
|
+ clock-div = <2>;
|
|
clocks = <&topckgen CLK_TOP_I2C2>,
|
|
<&topckgen CLK_TOP_APDMA>;
|
|
clock-names = "main", "dma";
|
|
diff --git a/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi b/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi
|
|
index ec8dfb3d1c6d69..a356db5fcc5f3c 100644
|
|
--- a/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi
|
|
+++ b/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi
|
|
@@ -47,7 +47,6 @@ key-volume-down {
|
|
};
|
|
|
|
&i2c0 {
|
|
- clock-div = <2>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&i2c0_pins_a>;
|
|
status = "okay";
|
|
@@ -156,7 +155,6 @@ cam-pwdn-hog {
|
|
};
|
|
|
|
&i2c2 {
|
|
- clock-div = <2>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&i2c2_pins_a>;
|
|
status = "okay";
|
|
diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
|
|
index ac69eacf8a6ba9..be30072fb7471f 100644
|
|
--- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi
|
|
+++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
|
|
@@ -1794,7 +1794,7 @@ spi@c260000 {
|
|
assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLP_OUT0>;
|
|
resets = <&bpmp TEGRA234_RESET_SPI2>;
|
|
reset-names = "spi";
|
|
- dmas = <&gpcdma 19>, <&gpcdma 19>;
|
|
+ dmas = <&gpcdma 16>, <&gpcdma 16>;
|
|
dma-names = "rx", "tx";
|
|
dma-coherent;
|
|
status = "disabled";
|
|
diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
|
|
index 2cca20563a1d69..0da076db0418d8 100644
|
|
--- a/arch/arm64/boot/dts/qcom/Makefile
|
|
+++ b/arch/arm64/boot/dts/qcom/Makefile
|
|
@@ -171,6 +171,9 @@ dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r1.dtb
|
|
dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r2.dtb
|
|
dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r3.dtb
|
|
dtb-$(CONFIG_ARCH_QCOM) += sdm845-db845c.dtb
|
|
+
|
|
+sdm845-db845c-navigation-mezzanine-dtbs := sdm845-db845c.dtb sdm845-db845c-navigation-mezzanine.dtbo
|
|
+
|
|
dtb-$(CONFIG_ARCH_QCOM) += sdm845-db845c-navigation-mezzanine.dtb
|
|
dtb-$(CONFIG_ARCH_QCOM) += sdm845-lg-judyln.dtb
|
|
dtb-$(CONFIG_ARCH_QCOM) += sdm845-lg-judyp.dtb
|
|
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
|
|
index 961ceb83a91fae..6f5f96853ba1c2 100644
|
|
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
|
|
@@ -104,7 +104,7 @@ xo_board: xo-board {
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
#clock-cells = <0>;
|
|
- clock-frequency = <32768>;
|
|
+ clock-frequency = <32764>;
|
|
};
|
|
};
|
|
|
|
diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi b/arch/arm64/boot/dts/qcom/msm8939.dtsi
|
|
index 3fd64cafe99c5f..c844e01f9aa15b 100644
|
|
--- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
|
|
@@ -33,7 +33,7 @@ xo_board: xo-board {
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
#clock-cells = <0>;
|
|
- clock-frequency = <32768>;
|
|
+ clock-frequency = <32764>;
|
|
};
|
|
};
|
|
|
|
diff --git a/arch/arm64/boot/dts/qcom/msm8994.dtsi b/arch/arm64/boot/dts/qcom/msm8994.dtsi
|
|
index c3262571520d3e..a7f9259dda6de3 100644
|
|
--- a/arch/arm64/boot/dts/qcom/msm8994.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/msm8994.dtsi
|
|
@@ -34,7 +34,7 @@ xo_board: xo-board {
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
#clock-cells = <0>;
|
|
- clock-frequency = <32768>;
|
|
+ clock-frequency = <32764>;
|
|
clock-output-names = "sleep_clk";
|
|
};
|
|
};
|
|
@@ -437,6 +437,15 @@ usb3: usb@f92f8800 {
|
|
#size-cells = <1>;
|
|
ranges;
|
|
|
|
+ interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ interrupt-names = "pwr_event",
|
|
+ "qusb2_phy",
|
|
+ "hs_phy_irq",
|
|
+ "ss_phy_irq";
|
|
+
|
|
clocks = <&gcc GCC_USB30_MASTER_CLK>,
|
|
<&gcc GCC_SYS_NOC_USB3_AXI_CLK>,
|
|
<&gcc GCC_USB30_SLEEP_CLK>,
|
|
diff --git a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
|
|
index f8e9d90afab000..dbad8f57f2fa34 100644
|
|
--- a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
|
|
+++ b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
|
|
@@ -64,7 +64,7 @@ led@0 {
|
|
};
|
|
|
|
led@1 {
|
|
- reg = <0>;
|
|
+ reg = <1>;
|
|
chan-name = "button-backlight1";
|
|
led-cur = /bits/ 8 <0x32>;
|
|
max-cur = /bits/ 8 <0xc8>;
|
|
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
|
|
index 1f7cbb35886db5..70ef8c83e7b9f3 100644
|
|
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
|
|
@@ -3046,9 +3046,14 @@ usb3: usb@6af8800 {
|
|
#size-cells = <1>;
|
|
ranges;
|
|
|
|
- interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>,
|
|
<GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>;
|
|
- interrupt-names = "hs_phy_irq", "ss_phy_irq";
|
|
+ interrupt-names = "pwr_event",
|
|
+ "qusb2_phy",
|
|
+ "hs_phy_irq",
|
|
+ "ss_phy_irq";
|
|
|
|
clocks = <&gcc GCC_SYS_NOC_USB3_AXI_CLK>,
|
|
<&gcc GCC_USB30_MASTER_CLK>,
|
|
diff --git a/arch/arm64/boot/dts/qcom/pm6150.dtsi b/arch/arm64/boot/dts/qcom/pm6150.dtsi
|
|
index 7d4d1f2767ed6a..7ae14c53ca8fb3 100644
|
|
--- a/arch/arm64/boot/dts/qcom/pm6150.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/pm6150.dtsi
|
|
@@ -13,7 +13,7 @@ / {
|
|
thermal-zones {
|
|
pm6150_thermal: pm6150-thermal {
|
|
polling-delay-passive = <100>;
|
|
- polling-delay = <0>;
|
|
+
|
|
thermal-sensors = <&pm6150_temp>;
|
|
|
|
trips {
|
|
diff --git a/arch/arm64/boot/dts/qcom/pm6150l.dtsi b/arch/arm64/boot/dts/qcom/pm6150l.dtsi
|
|
index d13a1ab7c20b34..a20e9b9993b28f 100644
|
|
--- a/arch/arm64/boot/dts/qcom/pm6150l.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/pm6150l.dtsi
|
|
@@ -10,9 +10,6 @@
|
|
/ {
|
|
thermal-zones {
|
|
pm6150l-thermal {
|
|
- polling-delay-passive = <0>;
|
|
- polling-delay = <0>;
|
|
-
|
|
thermal-sensors = <&pm6150l_temp>;
|
|
|
|
trips {
|
|
diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi
|
|
index 2721f32dfb7104..cbe469cc159e92 100644
|
|
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
|
|
@@ -28,7 +28,7 @@ xo_board: xo-board {
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
#clock-cells = <0>;
|
|
- clock-frequency = <32768>;
|
|
+ clock-frequency = <32764>;
|
|
};
|
|
};
|
|
|
|
diff --git a/arch/arm64/boot/dts/qcom/qdu1000-idp.dts b/arch/arm64/boot/dts/qcom/qdu1000-idp.dts
|
|
index 5a25cdec969eb1..409f06978931af 100644
|
|
--- a/arch/arm64/boot/dts/qcom/qdu1000-idp.dts
|
|
+++ b/arch/arm64/boot/dts/qcom/qdu1000-idp.dts
|
|
@@ -31,7 +31,7 @@ xo_board: xo-board-clk {
|
|
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
#clock-cells = <0>;
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
|
|
index 5def8c1154ceb3..331b6a76560db4 100644
|
|
--- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
|
|
+++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
|
|
@@ -492,7 +492,7 @@ can@0 {
|
|
};
|
|
|
|
&sleep_clk {
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
};
|
|
|
|
&tlmm {
|
|
diff --git a/arch/arm64/boot/dts/qcom/qru1000-idp.dts b/arch/arm64/boot/dts/qcom/qru1000-idp.dts
|
|
index 2a862c83309e70..a3a7dcbc5e6d29 100644
|
|
--- a/arch/arm64/boot/dts/qcom/qru1000-idp.dts
|
|
+++ b/arch/arm64/boot/dts/qcom/qru1000-idp.dts
|
|
@@ -31,7 +31,7 @@ xo_board: xo-board-clk {
|
|
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
#clock-cells = <0>;
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts
|
|
index 81a7eeb9cfcd27..2e87fd760dbdde 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts
|
|
+++ b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts
|
|
@@ -5,828 +5,43 @@
|
|
|
|
/dts-v1/;
|
|
|
|
-#include <dt-bindings/gpio/gpio.h>
|
|
-#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
|
|
-
|
|
-#include "sa8775p.dtsi"
|
|
-#include "sa8775p-pmics.dtsi"
|
|
+#include "sa8775p-ride.dtsi"
|
|
|
|
/ {
|
|
model = "Qualcomm SA8775P Ride";
|
|
compatible = "qcom,sa8775p-ride", "qcom,sa8775p";
|
|
-
|
|
- aliases {
|
|
- ethernet0 = ðernet0;
|
|
- ethernet1 = ðernet1;
|
|
- i2c11 = &i2c11;
|
|
- i2c18 = &i2c18;
|
|
- serial0 = &uart10;
|
|
- serial1 = &uart12;
|
|
- serial2 = &uart17;
|
|
- spi16 = &spi16;
|
|
- ufshc1 = &ufs_mem_hc;
|
|
- };
|
|
-
|
|
- chosen {
|
|
- stdout-path = "serial0:115200n8";
|
|
- };
|
|
-};
|
|
-
|
|
-&apps_rsc {
|
|
- regulators-0 {
|
|
- compatible = "qcom,pmm8654au-rpmh-regulators";
|
|
- qcom,pmic-id = "a";
|
|
-
|
|
- vreg_s4a: smps4 {
|
|
- regulator-name = "vreg_s4a";
|
|
- regulator-min-microvolt = <1800000>;
|
|
- regulator-max-microvolt = <1816000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_s5a: smps5 {
|
|
- regulator-name = "vreg_s5a";
|
|
- regulator-min-microvolt = <1850000>;
|
|
- regulator-max-microvolt = <1996000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_s9a: smps9 {
|
|
- regulator-name = "vreg_s9a";
|
|
- regulator-min-microvolt = <535000>;
|
|
- regulator-max-microvolt = <1120000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l4a: ldo4 {
|
|
- regulator-name = "vreg_l4a";
|
|
- regulator-min-microvolt = <788000>;
|
|
- regulator-max-microvolt = <1050000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l5a: ldo5 {
|
|
- regulator-name = "vreg_l5a";
|
|
- regulator-min-microvolt = <870000>;
|
|
- regulator-max-microvolt = <950000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l6a: ldo6 {
|
|
- regulator-name = "vreg_l6a";
|
|
- regulator-min-microvolt = <870000>;
|
|
- regulator-max-microvolt = <970000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l7a: ldo7 {
|
|
- regulator-name = "vreg_l7a";
|
|
- regulator-min-microvolt = <720000>;
|
|
- regulator-max-microvolt = <950000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l8a: ldo8 {
|
|
- regulator-name = "vreg_l8a";
|
|
- regulator-min-microvolt = <2504000>;
|
|
- regulator-max-microvolt = <3300000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l9a: ldo9 {
|
|
- regulator-name = "vreg_l9a";
|
|
- regulator-min-microvolt = <2970000>;
|
|
- regulator-max-microvolt = <3544000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
- };
|
|
-
|
|
- regulators-1 {
|
|
- compatible = "qcom,pmm8654au-rpmh-regulators";
|
|
- qcom,pmic-id = "c";
|
|
-
|
|
- vreg_l1c: ldo1 {
|
|
- regulator-name = "vreg_l1c";
|
|
- regulator-min-microvolt = <1140000>;
|
|
- regulator-max-microvolt = <1260000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l2c: ldo2 {
|
|
- regulator-name = "vreg_l2c";
|
|
- regulator-min-microvolt = <900000>;
|
|
- regulator-max-microvolt = <1100000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l3c: ldo3 {
|
|
- regulator-name = "vreg_l3c";
|
|
- regulator-min-microvolt = <1100000>;
|
|
- regulator-max-microvolt = <1300000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l4c: ldo4 {
|
|
- regulator-name = "vreg_l4c";
|
|
- regulator-min-microvolt = <1200000>;
|
|
- regulator-max-microvolt = <1200000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- /*
|
|
- * FIXME: This should have regulator-allow-set-load but
|
|
- * we're getting an over-current fault from the PMIC
|
|
- * when switching to LPM.
|
|
- */
|
|
- };
|
|
-
|
|
- vreg_l5c: ldo5 {
|
|
- regulator-name = "vreg_l5c";
|
|
- regulator-min-microvolt = <1100000>;
|
|
- regulator-max-microvolt = <1300000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l6c: ldo6 {
|
|
- regulator-name = "vreg_l6c";
|
|
- regulator-min-microvolt = <1620000>;
|
|
- regulator-max-microvolt = <1980000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l7c: ldo7 {
|
|
- regulator-name = "vreg_l7c";
|
|
- regulator-min-microvolt = <1620000>;
|
|
- regulator-max-microvolt = <2000000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l8c: ldo8 {
|
|
- regulator-name = "vreg_l8c";
|
|
- regulator-min-microvolt = <2400000>;
|
|
- regulator-max-microvolt = <3300000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l9c: ldo9 {
|
|
- regulator-name = "vreg_l9c";
|
|
- regulator-min-microvolt = <1650000>;
|
|
- regulator-max-microvolt = <2700000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
- };
|
|
-
|
|
- regulators-2 {
|
|
- compatible = "qcom,pmm8654au-rpmh-regulators";
|
|
- qcom,pmic-id = "e";
|
|
-
|
|
- vreg_s4e: smps4 {
|
|
- regulator-name = "vreg_s4e";
|
|
- regulator-min-microvolt = <970000>;
|
|
- regulator-max-microvolt = <1520000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_s7e: smps7 {
|
|
- regulator-name = "vreg_s7e";
|
|
- regulator-min-microvolt = <1010000>;
|
|
- regulator-max-microvolt = <1170000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_s9e: smps9 {
|
|
- regulator-name = "vreg_s9e";
|
|
- regulator-min-microvolt = <300000>;
|
|
- regulator-max-microvolt = <570000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l6e: ldo6 {
|
|
- regulator-name = "vreg_l6e";
|
|
- regulator-min-microvolt = <1280000>;
|
|
- regulator-max-microvolt = <1450000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
-
|
|
- vreg_l8e: ldo8 {
|
|
- regulator-name = "vreg_l8e";
|
|
- regulator-min-microvolt = <1800000>;
|
|
- regulator-max-microvolt = <1950000>;
|
|
- regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
- regulator-allow-set-load;
|
|
- regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
- RPMH_REGULATOR_MODE_HPM>;
|
|
- };
|
|
- };
|
|
};
|
|
|
|
ðernet0 {
|
|
phy-mode = "sgmii";
|
|
- phy-handle = <&sgmii_phy0>;
|
|
-
|
|
- pinctrl-0 = <ðernet0_default>;
|
|
- pinctrl-names = "default";
|
|
-
|
|
- snps,mtl-rx-config = <&mtl_rx_setup>;
|
|
- snps,mtl-tx-config = <&mtl_tx_setup>;
|
|
- snps,ps-speed = <1000>;
|
|
-
|
|
- status = "okay";
|
|
-
|
|
- mdio {
|
|
- compatible = "snps,dwmac-mdio";
|
|
- #address-cells = <1>;
|
|
- #size-cells = <0>;
|
|
-
|
|
- sgmii_phy0: phy@8 {
|
|
- compatible = "ethernet-phy-id0141.0dd4";
|
|
- reg = <0x8>;
|
|
- device_type = "ethernet-phy";
|
|
- reset-gpios = <&pmm8654au_2_gpios 8 GPIO_ACTIVE_LOW>;
|
|
- reset-assert-us = <11000>;
|
|
- reset-deassert-us = <70000>;
|
|
- };
|
|
-
|
|
- sgmii_phy1: phy@a {
|
|
- compatible = "ethernet-phy-id0141.0dd4";
|
|
- reg = <0xa>;
|
|
- device_type = "ethernet-phy";
|
|
- reset-gpios = <&pmm8654au_2_gpios 9 GPIO_ACTIVE_LOW>;
|
|
- reset-assert-us = <11000>;
|
|
- reset-deassert-us = <70000>;
|
|
- };
|
|
- };
|
|
-
|
|
- mtl_rx_setup: rx-queues-config {
|
|
- snps,rx-queues-to-use = <4>;
|
|
- snps,rx-sched-sp;
|
|
-
|
|
- queue0 {
|
|
- snps,dcb-algorithm;
|
|
- snps,map-to-dma-channel = <0x0>;
|
|
- snps,route-up;
|
|
- snps,priority = <0x1>;
|
|
- };
|
|
-
|
|
- queue1 {
|
|
- snps,dcb-algorithm;
|
|
- snps,map-to-dma-channel = <0x1>;
|
|
- snps,route-ptp;
|
|
- };
|
|
-
|
|
- queue2 {
|
|
- snps,avb-algorithm;
|
|
- snps,map-to-dma-channel = <0x2>;
|
|
- snps,route-avcp;
|
|
- };
|
|
-
|
|
- queue3 {
|
|
- snps,avb-algorithm;
|
|
- snps,map-to-dma-channel = <0x3>;
|
|
- snps,priority = <0xc>;
|
|
- };
|
|
- };
|
|
-
|
|
- mtl_tx_setup: tx-queues-config {
|
|
- snps,tx-queues-to-use = <4>;
|
|
- snps,tx-sched-sp;
|
|
-
|
|
- queue0 {
|
|
- snps,dcb-algorithm;
|
|
- };
|
|
-
|
|
- queue1 {
|
|
- snps,dcb-algorithm;
|
|
- };
|
|
-
|
|
- queue2 {
|
|
- snps,avb-algorithm;
|
|
- snps,send_slope = <0x1000>;
|
|
- snps,idle_slope = <0x1000>;
|
|
- snps,high_credit = <0x3e800>;
|
|
- snps,low_credit = <0xffc18000>;
|
|
- };
|
|
-
|
|
- queue3 {
|
|
- snps,avb-algorithm;
|
|
- snps,send_slope = <0x1000>;
|
|
- snps,idle_slope = <0x1000>;
|
|
- snps,high_credit = <0x3e800>;
|
|
- snps,low_credit = <0xffc18000>;
|
|
- };
|
|
- };
|
|
};
|
|
|
|
ðernet1 {
|
|
phy-mode = "sgmii";
|
|
- phy-handle = <&sgmii_phy1>;
|
|
-
|
|
- snps,mtl-rx-config = <&mtl_rx_setup1>;
|
|
- snps,mtl-tx-config = <&mtl_tx_setup1>;
|
|
- snps,ps-speed = <1000>;
|
|
-
|
|
- status = "okay";
|
|
-
|
|
- mtl_rx_setup1: rx-queues-config {
|
|
- snps,rx-queues-to-use = <4>;
|
|
- snps,rx-sched-sp;
|
|
-
|
|
- queue0 {
|
|
- snps,dcb-algorithm;
|
|
- snps,map-to-dma-channel = <0x0>;
|
|
- snps,route-up;
|
|
- snps,priority = <0x1>;
|
|
- };
|
|
-
|
|
- queue1 {
|
|
- snps,dcb-algorithm;
|
|
- snps,map-to-dma-channel = <0x1>;
|
|
- snps,route-ptp;
|
|
- };
|
|
-
|
|
- queue2 {
|
|
- snps,avb-algorithm;
|
|
- snps,map-to-dma-channel = <0x2>;
|
|
- snps,route-avcp;
|
|
- };
|
|
-
|
|
- queue3 {
|
|
- snps,avb-algorithm;
|
|
- snps,map-to-dma-channel = <0x3>;
|
|
- snps,priority = <0xc>;
|
|
- };
|
|
- };
|
|
-
|
|
- mtl_tx_setup1: tx-queues-config {
|
|
- snps,tx-queues-to-use = <4>;
|
|
- snps,tx-sched-sp;
|
|
-
|
|
- queue0 {
|
|
- snps,dcb-algorithm;
|
|
- };
|
|
-
|
|
- queue1 {
|
|
- snps,dcb-algorithm;
|
|
- };
|
|
-
|
|
- queue2 {
|
|
- snps,avb-algorithm;
|
|
- snps,send_slope = <0x1000>;
|
|
- snps,idle_slope = <0x1000>;
|
|
- snps,high_credit = <0x3e800>;
|
|
- snps,low_credit = <0xffc18000>;
|
|
- };
|
|
-
|
|
- queue3 {
|
|
- snps,avb-algorithm;
|
|
- snps,send_slope = <0x1000>;
|
|
- snps,idle_slope = <0x1000>;
|
|
- snps,high_credit = <0x3e800>;
|
|
- snps,low_credit = <0xffc18000>;
|
|
- };
|
|
- };
|
|
-};
|
|
-
|
|
-&i2c11 {
|
|
- clock-frequency = <400000>;
|
|
- pinctrl-0 = <&qup_i2c11_default>;
|
|
- pinctrl-names = "default";
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&i2c18 {
|
|
- clock-frequency = <400000>;
|
|
- pinctrl-0 = <&qup_i2c18_default>;
|
|
- pinctrl-names = "default";
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&pmm8654au_0_gpios {
|
|
- gpio-line-names = "DS_EN",
|
|
- "POFF_COMPLETE",
|
|
- "UFS0_VER_ID",
|
|
- "FAST_POFF",
|
|
- "DBU1_PON_DONE",
|
|
- "AOSS_SLEEP",
|
|
- "CAM_DES0_EN",
|
|
- "CAM_DES1_EN",
|
|
- "CAM_DES2_EN",
|
|
- "CAM_DES3_EN",
|
|
- "UEFI",
|
|
- "ANALOG_PON_OPT";
|
|
-};
|
|
-
|
|
-&pmm8654au_1_gpios {
|
|
- gpio-line-names = "PMIC_C_ID0",
|
|
- "PMIC_C_ID1",
|
|
- "UFS1_VER_ID",
|
|
- "IPA_PWR",
|
|
- "",
|
|
- "WLAN_DBU4_EN",
|
|
- "WLAN_EN",
|
|
- "BT_EN",
|
|
- "USB2_PWR_EN",
|
|
- "USB2_FAULT";
|
|
-
|
|
- usb2_en_state: usb2-en-state {
|
|
- pins = "gpio9";
|
|
- function = "normal";
|
|
- output-high;
|
|
- power-source = <0>;
|
|
- };
|
|
-};
|
|
-
|
|
-&pmm8654au_2_gpios {
|
|
- gpio-line-names = "PMIC_E_ID0",
|
|
- "PMIC_E_ID1",
|
|
- "USB0_PWR_EN",
|
|
- "USB0_FAULT",
|
|
- "SENSOR_IRQ_1",
|
|
- "SENSOR_IRQ_2",
|
|
- "SENSOR_RST",
|
|
- "SGMIIO0_RST",
|
|
- "SGMIIO1_RST",
|
|
- "USB1_PWR_ENABLE",
|
|
- "USB1_FAULT",
|
|
- "VMON_SPX8";
|
|
-
|
|
- usb0_en_state: usb0-en-state {
|
|
- pins = "gpio3";
|
|
- function = "normal";
|
|
- output-high;
|
|
- power-source = <0>;
|
|
- };
|
|
-
|
|
- usb1_en_state: usb1-en-state {
|
|
- pins = "gpio10";
|
|
- function = "normal";
|
|
- output-high;
|
|
- power-source = <0>;
|
|
- };
|
|
-};
|
|
-
|
|
-&pmm8654au_3_gpios {
|
|
- gpio-line-names = "PMIC_G_ID0",
|
|
- "PMIC_G_ID1",
|
|
- "GNSS_RST",
|
|
- "GNSS_EN",
|
|
- "GNSS_BOOT_MODE";
|
|
-};
|
|
-
|
|
-&qupv3_id_1 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&qupv3_id_2 {
|
|
- status = "okay";
|
|
};
|
|
|
|
-&serdes0 {
|
|
- phy-supply = <&vreg_l5a>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&serdes1 {
|
|
- phy-supply = <&vreg_l5a>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&sleep_clk {
|
|
- clock-frequency = <32764>;
|
|
-};
|
|
-
|
|
-&spi16 {
|
|
- pinctrl-0 = <&qup_spi16_default>;
|
|
- pinctrl-names = "default";
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&tlmm {
|
|
- ethernet0_default: ethernet0-default-state {
|
|
- ethernet0_mdc: ethernet0-mdc-pins {
|
|
- pins = "gpio8";
|
|
- function = "emac0_mdc";
|
|
- drive-strength = <16>;
|
|
- bias-pull-up;
|
|
- };
|
|
-
|
|
- ethernet0_mdio: ethernet0-mdio-pins {
|
|
- pins = "gpio9";
|
|
- function = "emac0_mdio";
|
|
- drive-strength = <16>;
|
|
- bias-pull-up;
|
|
- };
|
|
- };
|
|
-
|
|
- qup_uart10_default: qup-uart10-state {
|
|
- pins = "gpio46", "gpio47";
|
|
- function = "qup1_se3";
|
|
- };
|
|
+&mdio {
|
|
+ compatible = "snps,dwmac-mdio";
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
|
|
- qup_spi16_default: qup-spi16-state {
|
|
- pins = "gpio86", "gpio87", "gpio88", "gpio89";
|
|
- function = "qup2_se2";
|
|
- drive-strength = <6>;
|
|
- bias-disable;
|
|
+ sgmii_phy0: phy@8 {
|
|
+ compatible = "ethernet-phy-id0141.0dd4";
|
|
+ reg = <0x8>;
|
|
+ device_type = "ethernet-phy";
|
|
+ interrupts-extended = <&tlmm 7 IRQ_TYPE_EDGE_FALLING>;
|
|
+ reset-gpios = <&pmm8654au_2_gpios 8 GPIO_ACTIVE_LOW>;
|
|
+ reset-assert-us = <11000>;
|
|
+ reset-deassert-us = <70000>;
|
|
};
|
|
|
|
- qup_i2c11_default: qup-i2c11-state {
|
|
- pins = "gpio48", "gpio49";
|
|
- function = "qup1_se4";
|
|
- drive-strength = <2>;
|
|
- bias-pull-up;
|
|
+ sgmii_phy1: phy@a {
|
|
+ compatible = "ethernet-phy-id0141.0dd4";
|
|
+ reg = <0xa>;
|
|
+ device_type = "ethernet-phy";
|
|
+ interrupts-extended = <&tlmm 26 IRQ_TYPE_EDGE_FALLING>;
|
|
+ reset-gpios = <&pmm8654au_2_gpios 9 GPIO_ACTIVE_LOW>;
|
|
+ reset-assert-us = <11000>;
|
|
+ reset-deassert-us = <70000>;
|
|
};
|
|
-
|
|
- qup_i2c18_default: qup-i2c18-state {
|
|
- pins = "gpio95", "gpio96";
|
|
- function = "qup2_se4";
|
|
- drive-strength = <2>;
|
|
- bias-pull-up;
|
|
- };
|
|
-
|
|
- qup_uart12_default: qup-uart12-state {
|
|
- qup_uart12_cts: qup-uart12-cts-pins {
|
|
- pins = "gpio52";
|
|
- function = "qup1_se5";
|
|
- bias-disable;
|
|
- };
|
|
-
|
|
- qup_uart12_rts: qup-uart12-rts-pins {
|
|
- pins = "gpio53";
|
|
- function = "qup1_se5";
|
|
- bias-pull-down;
|
|
- };
|
|
-
|
|
- qup_uart12_tx: qup-uart12-tx-pins {
|
|
- pins = "gpio54";
|
|
- function = "qup1_se5";
|
|
- bias-pull-up;
|
|
- };
|
|
-
|
|
- qup_uart12_rx: qup-uart12-rx-pins {
|
|
- pins = "gpio55";
|
|
- function = "qup1_se5";
|
|
- bias-pull-down;
|
|
- };
|
|
- };
|
|
-
|
|
- qup_uart17_default: qup-uart17-state {
|
|
- qup_uart17_cts: qup-uart17-cts-pins {
|
|
- pins = "gpio91";
|
|
- function = "qup2_se3";
|
|
- bias-disable;
|
|
- };
|
|
-
|
|
- qup_uart17_rts: qup0-uart17-rts-pins {
|
|
- pins = "gpio92";
|
|
- function = "qup2_se3";
|
|
- bias-pull-down;
|
|
- };
|
|
-
|
|
- qup_uart17_tx: qup0-uart17-tx-pins {
|
|
- pins = "gpio93";
|
|
- function = "qup2_se3";
|
|
- bias-pull-up;
|
|
- };
|
|
-
|
|
- qup_uart17_rx: qup0-uart17-rx-pins {
|
|
- pins = "gpio94";
|
|
- function = "qup2_se3";
|
|
- bias-pull-down;
|
|
- };
|
|
- };
|
|
-
|
|
- pcie0_default_state: pcie0-default-state {
|
|
- perst-pins {
|
|
- pins = "gpio2";
|
|
- function = "gpio";
|
|
- drive-strength = <2>;
|
|
- bias-pull-down;
|
|
- };
|
|
-
|
|
- clkreq-pins {
|
|
- pins = "gpio1";
|
|
- function = "pcie0_clkreq";
|
|
- drive-strength = <2>;
|
|
- bias-pull-up;
|
|
- };
|
|
-
|
|
- wake-pins {
|
|
- pins = "gpio0";
|
|
- function = "gpio";
|
|
- drive-strength = <2>;
|
|
- bias-pull-up;
|
|
- };
|
|
- };
|
|
-
|
|
- pcie1_default_state: pcie1-default-state {
|
|
- perst-pins {
|
|
- pins = "gpio4";
|
|
- function = "gpio";
|
|
- drive-strength = <2>;
|
|
- bias-pull-down;
|
|
- };
|
|
-
|
|
- clkreq-pins {
|
|
- pins = "gpio3";
|
|
- function = "pcie1_clkreq";
|
|
- drive-strength = <2>;
|
|
- bias-pull-up;
|
|
- };
|
|
-
|
|
- wake-pins {
|
|
- pins = "gpio5";
|
|
- function = "gpio";
|
|
- drive-strength = <2>;
|
|
- bias-pull-up;
|
|
- };
|
|
- };
|
|
-};
|
|
-
|
|
-&pcie0 {
|
|
- perst-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
|
|
- wake-gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
|
|
-
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&pcie0_default_state>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&pcie1 {
|
|
- perst-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
|
|
- wake-gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>;
|
|
-
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&pcie1_default_state>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&pcie0_phy {
|
|
- vdda-phy-supply = <&vreg_l5a>;
|
|
- vdda-pll-supply = <&vreg_l1c>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&pcie1_phy {
|
|
- vdda-phy-supply = <&vreg_l5a>;
|
|
- vdda-pll-supply = <&vreg_l1c>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&uart10 {
|
|
- compatible = "qcom,geni-debug-uart";
|
|
- pinctrl-0 = <&qup_uart10_default>;
|
|
- pinctrl-names = "default";
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&uart12 {
|
|
- pinctrl-0 = <&qup_uart12_default>;
|
|
- pinctrl-names = "default";
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&uart17 {
|
|
- pinctrl-0 = <&qup_uart17_default>;
|
|
- pinctrl-names = "default";
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&ufs_mem_hc {
|
|
- reset-gpios = <&tlmm 149 GPIO_ACTIVE_LOW>;
|
|
- vcc-supply = <&vreg_l8a>;
|
|
- vcc-max-microamp = <1100000>;
|
|
- vccq-supply = <&vreg_l4c>;
|
|
- vccq-max-microamp = <1200000>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&ufs_mem_phy {
|
|
- vdda-phy-supply = <&vreg_l4a>;
|
|
- vdda-pll-supply = <&vreg_l1c>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_0 {
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&usb0_en_state>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_0_dwc3 {
|
|
- dr_mode = "peripheral";
|
|
-};
|
|
-
|
|
-&usb_0_hsphy {
|
|
- vdda-pll-supply = <&vreg_l7a>;
|
|
- vdda18-supply = <&vreg_l6c>;
|
|
- vdda33-supply = <&vreg_l9a>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_0_qmpphy {
|
|
- vdda-phy-supply = <&vreg_l1c>;
|
|
- vdda-pll-supply = <&vreg_l7a>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_1 {
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&usb1_en_state>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_1_dwc3 {
|
|
- dr_mode = "host";
|
|
-};
|
|
-
|
|
-&usb_1_hsphy {
|
|
- vdda-pll-supply = <&vreg_l7a>;
|
|
- vdda18-supply = <&vreg_l6c>;
|
|
- vdda33-supply = <&vreg_l9a>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_1_qmpphy {
|
|
- vdda-phy-supply = <&vreg_l1c>;
|
|
- vdda-pll-supply = <&vreg_l7a>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_2 {
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&usb2_en_state>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_2_dwc3 {
|
|
- dr_mode = "host";
|
|
-};
|
|
-
|
|
-&usb_2_hsphy {
|
|
- vdda-pll-supply = <&vreg_l7a>;
|
|
- vdda18-supply = <&vreg_l6c>;
|
|
- vdda33-supply = <&vreg_l9a>;
|
|
-
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&xo_board_clk {
|
|
- clock-frequency = <38400000>;
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi b/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi
|
|
new file mode 100644
|
|
index 00000000000000..864ad109371ca7
|
|
--- /dev/null
|
|
+++ b/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi
|
|
@@ -0,0 +1,814 @@
|
|
+// SPDX-License-Identifier: BSD-3-Clause
|
|
+/*
|
|
+ * Copyright (c) 2023, Linaro Limited
|
|
+ */
|
|
+
|
|
+/dts-v1/;
|
|
+
|
|
+#include <dt-bindings/gpio/gpio.h>
|
|
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
|
|
+
|
|
+#include "sa8775p.dtsi"
|
|
+#include "sa8775p-pmics.dtsi"
|
|
+
|
|
+/ {
|
|
+ aliases {
|
|
+ ethernet0 = ðernet0;
|
|
+ ethernet1 = ðernet1;
|
|
+ i2c11 = &i2c11;
|
|
+ i2c18 = &i2c18;
|
|
+ serial0 = &uart10;
|
|
+ serial1 = &uart12;
|
|
+ serial2 = &uart17;
|
|
+ spi16 = &spi16;
|
|
+ ufshc1 = &ufs_mem_hc;
|
|
+ };
|
|
+
|
|
+ chosen {
|
|
+ stdout-path = "serial0:115200n8";
|
|
+ };
|
|
+};
|
|
+
|
|
+&apps_rsc {
|
|
+ regulators-0 {
|
|
+ compatible = "qcom,pmm8654au-rpmh-regulators";
|
|
+ qcom,pmic-id = "a";
|
|
+
|
|
+ vreg_s4a: smps4 {
|
|
+ regulator-name = "vreg_s4a";
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1816000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_s5a: smps5 {
|
|
+ regulator-name = "vreg_s5a";
|
|
+ regulator-min-microvolt = <1850000>;
|
|
+ regulator-max-microvolt = <1996000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_s9a: smps9 {
|
|
+ regulator-name = "vreg_s9a";
|
|
+ regulator-min-microvolt = <535000>;
|
|
+ regulator-max-microvolt = <1120000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l4a: ldo4 {
|
|
+ regulator-name = "vreg_l4a";
|
|
+ regulator-min-microvolt = <788000>;
|
|
+ regulator-max-microvolt = <1050000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l5a: ldo5 {
|
|
+ regulator-name = "vreg_l5a";
|
|
+ regulator-min-microvolt = <870000>;
|
|
+ regulator-max-microvolt = <950000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l6a: ldo6 {
|
|
+ regulator-name = "vreg_l6a";
|
|
+ regulator-min-microvolt = <870000>;
|
|
+ regulator-max-microvolt = <970000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l7a: ldo7 {
|
|
+ regulator-name = "vreg_l7a";
|
|
+ regulator-min-microvolt = <720000>;
|
|
+ regulator-max-microvolt = <950000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l8a: ldo8 {
|
|
+ regulator-name = "vreg_l8a";
|
|
+ regulator-min-microvolt = <2504000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l9a: ldo9 {
|
|
+ regulator-name = "vreg_l9a";
|
|
+ regulator-min-microvolt = <2970000>;
|
|
+ regulator-max-microvolt = <3544000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ regulators-1 {
|
|
+ compatible = "qcom,pmm8654au-rpmh-regulators";
|
|
+ qcom,pmic-id = "c";
|
|
+
|
|
+ vreg_l1c: ldo1 {
|
|
+ regulator-name = "vreg_l1c";
|
|
+ regulator-min-microvolt = <1140000>;
|
|
+ regulator-max-microvolt = <1260000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l2c: ldo2 {
|
|
+ regulator-name = "vreg_l2c";
|
|
+ regulator-min-microvolt = <900000>;
|
|
+ regulator-max-microvolt = <1100000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l3c: ldo3 {
|
|
+ regulator-name = "vreg_l3c";
|
|
+ regulator-min-microvolt = <1100000>;
|
|
+ regulator-max-microvolt = <1300000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l4c: ldo4 {
|
|
+ regulator-name = "vreg_l4c";
|
|
+ regulator-min-microvolt = <1200000>;
|
|
+ regulator-max-microvolt = <1200000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ /*
|
|
+ * FIXME: This should have regulator-allow-set-load but
|
|
+ * we're getting an over-current fault from the PMIC
|
|
+ * when switching to LPM.
|
|
+ */
|
|
+ };
|
|
+
|
|
+ vreg_l5c: ldo5 {
|
|
+ regulator-name = "vreg_l5c";
|
|
+ regulator-min-microvolt = <1100000>;
|
|
+ regulator-max-microvolt = <1300000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l6c: ldo6 {
|
|
+ regulator-name = "vreg_l6c";
|
|
+ regulator-min-microvolt = <1620000>;
|
|
+ regulator-max-microvolt = <1980000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l7c: ldo7 {
|
|
+ regulator-name = "vreg_l7c";
|
|
+ regulator-min-microvolt = <1620000>;
|
|
+ regulator-max-microvolt = <2000000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l8c: ldo8 {
|
|
+ regulator-name = "vreg_l8c";
|
|
+ regulator-min-microvolt = <2400000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l9c: ldo9 {
|
|
+ regulator-name = "vreg_l9c";
|
|
+ regulator-min-microvolt = <1650000>;
|
|
+ regulator-max-microvolt = <2700000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ regulators-2 {
|
|
+ compatible = "qcom,pmm8654au-rpmh-regulators";
|
|
+ qcom,pmic-id = "e";
|
|
+
|
|
+ vreg_s4e: smps4 {
|
|
+ regulator-name = "vreg_s4e";
|
|
+ regulator-min-microvolt = <970000>;
|
|
+ regulator-max-microvolt = <1520000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_s7e: smps7 {
|
|
+ regulator-name = "vreg_s7e";
|
|
+ regulator-min-microvolt = <1010000>;
|
|
+ regulator-max-microvolt = <1170000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_s9e: smps9 {
|
|
+ regulator-name = "vreg_s9e";
|
|
+ regulator-min-microvolt = <300000>;
|
|
+ regulator-max-microvolt = <570000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l6e: ldo6 {
|
|
+ regulator-name = "vreg_l6e";
|
|
+ regulator-min-microvolt = <1280000>;
|
|
+ regulator-max-microvolt = <1450000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+
|
|
+ vreg_l8e: ldo8 {
|
|
+ regulator-name = "vreg_l8e";
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1950000>;
|
|
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
|
+ regulator-allow-set-load;
|
|
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
|
|
+ RPMH_REGULATOR_MODE_HPM>;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+ðernet0 {
|
|
+ phy-handle = <&sgmii_phy0>;
|
|
+
|
|
+ pinctrl-0 = <ðernet0_default>;
|
|
+ pinctrl-names = "default";
|
|
+
|
|
+ snps,mtl-rx-config = <&mtl_rx_setup>;
|
|
+ snps,mtl-tx-config = <&mtl_tx_setup>;
|
|
+ snps,ps-speed = <1000>;
|
|
+
|
|
+ status = "okay";
|
|
+
|
|
+ mdio: mdio {
|
|
+ compatible = "snps,dwmac-mdio";
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+ };
|
|
+
|
|
+ mtl_rx_setup: rx-queues-config {
|
|
+ snps,rx-queues-to-use = <4>;
|
|
+ snps,rx-sched-sp;
|
|
+
|
|
+ queue0 {
|
|
+ snps,dcb-algorithm;
|
|
+ snps,map-to-dma-channel = <0x0>;
|
|
+ snps,route-up;
|
|
+ snps,priority = <0x1>;
|
|
+ };
|
|
+
|
|
+ queue1 {
|
|
+ snps,dcb-algorithm;
|
|
+ snps,map-to-dma-channel = <0x1>;
|
|
+ snps,route-ptp;
|
|
+ };
|
|
+
|
|
+ queue2 {
|
|
+ snps,avb-algorithm;
|
|
+ snps,map-to-dma-channel = <0x2>;
|
|
+ snps,route-avcp;
|
|
+ };
|
|
+
|
|
+ queue3 {
|
|
+ snps,avb-algorithm;
|
|
+ snps,map-to-dma-channel = <0x3>;
|
|
+ snps,priority = <0xc>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ mtl_tx_setup: tx-queues-config {
|
|
+ snps,tx-queues-to-use = <4>;
|
|
+ snps,tx-sched-sp;
|
|
+
|
|
+ queue0 {
|
|
+ snps,dcb-algorithm;
|
|
+ };
|
|
+
|
|
+ queue1 {
|
|
+ snps,dcb-algorithm;
|
|
+ };
|
|
+
|
|
+ queue2 {
|
|
+ snps,avb-algorithm;
|
|
+ snps,send_slope = <0x1000>;
|
|
+ snps,idle_slope = <0x1000>;
|
|
+ snps,high_credit = <0x3e800>;
|
|
+ snps,low_credit = <0xffc18000>;
|
|
+ };
|
|
+
|
|
+ queue3 {
|
|
+ snps,avb-algorithm;
|
|
+ snps,send_slope = <0x1000>;
|
|
+ snps,idle_slope = <0x1000>;
|
|
+ snps,high_credit = <0x3e800>;
|
|
+ snps,low_credit = <0xffc18000>;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+ðernet1 {
|
|
+ phy-handle = <&sgmii_phy1>;
|
|
+
|
|
+ snps,mtl-rx-config = <&mtl_rx_setup1>;
|
|
+ snps,mtl-tx-config = <&mtl_tx_setup1>;
|
|
+ snps,ps-speed = <1000>;
|
|
+
|
|
+ status = "okay";
|
|
+
|
|
+ mtl_rx_setup1: rx-queues-config {
|
|
+ snps,rx-queues-to-use = <4>;
|
|
+ snps,rx-sched-sp;
|
|
+
|
|
+ queue0 {
|
|
+ snps,dcb-algorithm;
|
|
+ snps,map-to-dma-channel = <0x0>;
|
|
+ snps,route-up;
|
|
+ snps,priority = <0x1>;
|
|
+ };
|
|
+
|
|
+ queue1 {
|
|
+ snps,dcb-algorithm;
|
|
+ snps,map-to-dma-channel = <0x1>;
|
|
+ snps,route-ptp;
|
|
+ };
|
|
+
|
|
+ queue2 {
|
|
+ snps,avb-algorithm;
|
|
+ snps,map-to-dma-channel = <0x2>;
|
|
+ snps,route-avcp;
|
|
+ };
|
|
+
|
|
+ queue3 {
|
|
+ snps,avb-algorithm;
|
|
+ snps,map-to-dma-channel = <0x3>;
|
|
+ snps,priority = <0xc>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ mtl_tx_setup1: tx-queues-config {
|
|
+ snps,tx-queues-to-use = <4>;
|
|
+ snps,tx-sched-sp;
|
|
+
|
|
+ queue0 {
|
|
+ snps,dcb-algorithm;
|
|
+ };
|
|
+
|
|
+ queue1 {
|
|
+ snps,dcb-algorithm;
|
|
+ };
|
|
+
|
|
+ queue2 {
|
|
+ snps,avb-algorithm;
|
|
+ snps,send_slope = <0x1000>;
|
|
+ snps,idle_slope = <0x1000>;
|
|
+ snps,high_credit = <0x3e800>;
|
|
+ snps,low_credit = <0xffc18000>;
|
|
+ };
|
|
+
|
|
+ queue3 {
|
|
+ snps,avb-algorithm;
|
|
+ snps,send_slope = <0x1000>;
|
|
+ snps,idle_slope = <0x1000>;
|
|
+ snps,high_credit = <0x3e800>;
|
|
+ snps,low_credit = <0xffc18000>;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&i2c11 {
|
|
+ clock-frequency = <400000>;
|
|
+ pinctrl-0 = <&qup_i2c11_default>;
|
|
+ pinctrl-names = "default";
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&i2c18 {
|
|
+ clock-frequency = <400000>;
|
|
+ pinctrl-0 = <&qup_i2c18_default>;
|
|
+ pinctrl-names = "default";
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pmm8654au_0_gpios {
|
|
+ gpio-line-names = "DS_EN",
|
|
+ "POFF_COMPLETE",
|
|
+ "UFS0_VER_ID",
|
|
+ "FAST_POFF",
|
|
+ "DBU1_PON_DONE",
|
|
+ "AOSS_SLEEP",
|
|
+ "CAM_DES0_EN",
|
|
+ "CAM_DES1_EN",
|
|
+ "CAM_DES2_EN",
|
|
+ "CAM_DES3_EN",
|
|
+ "UEFI",
|
|
+ "ANALOG_PON_OPT";
|
|
+};
|
|
+
|
|
+&pmm8654au_0_pon_resin {
|
|
+ linux,code = <KEY_VOLUMEDOWN>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pmm8654au_1_gpios {
|
|
+ gpio-line-names = "PMIC_C_ID0",
|
|
+ "PMIC_C_ID1",
|
|
+ "UFS1_VER_ID",
|
|
+ "IPA_PWR",
|
|
+ "",
|
|
+ "WLAN_DBU4_EN",
|
|
+ "WLAN_EN",
|
|
+ "BT_EN",
|
|
+ "USB2_PWR_EN",
|
|
+ "USB2_FAULT";
|
|
+
|
|
+ usb2_en_state: usb2-en-state {
|
|
+ pins = "gpio9";
|
|
+ function = "normal";
|
|
+ output-high;
|
|
+ power-source = <0>;
|
|
+ };
|
|
+};
|
|
+
|
|
+&pmm8654au_2_gpios {
|
|
+ gpio-line-names = "PMIC_E_ID0",
|
|
+ "PMIC_E_ID1",
|
|
+ "USB0_PWR_EN",
|
|
+ "USB0_FAULT",
|
|
+ "SENSOR_IRQ_1",
|
|
+ "SENSOR_IRQ_2",
|
|
+ "SENSOR_RST",
|
|
+ "SGMIIO0_RST",
|
|
+ "SGMIIO1_RST",
|
|
+ "USB1_PWR_ENABLE",
|
|
+ "USB1_FAULT",
|
|
+ "VMON_SPX8";
|
|
+
|
|
+ usb0_en_state: usb0-en-state {
|
|
+ pins = "gpio3";
|
|
+ function = "normal";
|
|
+ output-high;
|
|
+ power-source = <0>;
|
|
+ };
|
|
+
|
|
+ usb1_en_state: usb1-en-state {
|
|
+ pins = "gpio10";
|
|
+ function = "normal";
|
|
+ output-high;
|
|
+ power-source = <0>;
|
|
+ };
|
|
+};
|
|
+
|
|
+&pmm8654au_3_gpios {
|
|
+ gpio-line-names = "PMIC_G_ID0",
|
|
+ "PMIC_G_ID1",
|
|
+ "GNSS_RST",
|
|
+ "GNSS_EN",
|
|
+ "GNSS_BOOT_MODE";
|
|
+};
|
|
+
|
|
+&qupv3_id_1 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&qupv3_id_2 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&serdes0 {
|
|
+ phy-supply = <&vreg_l5a>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&serdes1 {
|
|
+ phy-supply = <&vreg_l5a>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&sleep_clk {
|
|
+ clock-frequency = <32000>;
|
|
+};
|
|
+
|
|
+&spi16 {
|
|
+ pinctrl-0 = <&qup_spi16_default>;
|
|
+ pinctrl-names = "default";
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&tlmm {
|
|
+ ethernet0_default: ethernet0-default-state {
|
|
+ ethernet0_mdc: ethernet0-mdc-pins {
|
|
+ pins = "gpio8";
|
|
+ function = "emac0_mdc";
|
|
+ drive-strength = <16>;
|
|
+ bias-pull-up;
|
|
+ };
|
|
+
|
|
+ ethernet0_mdio: ethernet0-mdio-pins {
|
|
+ pins = "gpio9";
|
|
+ function = "emac0_mdio";
|
|
+ drive-strength = <16>;
|
|
+ bias-pull-up;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ qup_uart10_default: qup-uart10-state {
|
|
+ pins = "gpio46", "gpio47";
|
|
+ function = "qup1_se3";
|
|
+ };
|
|
+
|
|
+ qup_spi16_default: qup-spi16-state {
|
|
+ pins = "gpio86", "gpio87", "gpio88", "gpio89";
|
|
+ function = "qup2_se2";
|
|
+ drive-strength = <6>;
|
|
+ bias-disable;
|
|
+ };
|
|
+
|
|
+ qup_i2c11_default: qup-i2c11-state {
|
|
+ pins = "gpio48", "gpio49";
|
|
+ function = "qup1_se4";
|
|
+ drive-strength = <2>;
|
|
+ bias-pull-up;
|
|
+ };
|
|
+
|
|
+ qup_i2c18_default: qup-i2c18-state {
|
|
+ pins = "gpio95", "gpio96";
|
|
+ function = "qup2_se4";
|
|
+ drive-strength = <2>;
|
|
+ bias-pull-up;
|
|
+ };
|
|
+
|
|
+ qup_uart12_default: qup-uart12-state {
|
|
+ qup_uart12_cts: qup-uart12-cts-pins {
|
|
+ pins = "gpio52";
|
|
+ function = "qup1_se5";
|
|
+ bias-disable;
|
|
+ };
|
|
+
|
|
+ qup_uart12_rts: qup-uart12-rts-pins {
|
|
+ pins = "gpio53";
|
|
+ function = "qup1_se5";
|
|
+ bias-pull-down;
|
|
+ };
|
|
+
|
|
+ qup_uart12_tx: qup-uart12-tx-pins {
|
|
+ pins = "gpio54";
|
|
+ function = "qup1_se5";
|
|
+ bias-pull-up;
|
|
+ };
|
|
+
|
|
+ qup_uart12_rx: qup-uart12-rx-pins {
|
|
+ pins = "gpio55";
|
|
+ function = "qup1_se5";
|
|
+ bias-pull-down;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ qup_uart17_default: qup-uart17-state {
|
|
+ qup_uart17_cts: qup-uart17-cts-pins {
|
|
+ pins = "gpio91";
|
|
+ function = "qup2_se3";
|
|
+ bias-disable;
|
|
+ };
|
|
+
|
|
+ qup_uart17_rts: qup0-uart17-rts-pins {
|
|
+ pins = "gpio92";
|
|
+ function = "qup2_se3";
|
|
+ bias-pull-down;
|
|
+ };
|
|
+
|
|
+ qup_uart17_tx: qup0-uart17-tx-pins {
|
|
+ pins = "gpio93";
|
|
+ function = "qup2_se3";
|
|
+ bias-pull-up;
|
|
+ };
|
|
+
|
|
+ qup_uart17_rx: qup0-uart17-rx-pins {
|
|
+ pins = "gpio94";
|
|
+ function = "qup2_se3";
|
|
+ bias-pull-down;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pcie0_default_state: pcie0-default-state {
|
|
+ perst-pins {
|
|
+ pins = "gpio2";
|
|
+ function = "gpio";
|
|
+ drive-strength = <2>;
|
|
+ bias-pull-down;
|
|
+ };
|
|
+
|
|
+ clkreq-pins {
|
|
+ pins = "gpio1";
|
|
+ function = "pcie0_clkreq";
|
|
+ drive-strength = <2>;
|
|
+ bias-pull-up;
|
|
+ };
|
|
+
|
|
+ wake-pins {
|
|
+ pins = "gpio0";
|
|
+ function = "gpio";
|
|
+ drive-strength = <2>;
|
|
+ bias-pull-up;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pcie1_default_state: pcie1-default-state {
|
|
+ perst-pins {
|
|
+ pins = "gpio4";
|
|
+ function = "gpio";
|
|
+ drive-strength = <2>;
|
|
+ bias-pull-down;
|
|
+ };
|
|
+
|
|
+ clkreq-pins {
|
|
+ pins = "gpio3";
|
|
+ function = "pcie1_clkreq";
|
|
+ drive-strength = <2>;
|
|
+ bias-pull-up;
|
|
+ };
|
|
+
|
|
+ wake-pins {
|
|
+ pins = "gpio5";
|
|
+ function = "gpio";
|
|
+ drive-strength = <2>;
|
|
+ bias-pull-up;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&pcie0 {
|
|
+ perst-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
|
|
+ wake-gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
|
|
+
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pcie0_default_state>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pcie1 {
|
|
+ perst-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
|
|
+ wake-gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>;
|
|
+
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pcie1_default_state>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pcie0_phy {
|
|
+ vdda-phy-supply = <&vreg_l5a>;
|
|
+ vdda-pll-supply = <&vreg_l1c>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pcie1_phy {
|
|
+ vdda-phy-supply = <&vreg_l5a>;
|
|
+ vdda-pll-supply = <&vreg_l1c>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&uart10 {
|
|
+ compatible = "qcom,geni-debug-uart";
|
|
+ pinctrl-0 = <&qup_uart10_default>;
|
|
+ pinctrl-names = "default";
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&uart12 {
|
|
+ pinctrl-0 = <&qup_uart12_default>;
|
|
+ pinctrl-names = "default";
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&uart17 {
|
|
+ pinctrl-0 = <&qup_uart17_default>;
|
|
+ pinctrl-names = "default";
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&ufs_mem_hc {
|
|
+ reset-gpios = <&tlmm 149 GPIO_ACTIVE_LOW>;
|
|
+ vcc-supply = <&vreg_l8a>;
|
|
+ vcc-max-microamp = <1100000>;
|
|
+ vccq-supply = <&vreg_l4c>;
|
|
+ vccq-max-microamp = <1200000>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&ufs_mem_phy {
|
|
+ vdda-phy-supply = <&vreg_l4a>;
|
|
+ vdda-pll-supply = <&vreg_l1c>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_0 {
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&usb0_en_state>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_0_dwc3 {
|
|
+ dr_mode = "peripheral";
|
|
+};
|
|
+
|
|
+&usb_0_hsphy {
|
|
+ vdda-pll-supply = <&vreg_l7a>;
|
|
+ vdda18-supply = <&vreg_l6c>;
|
|
+ vdda33-supply = <&vreg_l9a>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_0_qmpphy {
|
|
+ vdda-phy-supply = <&vreg_l1c>;
|
|
+ vdda-pll-supply = <&vreg_l7a>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_1 {
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&usb1_en_state>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_1_dwc3 {
|
|
+ dr_mode = "host";
|
|
+};
|
|
+
|
|
+&usb_1_hsphy {
|
|
+ vdda-pll-supply = <&vreg_l7a>;
|
|
+ vdda18-supply = <&vreg_l6c>;
|
|
+ vdda33-supply = <&vreg_l9a>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_1_qmpphy {
|
|
+ vdda-phy-supply = <&vreg_l1c>;
|
|
+ vdda-pll-supply = <&vreg_l7a>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_2 {
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&usb2_en_state>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_2_dwc3 {
|
|
+ dr_mode = "host";
|
|
+};
|
|
+
|
|
+&usb_2_hsphy {
|
|
+ vdda-pll-supply = <&vreg_l7a>;
|
|
+ vdda18-supply = <&vreg_l6c>;
|
|
+ vdda33-supply = <&vreg_l9a>;
|
|
+
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&xo_board_clk {
|
|
+ clock-frequency = <38400000>;
|
|
+};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc7180-firmware-tfa.dtsi b/arch/arm64/boot/dts/qcom/sc7180-firmware-tfa.dtsi
|
|
index ee35a454dbf6f3..59162b3afcb841 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc7180-firmware-tfa.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc7180-firmware-tfa.dtsi
|
|
@@ -6,82 +6,82 @@
|
|
* by Qualcomm firmware.
|
|
*/
|
|
|
|
-&CPU0 {
|
|
+&cpu0 {
|
|
/delete-property/ power-domains;
|
|
/delete-property/ power-domain-names;
|
|
|
|
- cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
|
- &LITTLE_CPU_SLEEP_1
|
|
- &CLUSTER_SLEEP_0>;
|
|
+ cpu-idle-states = <&little_cpu_sleep_0
|
|
+ &little_cpu_sleep_1
|
|
+ &cluster_sleep_0>;
|
|
};
|
|
|
|
-&CPU1 {
|
|
+&cpu1 {
|
|
/delete-property/ power-domains;
|
|
/delete-property/ power-domain-names;
|
|
|
|
- cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
|
- &LITTLE_CPU_SLEEP_1
|
|
- &CLUSTER_SLEEP_0>;
|
|
+ cpu-idle-states = <&little_cpu_sleep_0
|
|
+ &little_cpu_sleep_1
|
|
+ &cluster_sleep_0>;
|
|
};
|
|
|
|
-&CPU2 {
|
|
+&cpu2 {
|
|
/delete-property/ power-domains;
|
|
/delete-property/ power-domain-names;
|
|
|
|
- cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
|
- &LITTLE_CPU_SLEEP_1
|
|
- &CLUSTER_SLEEP_0>;
|
|
+ cpu-idle-states = <&little_cpu_sleep_0
|
|
+ &little_cpu_sleep_1
|
|
+ &cluster_sleep_0>;
|
|
};
|
|
|
|
-&CPU3 {
|
|
+&cpu3 {
|
|
/delete-property/ power-domains;
|
|
/delete-property/ power-domain-names;
|
|
|
|
- cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
|
- &LITTLE_CPU_SLEEP_1
|
|
- &CLUSTER_SLEEP_0>;
|
|
+ cpu-idle-states = <&little_cpu_sleep_0
|
|
+ &little_cpu_sleep_1
|
|
+ &cluster_sleep_0>;
|
|
};
|
|
|
|
-&CPU4 {
|
|
+&cpu4 {
|
|
/delete-property/ power-domains;
|
|
/delete-property/ power-domain-names;
|
|
|
|
- cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
|
- &LITTLE_CPU_SLEEP_1
|
|
- &CLUSTER_SLEEP_0>;
|
|
+ cpu-idle-states = <&little_cpu_sleep_0
|
|
+ &little_cpu_sleep_1
|
|
+ &cluster_sleep_0>;
|
|
};
|
|
|
|
-&CPU5 {
|
|
+&cpu5 {
|
|
/delete-property/ power-domains;
|
|
/delete-property/ power-domain-names;
|
|
|
|
- cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
|
- &LITTLE_CPU_SLEEP_1
|
|
- &CLUSTER_SLEEP_0>;
|
|
+ cpu-idle-states = <&little_cpu_sleep_0
|
|
+ &little_cpu_sleep_1
|
|
+ &cluster_sleep_0>;
|
|
};
|
|
|
|
-&CPU6 {
|
|
+&cpu6 {
|
|
/delete-property/ power-domains;
|
|
/delete-property/ power-domain-names;
|
|
|
|
- cpu-idle-states = <&BIG_CPU_SLEEP_0
|
|
- &BIG_CPU_SLEEP_1
|
|
- &CLUSTER_SLEEP_0>;
|
|
+ cpu-idle-states = <&big_cpu_sleep_0
|
|
+ &big_cpu_sleep_1
|
|
+ &cluster_sleep_0>;
|
|
};
|
|
|
|
-&CPU7 {
|
|
+&cpu7 {
|
|
/delete-property/ power-domains;
|
|
/delete-property/ power-domain-names;
|
|
|
|
- cpu-idle-states = <&BIG_CPU_SLEEP_0
|
|
- &BIG_CPU_SLEEP_1
|
|
- &CLUSTER_SLEEP_0>;
|
|
+ cpu-idle-states = <&big_cpu_sleep_0
|
|
+ &big_cpu_sleep_1
|
|
+ &cluster_sleep_0>;
|
|
};
|
|
|
|
/delete-node/ &domain_idle_states;
|
|
|
|
&idle_states {
|
|
- CLUSTER_SLEEP_0: cluster-sleep-0 {
|
|
+ cluster_sleep_0: cluster-sleep-0 {
|
|
compatible = "arm,idle-state";
|
|
idle-state-name = "cluster-power-down";
|
|
arm,psci-suspend-param = <0x40003444>;
|
|
@@ -92,15 +92,15 @@ CLUSTER_SLEEP_0: cluster-sleep-0 {
|
|
};
|
|
};
|
|
|
|
-/delete-node/ &CPU_PD0;
|
|
-/delete-node/ &CPU_PD1;
|
|
-/delete-node/ &CPU_PD2;
|
|
-/delete-node/ &CPU_PD3;
|
|
-/delete-node/ &CPU_PD4;
|
|
-/delete-node/ &CPU_PD5;
|
|
-/delete-node/ &CPU_PD6;
|
|
-/delete-node/ &CPU_PD7;
|
|
-/delete-node/ &CLUSTER_PD;
|
|
+/delete-node/ &cpu_pd0;
|
|
+/delete-node/ &cpu_pd1;
|
|
+/delete-node/ &cpu_pd2;
|
|
+/delete-node/ &cpu_pd3;
|
|
+/delete-node/ &cpu_pd4;
|
|
+/delete-node/ &cpu_pd5;
|
|
+/delete-node/ &cpu_pd6;
|
|
+/delete-node/ &cpu_pd7;
|
|
+/delete-node/ &cluster_pd;
|
|
|
|
&apps_rsc {
|
|
/delete-property/ power-domains;
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi
|
|
index a532cc4aac4740..d338a8a0a9a966 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi
|
|
@@ -26,7 +26,6 @@ adau7002: audio-codec-1 {
|
|
thermal-zones {
|
|
skin_temp_thermal: skin-temp-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&pm6150_adc_tm 1>;
|
|
sustainable-power = <965>;
|
|
@@ -54,14 +53,14 @@ skin-temp-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&skin_temp_alert0>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
|
|
map1 {
|
|
trip = <&skin_temp_alert1>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi
|
|
index b27dcd2ec856f0..4452d04e4c547d 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi
|
|
@@ -43,7 +43,6 @@ pp3300_touch: pp3300-touch-regulator {
|
|
thermal-zones {
|
|
skin_temp_thermal: skin-temp-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&pm6150_adc_tm 1>;
|
|
sustainable-power = <965>;
|
|
@@ -71,14 +70,14 @@ skin-temp-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&skin_temp_alert0>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
|
|
map1 {
|
|
trip = <&skin_temp_alert1>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi
|
|
index fd944842dd6cdf..7a05d502620f31 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi
|
|
@@ -12,14 +12,11 @@
|
|
|
|
/ {
|
|
thermal-zones {
|
|
- 5v-choke-thermal {
|
|
- polling-delay-passive = <0>;
|
|
- polling-delay = <250>;
|
|
-
|
|
+ choke-5v-thermal {
|
|
thermal-sensors = <&pm6150_adc_tm 1>;
|
|
|
|
trips {
|
|
- 5v-choke-crit {
|
|
+ choke-5v-crit {
|
|
temperature = <125000>;
|
|
hysteresis = <1000>;
|
|
type = "critical";
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi
|
|
index 62ab6427dd65d6..e1e31e0fc0e14e 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi
|
|
@@ -84,6 +84,7 @@ panel: panel@0 {
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&lcd_rst>;
|
|
avdd-supply = <&ppvar_lcd>;
|
|
+ avee-supply = <&ppvar_lcd>;
|
|
pp1800-supply = <&v1p8_disp>;
|
|
pp3300-supply = <&pp3300_dx_edp>;
|
|
backlight = <&backlight>;
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi
|
|
index 2f6a340ddd2ae3..38335df3a275d3 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi
|
|
@@ -50,7 +50,6 @@ v1p8_mipi: v1p8-mipi-regulator {
|
|
thermal-zones {
|
|
skin_temp_thermal: skin-temp-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&pm6150_adc_tm 1>;
|
|
sustainable-power = <574>;
|
|
@@ -78,14 +77,14 @@ skin-temp-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&skin_temp_alert0>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
|
|
map1 {
|
|
trip = <&skin_temp_alert1>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
|
|
index c2f5e9f6679d69..906e616422706f 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
|
|
@@ -21,9 +21,6 @@
|
|
/ {
|
|
thermal-zones {
|
|
charger_thermal: charger-thermal {
|
|
- polling-delay-passive = <0>;
|
|
- polling-delay = <0>;
|
|
-
|
|
thermal-sensors = <&pm6150_adc_tm 0>;
|
|
|
|
trips {
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
|
|
index 68b1c017a9fd5f..7758136d71d645 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
|
|
@@ -74,28 +74,28 @@ cpus {
|
|
#address-cells = <2>;
|
|
#size-cells = <0>;
|
|
|
|
- CPU0: cpu@0 {
|
|
+ cpu0: cpu@0 {
|
|
device_type = "cpu";
|
|
compatible = "qcom,kryo468";
|
|
reg = <0x0 0x0>;
|
|
clocks = <&cpufreq_hw 0>;
|
|
enable-method = "psci";
|
|
- power-domains = <&CPU_PD0>;
|
|
+ power-domains = <&cpu_pd0>;
|
|
power-domain-names = "psci";
|
|
capacity-dmips-mhz = <415>;
|
|
dynamic-power-coefficient = <137>;
|
|
operating-points-v2 = <&cpu0_opp_table>;
|
|
interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
|
|
<&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
|
|
- next-level-cache = <&L2_0>;
|
|
+ next-level-cache = <&l2_0>;
|
|
#cooling-cells = <2>;
|
|
qcom,freq-domain = <&cpufreq_hw 0>;
|
|
- L2_0: l2-cache {
|
|
+ l2_0: l2-cache {
|
|
compatible = "cache";
|
|
cache-level = <2>;
|
|
cache-unified;
|
|
- next-level-cache = <&L3_0>;
|
|
- L3_0: l3-cache {
|
|
+ next-level-cache = <&l3_0>;
|
|
+ l3_0: l3-cache {
|
|
compatible = "cache";
|
|
cache-level = <3>;
|
|
cache-unified;
|
|
@@ -103,206 +103,206 @@ L3_0: l3-cache {
|
|
};
|
|
};
|
|
|
|
- CPU1: cpu@100 {
|
|
+ cpu1: cpu@100 {
|
|
device_type = "cpu";
|
|
compatible = "qcom,kryo468";
|
|
reg = <0x0 0x100>;
|
|
clocks = <&cpufreq_hw 0>;
|
|
enable-method = "psci";
|
|
- power-domains = <&CPU_PD1>;
|
|
+ power-domains = <&cpu_pd1>;
|
|
power-domain-names = "psci";
|
|
capacity-dmips-mhz = <415>;
|
|
dynamic-power-coefficient = <137>;
|
|
- next-level-cache = <&L2_100>;
|
|
+ next-level-cache = <&l2_100>;
|
|
operating-points-v2 = <&cpu0_opp_table>;
|
|
interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
|
|
<&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
|
|
#cooling-cells = <2>;
|
|
qcom,freq-domain = <&cpufreq_hw 0>;
|
|
- L2_100: l2-cache {
|
|
+ l2_100: l2-cache {
|
|
compatible = "cache";
|
|
cache-level = <2>;
|
|
cache-unified;
|
|
- next-level-cache = <&L3_0>;
|
|
+ next-level-cache = <&l3_0>;
|
|
};
|
|
};
|
|
|
|
- CPU2: cpu@200 {
|
|
+ cpu2: cpu@200 {
|
|
device_type = "cpu";
|
|
compatible = "qcom,kryo468";
|
|
reg = <0x0 0x200>;
|
|
clocks = <&cpufreq_hw 0>;
|
|
enable-method = "psci";
|
|
- power-domains = <&CPU_PD2>;
|
|
+ power-domains = <&cpu_pd2>;
|
|
power-domain-names = "psci";
|
|
capacity-dmips-mhz = <415>;
|
|
dynamic-power-coefficient = <137>;
|
|
- next-level-cache = <&L2_200>;
|
|
+ next-level-cache = <&l2_200>;
|
|
operating-points-v2 = <&cpu0_opp_table>;
|
|
interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
|
|
<&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
|
|
#cooling-cells = <2>;
|
|
qcom,freq-domain = <&cpufreq_hw 0>;
|
|
- L2_200: l2-cache {
|
|
+ l2_200: l2-cache {
|
|
compatible = "cache";
|
|
cache-level = <2>;
|
|
cache-unified;
|
|
- next-level-cache = <&L3_0>;
|
|
+ next-level-cache = <&l3_0>;
|
|
};
|
|
};
|
|
|
|
- CPU3: cpu@300 {
|
|
+ cpu3: cpu@300 {
|
|
device_type = "cpu";
|
|
compatible = "qcom,kryo468";
|
|
reg = <0x0 0x300>;
|
|
clocks = <&cpufreq_hw 0>;
|
|
enable-method = "psci";
|
|
- power-domains = <&CPU_PD3>;
|
|
+ power-domains = <&cpu_pd3>;
|
|
power-domain-names = "psci";
|
|
capacity-dmips-mhz = <415>;
|
|
dynamic-power-coefficient = <137>;
|
|
- next-level-cache = <&L2_300>;
|
|
+ next-level-cache = <&l2_300>;
|
|
operating-points-v2 = <&cpu0_opp_table>;
|
|
interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
|
|
<&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
|
|
#cooling-cells = <2>;
|
|
qcom,freq-domain = <&cpufreq_hw 0>;
|
|
- L2_300: l2-cache {
|
|
+ l2_300: l2-cache {
|
|
compatible = "cache";
|
|
cache-level = <2>;
|
|
cache-unified;
|
|
- next-level-cache = <&L3_0>;
|
|
+ next-level-cache = <&l3_0>;
|
|
};
|
|
};
|
|
|
|
- CPU4: cpu@400 {
|
|
+ cpu4: cpu@400 {
|
|
device_type = "cpu";
|
|
compatible = "qcom,kryo468";
|
|
reg = <0x0 0x400>;
|
|
clocks = <&cpufreq_hw 0>;
|
|
enable-method = "psci";
|
|
- power-domains = <&CPU_PD4>;
|
|
+ power-domains = <&cpu_pd4>;
|
|
power-domain-names = "psci";
|
|
capacity-dmips-mhz = <415>;
|
|
dynamic-power-coefficient = <137>;
|
|
- next-level-cache = <&L2_400>;
|
|
+ next-level-cache = <&l2_400>;
|
|
operating-points-v2 = <&cpu0_opp_table>;
|
|
interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
|
|
<&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
|
|
#cooling-cells = <2>;
|
|
qcom,freq-domain = <&cpufreq_hw 0>;
|
|
- L2_400: l2-cache {
|
|
+ l2_400: l2-cache {
|
|
compatible = "cache";
|
|
cache-level = <2>;
|
|
cache-unified;
|
|
- next-level-cache = <&L3_0>;
|
|
+ next-level-cache = <&l3_0>;
|
|
};
|
|
};
|
|
|
|
- CPU5: cpu@500 {
|
|
+ cpu5: cpu@500 {
|
|
device_type = "cpu";
|
|
compatible = "qcom,kryo468";
|
|
reg = <0x0 0x500>;
|
|
clocks = <&cpufreq_hw 0>;
|
|
enable-method = "psci";
|
|
- power-domains = <&CPU_PD5>;
|
|
+ power-domains = <&cpu_pd5>;
|
|
power-domain-names = "psci";
|
|
capacity-dmips-mhz = <415>;
|
|
dynamic-power-coefficient = <137>;
|
|
- next-level-cache = <&L2_500>;
|
|
+ next-level-cache = <&l2_500>;
|
|
operating-points-v2 = <&cpu0_opp_table>;
|
|
interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
|
|
<&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
|
|
#cooling-cells = <2>;
|
|
qcom,freq-domain = <&cpufreq_hw 0>;
|
|
- L2_500: l2-cache {
|
|
+ l2_500: l2-cache {
|
|
compatible = "cache";
|
|
cache-level = <2>;
|
|
cache-unified;
|
|
- next-level-cache = <&L3_0>;
|
|
+ next-level-cache = <&l3_0>;
|
|
};
|
|
};
|
|
|
|
- CPU6: cpu@600 {
|
|
+ cpu6: cpu@600 {
|
|
device_type = "cpu";
|
|
compatible = "qcom,kryo468";
|
|
reg = <0x0 0x600>;
|
|
clocks = <&cpufreq_hw 1>;
|
|
enable-method = "psci";
|
|
- power-domains = <&CPU_PD6>;
|
|
+ power-domains = <&cpu_pd6>;
|
|
power-domain-names = "psci";
|
|
capacity-dmips-mhz = <1024>;
|
|
dynamic-power-coefficient = <480>;
|
|
- next-level-cache = <&L2_600>;
|
|
+ next-level-cache = <&l2_600>;
|
|
operating-points-v2 = <&cpu6_opp_table>;
|
|
interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
|
|
<&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
|
|
#cooling-cells = <2>;
|
|
qcom,freq-domain = <&cpufreq_hw 1>;
|
|
- L2_600: l2-cache {
|
|
+ l2_600: l2-cache {
|
|
compatible = "cache";
|
|
cache-level = <2>;
|
|
cache-unified;
|
|
- next-level-cache = <&L3_0>;
|
|
+ next-level-cache = <&l3_0>;
|
|
};
|
|
};
|
|
|
|
- CPU7: cpu@700 {
|
|
+ cpu7: cpu@700 {
|
|
device_type = "cpu";
|
|
compatible = "qcom,kryo468";
|
|
reg = <0x0 0x700>;
|
|
clocks = <&cpufreq_hw 1>;
|
|
enable-method = "psci";
|
|
- power-domains = <&CPU_PD7>;
|
|
+ power-domains = <&cpu_pd7>;
|
|
power-domain-names = "psci";
|
|
capacity-dmips-mhz = <1024>;
|
|
dynamic-power-coefficient = <480>;
|
|
- next-level-cache = <&L2_700>;
|
|
+ next-level-cache = <&l2_700>;
|
|
operating-points-v2 = <&cpu6_opp_table>;
|
|
interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
|
|
<&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
|
|
#cooling-cells = <2>;
|
|
qcom,freq-domain = <&cpufreq_hw 1>;
|
|
- L2_700: l2-cache {
|
|
+ l2_700: l2-cache {
|
|
compatible = "cache";
|
|
cache-level = <2>;
|
|
cache-unified;
|
|
- next-level-cache = <&L3_0>;
|
|
+ next-level-cache = <&l3_0>;
|
|
};
|
|
};
|
|
|
|
cpu-map {
|
|
cluster0 {
|
|
core0 {
|
|
- cpu = <&CPU0>;
|
|
+ cpu = <&cpu0>;
|
|
};
|
|
|
|
core1 {
|
|
- cpu = <&CPU1>;
|
|
+ cpu = <&cpu1>;
|
|
};
|
|
|
|
core2 {
|
|
- cpu = <&CPU2>;
|
|
+ cpu = <&cpu2>;
|
|
};
|
|
|
|
core3 {
|
|
- cpu = <&CPU3>;
|
|
+ cpu = <&cpu3>;
|
|
};
|
|
|
|
core4 {
|
|
- cpu = <&CPU4>;
|
|
+ cpu = <&cpu4>;
|
|
};
|
|
|
|
core5 {
|
|
- cpu = <&CPU5>;
|
|
+ cpu = <&cpu5>;
|
|
};
|
|
|
|
core6 {
|
|
- cpu = <&CPU6>;
|
|
+ cpu = <&cpu6>;
|
|
};
|
|
|
|
core7 {
|
|
- cpu = <&CPU7>;
|
|
+ cpu = <&cpu7>;
|
|
};
|
|
};
|
|
};
|
|
@@ -310,7 +310,7 @@ core7 {
|
|
idle_states: idle-states {
|
|
entry-method = "psci";
|
|
|
|
- LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 {
|
|
+ little_cpu_sleep_0: cpu-sleep-0-0 {
|
|
compatible = "arm,idle-state";
|
|
idle-state-name = "little-power-down";
|
|
arm,psci-suspend-param = <0x40000003>;
|
|
@@ -320,7 +320,7 @@ LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 {
|
|
local-timer-stop;
|
|
};
|
|
|
|
- LITTLE_CPU_SLEEP_1: cpu-sleep-0-1 {
|
|
+ little_cpu_sleep_1: cpu-sleep-0-1 {
|
|
compatible = "arm,idle-state";
|
|
idle-state-name = "little-rail-power-down";
|
|
arm,psci-suspend-param = <0x40000004>;
|
|
@@ -330,7 +330,7 @@ LITTLE_CPU_SLEEP_1: cpu-sleep-0-1 {
|
|
local-timer-stop;
|
|
};
|
|
|
|
- BIG_CPU_SLEEP_0: cpu-sleep-1-0 {
|
|
+ big_cpu_sleep_0: cpu-sleep-1-0 {
|
|
compatible = "arm,idle-state";
|
|
idle-state-name = "big-power-down";
|
|
arm,psci-suspend-param = <0x40000003>;
|
|
@@ -340,7 +340,7 @@ BIG_CPU_SLEEP_0: cpu-sleep-1-0 {
|
|
local-timer-stop;
|
|
};
|
|
|
|
- BIG_CPU_SLEEP_1: cpu-sleep-1-1 {
|
|
+ big_cpu_sleep_1: cpu-sleep-1-1 {
|
|
compatible = "arm,idle-state";
|
|
idle-state-name = "big-rail-power-down";
|
|
arm,psci-suspend-param = <0x40000004>;
|
|
@@ -352,7 +352,7 @@ BIG_CPU_SLEEP_1: cpu-sleep-1-1 {
|
|
};
|
|
|
|
domain_idle_states: domain-idle-states {
|
|
- CLUSTER_SLEEP_PC: cluster-sleep-0 {
|
|
+ cluster_sleep_pc: cluster-sleep-0 {
|
|
compatible = "domain-idle-state";
|
|
idle-state-name = "cluster-l3-power-collapse";
|
|
arm,psci-suspend-param = <0x41000044>;
|
|
@@ -361,7 +361,7 @@ CLUSTER_SLEEP_PC: cluster-sleep-0 {
|
|
min-residency-us = <6118>;
|
|
};
|
|
|
|
- CLUSTER_SLEEP_CX_RET: cluster-sleep-1 {
|
|
+ cluster_sleep_cx_ret: cluster-sleep-1 {
|
|
compatible = "domain-idle-state";
|
|
idle-state-name = "cluster-cx-retention";
|
|
arm,psci-suspend-param = <0x41001244>;
|
|
@@ -370,7 +370,7 @@ CLUSTER_SLEEP_CX_RET: cluster-sleep-1 {
|
|
min-residency-us = <8467>;
|
|
};
|
|
|
|
- CLUSTER_AOSS_SLEEP: cluster-sleep-2 {
|
|
+ cluster_aoss_sleep: cluster-sleep-2 {
|
|
compatible = "domain-idle-state";
|
|
idle-state-name = "cluster-power-down";
|
|
arm,psci-suspend-param = <0x4100b244>;
|
|
@@ -580,59 +580,59 @@ psci {
|
|
compatible = "arm,psci-1.0";
|
|
method = "smc";
|
|
|
|
- CPU_PD0: cpu0 {
|
|
+ cpu_pd0: power-domain-cpu0 {
|
|
#power-domain-cells = <0>;
|
|
- power-domains = <&CLUSTER_PD>;
|
|
- domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
|
|
+ power-domains = <&cluster_pd>;
|
|
+ domain-idle-states = <&little_cpu_sleep_0 &little_cpu_sleep_1>;
|
|
};
|
|
|
|
- CPU_PD1: cpu1 {
|
|
+ cpu_pd1: power-domain-cpu1 {
|
|
#power-domain-cells = <0>;
|
|
- power-domains = <&CLUSTER_PD>;
|
|
- domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
|
|
+ power-domains = <&cluster_pd>;
|
|
+ domain-idle-states = <&little_cpu_sleep_0 &little_cpu_sleep_1>;
|
|
};
|
|
|
|
- CPU_PD2: cpu2 {
|
|
+ cpu_pd2: power-domain-cpu2 {
|
|
#power-domain-cells = <0>;
|
|
- power-domains = <&CLUSTER_PD>;
|
|
- domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
|
|
+ power-domains = <&cluster_pd>;
|
|
+ domain-idle-states = <&little_cpu_sleep_0 &little_cpu_sleep_1>;
|
|
};
|
|
|
|
- CPU_PD3: cpu3 {
|
|
+ cpu_pd3: power-domain-cpu3 {
|
|
#power-domain-cells = <0>;
|
|
- power-domains = <&CLUSTER_PD>;
|
|
- domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
|
|
+ power-domains = <&cluster_pd>;
|
|
+ domain-idle-states = <&little_cpu_sleep_0 &little_cpu_sleep_1>;
|
|
};
|
|
|
|
- CPU_PD4: cpu4 {
|
|
+ cpu_pd4: power-domain-cpu4 {
|
|
#power-domain-cells = <0>;
|
|
- power-domains = <&CLUSTER_PD>;
|
|
- domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
|
|
+ power-domains = <&cluster_pd>;
|
|
+ domain-idle-states = <&little_cpu_sleep_0 &little_cpu_sleep_1>;
|
|
};
|
|
|
|
- CPU_PD5: cpu5 {
|
|
+ cpu_pd5: power-domain-cpu5 {
|
|
#power-domain-cells = <0>;
|
|
- power-domains = <&CLUSTER_PD>;
|
|
- domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
|
|
+ power-domains = <&cluster_pd>;
|
|
+ domain-idle-states = <&little_cpu_sleep_0 &little_cpu_sleep_1>;
|
|
};
|
|
|
|
- CPU_PD6: cpu6 {
|
|
+ cpu_pd6: power-domain-cpu6 {
|
|
#power-domain-cells = <0>;
|
|
- power-domains = <&CLUSTER_PD>;
|
|
- domain-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
|
|
+ power-domains = <&cluster_pd>;
|
|
+ domain-idle-states = <&big_cpu_sleep_0 &big_cpu_sleep_1>;
|
|
};
|
|
|
|
- CPU_PD7: cpu7 {
|
|
+ cpu_pd7: power-domain-cpu7 {
|
|
#power-domain-cells = <0>;
|
|
- power-domains = <&CLUSTER_PD>;
|
|
- domain-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
|
|
+ power-domains = <&cluster_pd>;
|
|
+ domain-idle-states = <&big_cpu_sleep_0 &big_cpu_sleep_1>;
|
|
};
|
|
|
|
- CLUSTER_PD: cpu-cluster0 {
|
|
+ cluster_pd: power-domain-cluster {
|
|
#power-domain-cells = <0>;
|
|
- domain-idle-states = <&CLUSTER_SLEEP_PC
|
|
- &CLUSTER_SLEEP_CX_RET
|
|
- &CLUSTER_AOSS_SLEEP>;
|
|
+ domain-idle-states = <&cluster_sleep_pc
|
|
+ &cluster_sleep_cx_ret
|
|
+ &cluster_aoss_sleep>;
|
|
};
|
|
};
|
|
|
|
@@ -2465,7 +2465,7 @@ etm@7040000 {
|
|
compatible = "arm,coresight-etm4x", "arm,primecell";
|
|
reg = <0 0x07040000 0 0x1000>;
|
|
|
|
- cpu = <&CPU0>;
|
|
+ cpu = <&cpu0>;
|
|
|
|
clocks = <&aoss_qmp>;
|
|
clock-names = "apb_pclk";
|
|
@@ -2485,7 +2485,7 @@ etm@7140000 {
|
|
compatible = "arm,coresight-etm4x", "arm,primecell";
|
|
reg = <0 0x07140000 0 0x1000>;
|
|
|
|
- cpu = <&CPU1>;
|
|
+ cpu = <&cpu1>;
|
|
|
|
clocks = <&aoss_qmp>;
|
|
clock-names = "apb_pclk";
|
|
@@ -2505,7 +2505,7 @@ etm@7240000 {
|
|
compatible = "arm,coresight-etm4x", "arm,primecell";
|
|
reg = <0 0x07240000 0 0x1000>;
|
|
|
|
- cpu = <&CPU2>;
|
|
+ cpu = <&cpu2>;
|
|
|
|
clocks = <&aoss_qmp>;
|
|
clock-names = "apb_pclk";
|
|
@@ -2525,7 +2525,7 @@ etm@7340000 {
|
|
compatible = "arm,coresight-etm4x", "arm,primecell";
|
|
reg = <0 0x07340000 0 0x1000>;
|
|
|
|
- cpu = <&CPU3>;
|
|
+ cpu = <&cpu3>;
|
|
|
|
clocks = <&aoss_qmp>;
|
|
clock-names = "apb_pclk";
|
|
@@ -2545,7 +2545,7 @@ etm@7440000 {
|
|
compatible = "arm,coresight-etm4x", "arm,primecell";
|
|
reg = <0 0x07440000 0 0x1000>;
|
|
|
|
- cpu = <&CPU4>;
|
|
+ cpu = <&cpu4>;
|
|
|
|
clocks = <&aoss_qmp>;
|
|
clock-names = "apb_pclk";
|
|
@@ -2565,7 +2565,7 @@ etm@7540000 {
|
|
compatible = "arm,coresight-etm4x", "arm,primecell";
|
|
reg = <0 0x07540000 0 0x1000>;
|
|
|
|
- cpu = <&CPU5>;
|
|
+ cpu = <&cpu5>;
|
|
|
|
clocks = <&aoss_qmp>;
|
|
clock-names = "apb_pclk";
|
|
@@ -2585,7 +2585,7 @@ etm@7640000 {
|
|
compatible = "arm,coresight-etm4x", "arm,primecell";
|
|
reg = <0 0x07640000 0 0x1000>;
|
|
|
|
- cpu = <&CPU6>;
|
|
+ cpu = <&cpu6>;
|
|
|
|
clocks = <&aoss_qmp>;
|
|
clock-names = "apb_pclk";
|
|
@@ -2605,7 +2605,7 @@ etm@7740000 {
|
|
compatible = "arm,coresight-etm4x", "arm,primecell";
|
|
reg = <0 0x07740000 0 0x1000>;
|
|
|
|
- cpu = <&CPU7>;
|
|
+ cpu = <&cpu7>;
|
|
|
|
clocks = <&aoss_qmp>;
|
|
clock-names = "apb_pclk";
|
|
@@ -3645,7 +3645,7 @@ apps_rsc: rsc@18200000 {
|
|
<SLEEP_TCS 3>,
|
|
<WAKE_TCS 3>,
|
|
<CONTROL_TCS 1>;
|
|
- power-domains = <&CLUSTER_PD>;
|
|
+ power-domains = <&cluster_pd>;
|
|
|
|
rpmhcc: clock-controller {
|
|
compatible = "qcom,sc7180-rpmh-clk";
|
|
@@ -3827,7 +3827,6 @@ lpass_hm: clock-controller@63000000 {
|
|
thermal-zones {
|
|
cpu0_thermal: cpu0-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 1>;
|
|
sustainable-power = <1052>;
|
|
@@ -3855,28 +3854,27 @@ cpu0_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu0_alert0>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu0_alert1>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
cpu1_thermal: cpu1-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 2>;
|
|
sustainable-power = <1052>;
|
|
@@ -3904,28 +3902,27 @@ cpu1_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu1_alert0>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu1_alert1>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
cpu2_thermal: cpu2-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 3>;
|
|
sustainable-power = <1052>;
|
|
@@ -3953,28 +3950,27 @@ cpu2_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu2_alert0>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu2_alert1>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
cpu3_thermal: cpu3-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 4>;
|
|
sustainable-power = <1052>;
|
|
@@ -4002,28 +3998,27 @@ cpu3_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu3_alert0>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu3_alert1>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
cpu4_thermal: cpu4-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 5>;
|
|
sustainable-power = <1052>;
|
|
@@ -4051,28 +4046,27 @@ cpu4_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu4_alert0>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu4_alert1>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
cpu5_thermal: cpu5-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 6>;
|
|
sustainable-power = <1052>;
|
|
@@ -4100,28 +4094,27 @@ cpu5_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu5_alert0>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu5_alert1>;
|
|
- cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
cpu6_thermal: cpu6-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 9>;
|
|
sustainable-power = <1425>;
|
|
@@ -4149,20 +4142,19 @@ cpu6_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu6_alert0>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu6_alert1>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
cpu7_thermal: cpu7-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 10>;
|
|
sustainable-power = <1425>;
|
|
@@ -4190,20 +4182,19 @@ cpu7_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu7_alert0>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu7_alert1>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
cpu8_thermal: cpu8-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 11>;
|
|
sustainable-power = <1425>;
|
|
@@ -4231,20 +4222,19 @@ cpu8_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu8_alert0>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu8_alert1>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
cpu9_thermal: cpu9-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 12>;
|
|
sustainable-power = <1425>;
|
|
@@ -4272,20 +4262,19 @@ cpu9_crit: cpu-crit {
|
|
cooling-maps {
|
|
map0 {
|
|
trip = <&cpu9_alert0>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
map1 {
|
|
trip = <&cpu9_alert1>;
|
|
- cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
- <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
|
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
|
};
|
|
};
|
|
};
|
|
|
|
aoss0-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 0>;
|
|
|
|
@@ -4306,7 +4295,6 @@ aoss0_crit: aoss0-crit {
|
|
|
|
cpuss0-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 7>;
|
|
|
|
@@ -4326,7 +4314,6 @@ cpuss0_crit: cluster0-crit {
|
|
|
|
cpuss1-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 8>;
|
|
|
|
@@ -4346,7 +4333,6 @@ cpuss1_crit: cluster0-crit {
|
|
|
|
gpuss0-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 13>;
|
|
|
|
@@ -4374,7 +4360,6 @@ map0 {
|
|
|
|
gpuss1-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens0 14>;
|
|
|
|
@@ -4402,7 +4387,6 @@ map0 {
|
|
|
|
aoss1-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 0>;
|
|
|
|
@@ -4423,7 +4407,6 @@ aoss1_crit: aoss1-crit {
|
|
|
|
cwlan-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 1>;
|
|
|
|
@@ -4444,7 +4427,6 @@ cwlan_crit: cwlan-crit {
|
|
|
|
audio-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 2>;
|
|
|
|
@@ -4465,7 +4447,6 @@ audio_crit: audio-crit {
|
|
|
|
ddr-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 3>;
|
|
|
|
@@ -4486,7 +4467,6 @@ ddr_crit: ddr-crit {
|
|
|
|
q6-hvx-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 4>;
|
|
|
|
@@ -4507,7 +4487,6 @@ q6_hvx_crit: q6-hvx-crit {
|
|
|
|
camera-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 5>;
|
|
|
|
@@ -4528,7 +4507,6 @@ camera_crit: camera-crit {
|
|
|
|
mdm-core-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 6>;
|
|
|
|
@@ -4549,7 +4527,6 @@ mdm_crit: mdm-crit {
|
|
|
|
mdm-dsp-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 7>;
|
|
|
|
@@ -4570,7 +4547,6 @@ mdm_dsp_crit: mdm-dsp-crit {
|
|
|
|
npu-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 8>;
|
|
|
|
@@ -4591,7 +4567,6 @@ npu_crit: npu-crit {
|
|
|
|
video-thermal {
|
|
polling-delay-passive = <250>;
|
|
- polling-delay = <0>;
|
|
|
|
thermal-sensors = <&tsens1 9>;
|
|
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
|
|
index 149c7962f2cbb7..81e95604ef9870 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
|
|
@@ -80,7 +80,7 @@ xo_board: xo-board {
|
|
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
#clock-cells = <0>;
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
|
|
index 6425c74edd60cc..3e70e79ce24b05 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
|
|
@@ -2642,7 +2642,7 @@ usb_2_qmpphy1: phy@88f1000 {
|
|
|
|
remoteproc_adsp: remoteproc@3000000 {
|
|
compatible = "qcom,sc8280xp-adsp-pas";
|
|
- reg = <0 0x03000000 0 0x100>;
|
|
+ reg = <0 0x03000000 0 0x10000>;
|
|
|
|
interrupts-extended = <&intc GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>,
|
|
<&smp2p_adsp_in 0 IRQ_TYPE_EDGE_RISING>,
|
|
@@ -4399,7 +4399,7 @@ cpufreq_hw: cpufreq@18591000 {
|
|
|
|
remoteproc_nsp0: remoteproc@1b300000 {
|
|
compatible = "qcom,sc8280xp-nsp0-pas";
|
|
- reg = <0 0x1b300000 0 0x100>;
|
|
+ reg = <0 0x1b300000 0 0x10000>;
|
|
|
|
interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_LEVEL_HIGH>,
|
|
<&smp2p_nsp0_in 0 IRQ_TYPE_EDGE_RISING>,
|
|
@@ -4530,7 +4530,7 @@ compute-cb@14 {
|
|
|
|
remoteproc_nsp1: remoteproc@21300000 {
|
|
compatible = "qcom,sc8280xp-nsp1-pas";
|
|
- reg = <0 0x21300000 0 0x100>;
|
|
+ reg = <0 0x21300000 0 0x10000>;
|
|
|
|
interrupts-extended = <&intc GIC_SPI 887 IRQ_TYPE_LEVEL_HIGH>,
|
|
<&smp2p_nsp1_in 0 IRQ_TYPE_EDGE_RISING>,
|
|
diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c-navigation-mezzanine.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c-navigation-mezzanine.dts
|
|
deleted file mode 100644
|
|
index a21caa6f3fa259..00000000000000
|
|
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c-navigation-mezzanine.dts
|
|
+++ /dev/null
|
|
@@ -1,104 +0,0 @@
|
|
-// SPDX-License-Identifier: GPL-2.0
|
|
-/*
|
|
- * Copyright (c) 2022, Linaro Ltd.
|
|
- */
|
|
-
|
|
-/dts-v1/;
|
|
-
|
|
-#include "sdm845-db845c.dts"
|
|
-
|
|
-&camss {
|
|
- vdda-phy-supply = <&vreg_l1a_0p875>;
|
|
- vdda-pll-supply = <&vreg_l26a_1p2>;
|
|
-
|
|
- status = "okay";
|
|
-
|
|
- ports {
|
|
- port@0 {
|
|
- csiphy0_ep: endpoint {
|
|
- data-lanes = <0 1 2 3>;
|
|
- remote-endpoint = <&ov8856_ep>;
|
|
- };
|
|
- };
|
|
- };
|
|
-};
|
|
-
|
|
-&cci {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&cci_i2c0 {
|
|
- camera@10 {
|
|
- compatible = "ovti,ov8856";
|
|
- reg = <0x10>;
|
|
-
|
|
- /* CAM0_RST_N */
|
|
- reset-gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&cam0_default>;
|
|
-
|
|
- clocks = <&clock_camcc CAM_CC_MCLK0_CLK>;
|
|
- clock-names = "xvclk";
|
|
- clock-frequency = <19200000>;
|
|
-
|
|
- /*
|
|
- * The &vreg_s4a_1p8 trace is powered on as a,
|
|
- * so it is represented by a fixed regulator.
|
|
- *
|
|
- * The 2.8V vdda-supply and 1.2V vddd-supply regulators
|
|
- * both have to be enabled through the power management
|
|
- * gpios.
|
|
- */
|
|
- dovdd-supply = <&vreg_lvs1a_1p8>;
|
|
- avdd-supply = <&cam0_avdd_2v8>;
|
|
- dvdd-supply = <&cam0_dvdd_1v2>;
|
|
-
|
|
- port {
|
|
- ov8856_ep: endpoint {
|
|
- link-frequencies = /bits/ 64
|
|
- <360000000 180000000>;
|
|
- data-lanes = <1 2 3 4>;
|
|
- remote-endpoint = <&csiphy0_ep>;
|
|
- };
|
|
- };
|
|
- };
|
|
-};
|
|
-
|
|
-&cci_i2c1 {
|
|
- camera@60 {
|
|
- compatible = "ovti,ov7251";
|
|
-
|
|
- /* I2C address as per ov7251.txt linux documentation */
|
|
- reg = <0x60>;
|
|
-
|
|
- /* CAM3_RST_N */
|
|
- enable-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&cam3_default>;
|
|
-
|
|
- clocks = <&clock_camcc CAM_CC_MCLK3_CLK>;
|
|
- clock-names = "xclk";
|
|
- clock-frequency = <24000000>;
|
|
-
|
|
- /*
|
|
- * The &vreg_s4a_1p8 trace always powered on.
|
|
- *
|
|
- * The 2.8V vdda-supply regulator is enabled when the
|
|
- * vreg_s4a_1p8 trace is pulled high.
|
|
- * It too is represented by a fixed regulator.
|
|
- *
|
|
- * No 1.2V vddd-supply regulator is used.
|
|
- */
|
|
- vdddo-supply = <&vreg_lvs1a_1p8>;
|
|
- vdda-supply = <&cam3_avdd_2v8>;
|
|
-
|
|
- status = "disabled";
|
|
-
|
|
- port {
|
|
- ov7251_ep: endpoint {
|
|
- data-lanes = <0 1>;
|
|
-/* remote-endpoint = <&csiphy3_ep>; */
|
|
- };
|
|
- };
|
|
- };
|
|
-};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c-navigation-mezzanine.dtso b/arch/arm64/boot/dts/qcom/sdm845-db845c-navigation-mezzanine.dtso
|
|
new file mode 100644
|
|
index 00000000000000..51f1a4883ab8f0
|
|
--- /dev/null
|
|
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c-navigation-mezzanine.dtso
|
|
@@ -0,0 +1,70 @@
|
|
+// SPDX-License-Identifier: GPL-2.0
|
|
+/*
|
|
+ * Copyright (c) 2022, Linaro Ltd.
|
|
+ */
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+#include <dt-bindings/clock/qcom,camcc-sdm845.h>
|
|
+#include <dt-bindings/gpio/gpio.h>
|
|
+
|
|
+&camss {
|
|
+ vdda-phy-supply = <&vreg_l1a_0p875>;
|
|
+ vdda-pll-supply = <&vreg_l26a_1p2>;
|
|
+
|
|
+ status = "okay";
|
|
+
|
|
+ ports {
|
|
+ port@0 {
|
|
+ csiphy0_ep: endpoint {
|
|
+ data-lanes = <0 1 2 3>;
|
|
+ remote-endpoint = <&ov8856_ep>;
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&cci {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&cci_i2c0 {
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+
|
|
+ camera@10 {
|
|
+ compatible = "ovti,ov8856";
|
|
+ reg = <0x10>;
|
|
+
|
|
+ /* CAM0_RST_N */
|
|
+ reset-gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&cam0_default>;
|
|
+
|
|
+ clocks = <&clock_camcc CAM_CC_MCLK0_CLK>;
|
|
+ clock-names = "xvclk";
|
|
+ clock-frequency = <19200000>;
|
|
+
|
|
+ /*
|
|
+ * The &vreg_s4a_1p8 trace is powered on as a,
|
|
+ * so it is represented by a fixed regulator.
|
|
+ *
|
|
+ * The 2.8V vdda-supply and 1.2V vddd-supply regulators
|
|
+ * both have to be enabled through the power management
|
|
+ * gpios.
|
|
+ */
|
|
+ dovdd-supply = <&vreg_lvs1a_1p8>;
|
|
+ avdd-supply = <&cam0_avdd_2v8>;
|
|
+ dvdd-supply = <&cam0_dvdd_1v2>;
|
|
+
|
|
+ port {
|
|
+ ov8856_ep: endpoint {
|
|
+ link-frequencies = /bits/ 64
|
|
+ <360000000 180000000>;
|
|
+ data-lanes = <1 2 3 4>;
|
|
+ remote-endpoint = <&csiphy0_ep>;
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
|
|
index dcdc8a0cd1819f..4ea693a0758565 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
|
|
@@ -4244,16 +4244,16 @@ camss: camss@acb3000 {
|
|
"vfe1",
|
|
"vfe_lite";
|
|
|
|
- interrupts = <GIC_SPI 464 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 468 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 477 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 478 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 479 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 448 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 465 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 469 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ interrupts = <GIC_SPI 464 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 466 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 468 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 477 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 478 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 479 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 448 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 465 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 467 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 469 IRQ_TYPE_EDGE_RISING>;
|
|
interrupt-names = "csid0",
|
|
"csid1",
|
|
"csid2",
|
|
diff --git a/arch/arm64/boot/dts/qcom/sdx75.dtsi b/arch/arm64/boot/dts/qcom/sdx75.dtsi
|
|
index e180aa4023eca4..0d1b5712c5067d 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sdx75.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sdx75.dtsi
|
|
@@ -29,7 +29,7 @@ xo_board: xo-board {
|
|
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
#clock-cells = <0>;
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sm4450.dtsi b/arch/arm64/boot/dts/qcom/sm4450.dtsi
|
|
index c4e5b33f5169c8..51240f45c8e846 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sm4450.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sm4450.dtsi
|
|
@@ -23,7 +23,7 @@ xo_board: xo-board {
|
|
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
#clock-cells = <0>;
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sm6125.dtsi b/arch/arm64/boot/dts/qcom/sm6125.dtsi
|
|
index 07081088ba1463..2b2c55132f6739 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sm6125.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sm6125.dtsi
|
|
@@ -28,7 +28,7 @@ xo_board: xo-board {
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
#clock-cells = <0>;
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
clock-output-names = "sleep_clk";
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sm6375.dtsi b/arch/arm64/boot/dts/qcom/sm6375.dtsi
|
|
index e56f7ea4ebc6ae..c5f7715626a09b 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sm6375.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sm6375.dtsi
|
|
@@ -29,7 +29,7 @@ xo_board_clk: xo-board-clk {
|
|
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
#clock-cells = <0>;
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sm7125.dtsi b/arch/arm64/boot/dts/qcom/sm7125.dtsi
|
|
new file mode 100644
|
|
index 00000000000000..a53145a610a3c8
|
|
--- /dev/null
|
|
+++ b/arch/arm64/boot/dts/qcom/sm7125.dtsi
|
|
@@ -0,0 +1,16 @@
|
|
+// SPDX-License-Identifier: GPL-2.0
|
|
+/*
|
|
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
|
|
+ */
|
|
+
|
|
+#include "sc7180.dtsi"
|
|
+
|
|
+/* SM7125 uses Kryo 465 instead of Kryo 468 */
|
|
+&cpu0 { compatible = "qcom,kryo465"; };
|
|
+&cpu1 { compatible = "qcom,kryo465"; };
|
|
+&cpu2 { compatible = "qcom,kryo465"; };
|
|
+&cpu3 { compatible = "qcom,kryo465"; };
|
|
+&cpu4 { compatible = "qcom,kryo465"; };
|
|
+&cpu5 { compatible = "qcom,kryo465"; };
|
|
+&cpu6 { compatible = "qcom,kryo465"; };
|
|
+&cpu7 { compatible = "qcom,kryo465"; };
|
|
diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
|
|
index 18171c5d8a3877..c010e86134ff93 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
|
|
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
|
|
@@ -26,7 +26,7 @@ / {
|
|
chassis-type = "handset";
|
|
|
|
/* required for bootloader to select correct board */
|
|
- qcom,msm-id = <434 0x10000>, <459 0x10000>;
|
|
+ qcom,msm-id = <459 0x10000>;
|
|
qcom,board-id = <8 32>;
|
|
|
|
aliases {
|
|
diff --git a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
|
|
index b039773c44653a..a1323a8b8e6bfb 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
|
|
+++ b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
|
|
@@ -376,8 +376,8 @@ da7280@4a {
|
|
pinctrl-0 = <&da7280_intr_default>;
|
|
|
|
dlg,actuator-type = "LRA";
|
|
- dlg,dlg,const-op-mode = <1>;
|
|
- dlg,dlg,periodic-op-mode = <1>;
|
|
+ dlg,const-op-mode = <1>;
|
|
+ dlg,periodic-op-mode = <1>;
|
|
dlg,nom-microvolt = <2000000>;
|
|
dlg,abs-max-microvolt = <2000000>;
|
|
dlg,imax-microamp = <129000>;
|
|
diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
|
|
index b522d19f3a1327..21bbffc4e5a284 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
|
|
@@ -85,7 +85,7 @@ xo_board: xo-board {
|
|
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
- clock-frequency = <32768>;
|
|
+ clock-frequency = <32764>;
|
|
#clock-cells = <0>;
|
|
};
|
|
};
|
|
@@ -4121,20 +4121,20 @@ camss: camss@ac6a000 {
|
|
"vfe_lite0",
|
|
"vfe_lite1";
|
|
|
|
- interrupts = <GIC_SPI 477 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 478 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 479 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 448 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 464 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 468 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 465 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 469 IRQ_TYPE_LEVEL_HIGH>,
|
|
- <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ interrupts = <GIC_SPI 477 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 478 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 479 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 448 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 86 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 89 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 464 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 466 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 468 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 359 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 465 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 467 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 469 IRQ_TYPE_EDGE_RISING>,
|
|
+ <GIC_SPI 360 IRQ_TYPE_EDGE_RISING>;
|
|
interrupt-names = "csiphy0",
|
|
"csiphy1",
|
|
"csiphy2",
|
|
diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi
|
|
index d4f1b36c7aebe4..dded95fa52f075 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
|
|
@@ -40,7 +40,7 @@ xo_board: xo-board {
|
|
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
#clock-cells = <0>;
|
|
};
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi
|
|
index a34f460240a076..007689d7f4fa20 100644
|
|
--- a/arch/arm64/boot/dts/qcom/sm8450.dtsi
|
|
+++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi
|
|
@@ -40,7 +40,7 @@ xo_board: xo-board {
|
|
sleep_clk: sleep-clk {
|
|
compatible = "fixed-clock";
|
|
#clock-cells = <0>;
|
|
- clock-frequency = <32000>;
|
|
+ clock-frequency = <32764>;
|
|
};
|
|
};
|
|
|
|
diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
|
|
index a9b47ab92a02c7..f156167b4e8a71 100644
|
|
--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
|
|
+++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
|
|
@@ -23,7 +23,6 @@ gic500: interrupt-controller@1800000 {
|
|
interrupt-controller;
|
|
reg = <0x00 0x01800000 0x00 0x10000>, /* GICD */
|
|
<0x00 0x01880000 0x00 0xc0000>, /* GICR */
|
|
- <0x00 0x01880000 0x00 0xc0000>, /* GICR */
|
|
<0x01 0x00000000 0x00 0x2000>, /* GICC */
|
|
<0x01 0x00010000 0x00 0x1000>, /* GICH */
|
|
<0x01 0x00020000 0x00 0x2000>; /* GICV */
|
|
diff --git a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
|
|
index de36abb243f104..1497f7c8adfaf4 100644
|
|
--- a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
|
|
+++ b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
|
|
@@ -18,7 +18,6 @@ gic500: interrupt-controller@1800000 {
|
|
compatible = "arm,gic-v3";
|
|
reg = <0x00 0x01800000 0x00 0x10000>, /* GICD */
|
|
<0x00 0x01880000 0x00 0xc0000>, /* GICR */
|
|
- <0x00 0x01880000 0x00 0xc0000>, /* GICR */
|
|
<0x01 0x00000000 0x00 0x2000>, /* GICC */
|
|
<0x01 0x00010000 0x00 0x1000>, /* GICH */
|
|
<0x01 0x00020000 0x00 0x2000>; /* GICV */
|
|
diff --git a/arch/hexagon/include/asm/cmpxchg.h b/arch/hexagon/include/asm/cmpxchg.h
|
|
index bf6cf5579cf459..9c58fb81f7fd67 100644
|
|
--- a/arch/hexagon/include/asm/cmpxchg.h
|
|
+++ b/arch/hexagon/include/asm/cmpxchg.h
|
|
@@ -56,7 +56,7 @@ __arch_xchg(unsigned long x, volatile void *ptr, int size)
|
|
__typeof__(ptr) __ptr = (ptr); \
|
|
__typeof__(*(ptr)) __old = (old); \
|
|
__typeof__(*(ptr)) __new = (new); \
|
|
- __typeof__(*(ptr)) __oldval = 0; \
|
|
+ __typeof__(*(ptr)) __oldval = (__typeof__(*(ptr))) 0; \
|
|
\
|
|
asm volatile( \
|
|
"1: %0 = memw_locked(%1);\n" \
|
|
diff --git a/arch/hexagon/kernel/traps.c b/arch/hexagon/kernel/traps.c
|
|
index 6447763ce5a941..b7e394cebe20d6 100644
|
|
--- a/arch/hexagon/kernel/traps.c
|
|
+++ b/arch/hexagon/kernel/traps.c
|
|
@@ -195,8 +195,10 @@ int die(const char *str, struct pt_regs *regs, long err)
|
|
printk(KERN_EMERG "Oops: %s[#%d]:\n", str, ++die.counter);
|
|
|
|
if (notify_die(DIE_OOPS, str, regs, err, pt_cause(regs), SIGSEGV) ==
|
|
- NOTIFY_STOP)
|
|
+ NOTIFY_STOP) {
|
|
+ spin_unlock_irq(&die.lock);
|
|
return 1;
|
|
+ }
|
|
|
|
print_modules();
|
|
show_regs(regs);
|
|
diff --git a/arch/loongarch/include/asm/hw_breakpoint.h b/arch/loongarch/include/asm/hw_breakpoint.h
|
|
index d78330916bd18a..13b2462f3d8c9d 100644
|
|
--- a/arch/loongarch/include/asm/hw_breakpoint.h
|
|
+++ b/arch/loongarch/include/asm/hw_breakpoint.h
|
|
@@ -38,8 +38,8 @@ struct arch_hw_breakpoint {
|
|
* Limits.
|
|
* Changing these will require modifications to the register accessors.
|
|
*/
|
|
-#define LOONGARCH_MAX_BRP 8
|
|
-#define LOONGARCH_MAX_WRP 8
|
|
+#define LOONGARCH_MAX_BRP 14
|
|
+#define LOONGARCH_MAX_WRP 14
|
|
|
|
/* Virtual debug register bases. */
|
|
#define CSR_CFG_ADDR 0
|
|
diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h
|
|
index 23232c7bdb9ff5..2c996da6a5bf57 100644
|
|
--- a/arch/loongarch/include/asm/loongarch.h
|
|
+++ b/arch/loongarch/include/asm/loongarch.h
|
|
@@ -928,6 +928,36 @@
|
|
#define LOONGARCH_CSR_DB7CTRL 0x34a /* data breakpoint 7 control */
|
|
#define LOONGARCH_CSR_DB7ASID 0x34b /* data breakpoint 7 asid */
|
|
|
|
+#define LOONGARCH_CSR_DB8ADDR 0x350 /* data breakpoint 8 address */
|
|
+#define LOONGARCH_CSR_DB8MASK 0x351 /* data breakpoint 8 mask */
|
|
+#define LOONGARCH_CSR_DB8CTRL 0x352 /* data breakpoint 8 control */
|
|
+#define LOONGARCH_CSR_DB8ASID 0x353 /* data breakpoint 8 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_DB9ADDR 0x358 /* data breakpoint 9 address */
|
|
+#define LOONGARCH_CSR_DB9MASK 0x359 /* data breakpoint 9 mask */
|
|
+#define LOONGARCH_CSR_DB9CTRL 0x35a /* data breakpoint 9 control */
|
|
+#define LOONGARCH_CSR_DB9ASID 0x35b /* data breakpoint 9 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_DB10ADDR 0x360 /* data breakpoint 10 address */
|
|
+#define LOONGARCH_CSR_DB10MASK 0x361 /* data breakpoint 10 mask */
|
|
+#define LOONGARCH_CSR_DB10CTRL 0x362 /* data breakpoint 10 control */
|
|
+#define LOONGARCH_CSR_DB10ASID 0x363 /* data breakpoint 10 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_DB11ADDR 0x368 /* data breakpoint 11 address */
|
|
+#define LOONGARCH_CSR_DB11MASK 0x369 /* data breakpoint 11 mask */
|
|
+#define LOONGARCH_CSR_DB11CTRL 0x36a /* data breakpoint 11 control */
|
|
+#define LOONGARCH_CSR_DB11ASID 0x36b /* data breakpoint 11 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_DB12ADDR 0x370 /* data breakpoint 12 address */
|
|
+#define LOONGARCH_CSR_DB12MASK 0x371 /* data breakpoint 12 mask */
|
|
+#define LOONGARCH_CSR_DB12CTRL 0x372 /* data breakpoint 12 control */
|
|
+#define LOONGARCH_CSR_DB12ASID 0x373 /* data breakpoint 12 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_DB13ADDR 0x378 /* data breakpoint 13 address */
|
|
+#define LOONGARCH_CSR_DB13MASK 0x379 /* data breakpoint 13 mask */
|
|
+#define LOONGARCH_CSR_DB13CTRL 0x37a /* data breakpoint 13 control */
|
|
+#define LOONGARCH_CSR_DB13ASID 0x37b /* data breakpoint 13 asid */
|
|
+
|
|
#define LOONGARCH_CSR_FWPC 0x380 /* instruction breakpoint config */
|
|
#define LOONGARCH_CSR_FWPS 0x381 /* instruction breakpoint status */
|
|
|
|
@@ -971,6 +1001,36 @@
|
|
#define LOONGARCH_CSR_IB7CTRL 0x3ca /* inst breakpoint 7 control */
|
|
#define LOONGARCH_CSR_IB7ASID 0x3cb /* inst breakpoint 7 asid */
|
|
|
|
+#define LOONGARCH_CSR_IB8ADDR 0x3d0 /* inst breakpoint 8 address */
|
|
+#define LOONGARCH_CSR_IB8MASK 0x3d1 /* inst breakpoint 8 mask */
|
|
+#define LOONGARCH_CSR_IB8CTRL 0x3d2 /* inst breakpoint 8 control */
|
|
+#define LOONGARCH_CSR_IB8ASID 0x3d3 /* inst breakpoint 8 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_IB9ADDR 0x3d8 /* inst breakpoint 9 address */
|
|
+#define LOONGARCH_CSR_IB9MASK 0x3d9 /* inst breakpoint 9 mask */
|
|
+#define LOONGARCH_CSR_IB9CTRL 0x3da /* inst breakpoint 9 control */
|
|
+#define LOONGARCH_CSR_IB9ASID 0x3db /* inst breakpoint 9 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_IB10ADDR 0x3e0 /* inst breakpoint 10 address */
|
|
+#define LOONGARCH_CSR_IB10MASK 0x3e1 /* inst breakpoint 10 mask */
|
|
+#define LOONGARCH_CSR_IB10CTRL 0x3e2 /* inst breakpoint 10 control */
|
|
+#define LOONGARCH_CSR_IB10ASID 0x3e3 /* inst breakpoint 10 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_IB11ADDR 0x3e8 /* inst breakpoint 11 address */
|
|
+#define LOONGARCH_CSR_IB11MASK 0x3e9 /* inst breakpoint 11 mask */
|
|
+#define LOONGARCH_CSR_IB11CTRL 0x3ea /* inst breakpoint 11 control */
|
|
+#define LOONGARCH_CSR_IB11ASID 0x3eb /* inst breakpoint 11 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_IB12ADDR 0x3f0 /* inst breakpoint 12 address */
|
|
+#define LOONGARCH_CSR_IB12MASK 0x3f1 /* inst breakpoint 12 mask */
|
|
+#define LOONGARCH_CSR_IB12CTRL 0x3f2 /* inst breakpoint 12 control */
|
|
+#define LOONGARCH_CSR_IB12ASID 0x3f3 /* inst breakpoint 12 asid */
|
|
+
|
|
+#define LOONGARCH_CSR_IB13ADDR 0x3f8 /* inst breakpoint 13 address */
|
|
+#define LOONGARCH_CSR_IB13MASK 0x3f9 /* inst breakpoint 13 mask */
|
|
+#define LOONGARCH_CSR_IB13CTRL 0x3fa /* inst breakpoint 13 control */
|
|
+#define LOONGARCH_CSR_IB13ASID 0x3fb /* inst breakpoint 13 asid */
|
|
+
|
|
#define LOONGARCH_CSR_DEBUG 0x500 /* debug config */
|
|
#define LOONGARCH_CSR_DERA 0x501 /* debug era */
|
|
#define LOONGARCH_CSR_DESAVE 0x502 /* debug save */
|
|
diff --git a/arch/loongarch/kernel/hw_breakpoint.c b/arch/loongarch/kernel/hw_breakpoint.c
|
|
index a6e4b605bfa8d6..c35f9bf3803349 100644
|
|
--- a/arch/loongarch/kernel/hw_breakpoint.c
|
|
+++ b/arch/loongarch/kernel/hw_breakpoint.c
|
|
@@ -51,7 +51,13 @@ int hw_breakpoint_slots(int type)
|
|
READ_WB_REG_CASE(OFF, 4, REG, T, VAL); \
|
|
READ_WB_REG_CASE(OFF, 5, REG, T, VAL); \
|
|
READ_WB_REG_CASE(OFF, 6, REG, T, VAL); \
|
|
- READ_WB_REG_CASE(OFF, 7, REG, T, VAL);
|
|
+ READ_WB_REG_CASE(OFF, 7, REG, T, VAL); \
|
|
+ READ_WB_REG_CASE(OFF, 8, REG, T, VAL); \
|
|
+ READ_WB_REG_CASE(OFF, 9, REG, T, VAL); \
|
|
+ READ_WB_REG_CASE(OFF, 10, REG, T, VAL); \
|
|
+ READ_WB_REG_CASE(OFF, 11, REG, T, VAL); \
|
|
+ READ_WB_REG_CASE(OFF, 12, REG, T, VAL); \
|
|
+ READ_WB_REG_CASE(OFF, 13, REG, T, VAL);
|
|
|
|
#define GEN_WRITE_WB_REG_CASES(OFF, REG, T, VAL) \
|
|
WRITE_WB_REG_CASE(OFF, 0, REG, T, VAL); \
|
|
@@ -61,7 +67,13 @@ int hw_breakpoint_slots(int type)
|
|
WRITE_WB_REG_CASE(OFF, 4, REG, T, VAL); \
|
|
WRITE_WB_REG_CASE(OFF, 5, REG, T, VAL); \
|
|
WRITE_WB_REG_CASE(OFF, 6, REG, T, VAL); \
|
|
- WRITE_WB_REG_CASE(OFF, 7, REG, T, VAL);
|
|
+ WRITE_WB_REG_CASE(OFF, 7, REG, T, VAL); \
|
|
+ WRITE_WB_REG_CASE(OFF, 8, REG, T, VAL); \
|
|
+ WRITE_WB_REG_CASE(OFF, 9, REG, T, VAL); \
|
|
+ WRITE_WB_REG_CASE(OFF, 10, REG, T, VAL); \
|
|
+ WRITE_WB_REG_CASE(OFF, 11, REG, T, VAL); \
|
|
+ WRITE_WB_REG_CASE(OFF, 12, REG, T, VAL); \
|
|
+ WRITE_WB_REG_CASE(OFF, 13, REG, T, VAL);
|
|
|
|
static u64 read_wb_reg(int reg, int n, int t)
|
|
{
|
|
diff --git a/arch/loongarch/power/platform.c b/arch/loongarch/power/platform.c
|
|
index 3ea8e07aa225f9..6c7735cda4d83f 100644
|
|
--- a/arch/loongarch/power/platform.c
|
|
+++ b/arch/loongarch/power/platform.c
|
|
@@ -17,7 +17,7 @@ void enable_gpe_wakeup(void)
|
|
if (acpi_gbl_reduced_hardware)
|
|
return;
|
|
|
|
- acpi_enable_all_wakeup_gpes();
|
|
+ acpi_hw_enable_all_wakeup_gpes();
|
|
}
|
|
|
|
void enable_pci_wakeup(void)
|
|
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
|
|
index ea71f7245a63e5..8d8f4909ae1a4a 100644
|
|
--- a/arch/powerpc/include/asm/hugetlb.h
|
|
+++ b/arch/powerpc/include/asm/hugetlb.h
|
|
@@ -15,6 +15,15 @@
|
|
|
|
extern bool hugetlb_disabled;
|
|
|
|
+static inline bool hugepages_supported(void)
|
|
+{
|
|
+ if (hugetlb_disabled)
|
|
+ return false;
|
|
+
|
|
+ return HPAGE_SHIFT != 0;
|
|
+}
|
|
+#define hugepages_supported hugepages_supported
|
|
+
|
|
void __init hugetlbpage_init_defaultsize(void);
|
|
|
|
int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
|
|
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
|
|
index 5826f5108a1244..4e4870031265c7 100644
|
|
--- a/arch/powerpc/kernel/smp.c
|
|
+++ b/arch/powerpc/kernel/smp.c
|
|
@@ -1051,7 +1051,7 @@ static struct sched_domain_topology_level powerpc_topology[] = {
|
|
#endif
|
|
{ shared_cache_mask, powerpc_shared_cache_flags, SD_INIT_NAME(CACHE) },
|
|
{ cpu_mc_mask, SD_INIT_NAME(MC) },
|
|
- { cpu_cpu_mask, SD_INIT_NAME(DIE) },
|
|
+ { cpu_cpu_mask, SD_INIT_NAME(PKG) },
|
|
{ NULL, },
|
|
};
|
|
|
|
@@ -1595,7 +1595,7 @@ static void add_cpu_to_masks(int cpu)
|
|
/* Skip all CPUs already part of current CPU core mask */
|
|
cpumask_andnot(mask, cpu_online_mask, cpu_core_mask(cpu));
|
|
|
|
- /* If chip_id is -1; limit the cpu_core_mask to within DIE*/
|
|
+ /* If chip_id is -1; limit the cpu_core_mask to within PKG */
|
|
if (chip_id == -1)
|
|
cpumask_and(mask, mask, cpu_cpu_mask(cpu));
|
|
|
|
diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c
|
|
index f1c0fa6ece21d0..9928b93dbc4d4d 100644
|
|
--- a/arch/powerpc/sysdev/xive/native.c
|
|
+++ b/arch/powerpc/sysdev/xive/native.c
|
|
@@ -559,9 +559,7 @@ bool __init xive_native_init(void)
|
|
struct device_node *np;
|
|
struct resource r;
|
|
void __iomem *tima;
|
|
- struct property *prop;
|
|
u8 max_prio = 7;
|
|
- const __be32 *p;
|
|
u32 val, cpu;
|
|
s64 rc;
|
|
|
|
@@ -592,7 +590,7 @@ bool __init xive_native_init(void)
|
|
max_prio = val - 1;
|
|
|
|
/* Iterate the EQ sizes and pick one */
|
|
- of_property_for_each_u32(np, "ibm,xive-eq-sizes", prop, p, val) {
|
|
+ of_property_for_each_u32(np, "ibm,xive-eq-sizes", val) {
|
|
xive_queue_shift = val;
|
|
if (val == PAGE_SHIFT)
|
|
break;
|
|
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
|
|
index e4541926439100..f2fa985a2c7712 100644
|
|
--- a/arch/powerpc/sysdev/xive/spapr.c
|
|
+++ b/arch/powerpc/sysdev/xive/spapr.c
|
|
@@ -814,7 +814,6 @@ bool __init xive_spapr_init(void)
|
|
struct device_node *np;
|
|
struct resource r;
|
|
void __iomem *tima;
|
|
- struct property *prop;
|
|
u8 max_prio;
|
|
u32 val;
|
|
u32 len;
|
|
@@ -866,7 +865,7 @@ bool __init xive_spapr_init(void)
|
|
}
|
|
|
|
/* Iterate the EQ sizes and pick one */
|
|
- of_property_for_each_u32(np, "ibm,xive-eq-sizes", prop, reg, val) {
|
|
+ of_property_for_each_u32(np, "ibm,xive-eq-sizes", val) {
|
|
xive_queue_shift = val;
|
|
if (val == PAGE_SHIFT)
|
|
break;
|
|
diff --git a/arch/riscv/kernel/vector.c b/arch/riscv/kernel/vector.c
|
|
index 8d92fb6c522cc2..81886fc36ed6ac 100644
|
|
--- a/arch/riscv/kernel/vector.c
|
|
+++ b/arch/riscv/kernel/vector.c
|
|
@@ -270,7 +270,7 @@ static int __init riscv_v_sysctl_init(void)
|
|
static int __init riscv_v_sysctl_init(void) { return 0; }
|
|
#endif /* ! CONFIG_SYSCTL */
|
|
|
|
-static int riscv_v_init(void)
|
|
+static int __init riscv_v_init(void)
|
|
{
|
|
return riscv_v_sysctl_init();
|
|
}
|
|
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
|
|
index 73873e4516866a..b77294ab0c58d7 100644
|
|
--- a/arch/s390/Makefile
|
|
+++ b/arch/s390/Makefile
|
|
@@ -21,7 +21,7 @@ KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__
|
|
ifndef CONFIG_AS_IS_LLVM
|
|
KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf))
|
|
endif
|
|
-KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack
|
|
+KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack -std=gnu11
|
|
KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
|
|
KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
|
|
KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
|
|
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
|
|
index 5466e7bada03d2..65a66df5bb865e 100644
|
|
--- a/arch/s390/kernel/perf_cpum_cf.c
|
|
+++ b/arch/s390/kernel/perf_cpum_cf.c
|
|
@@ -977,7 +977,7 @@ static int cfdiag_push_sample(struct perf_event *event,
|
|
if (event->attr.sample_type & PERF_SAMPLE_RAW) {
|
|
raw.frag.size = cpuhw->usedss;
|
|
raw.frag.data = cpuhw->stop;
|
|
- perf_sample_save_raw_data(&data, &raw);
|
|
+ perf_sample_save_raw_data(&data, event, &raw);
|
|
}
|
|
|
|
overflow = perf_event_overflow(event, &data, ®s);
|
|
diff --git a/arch/s390/kernel/perf_pai_crypto.c b/arch/s390/kernel/perf_pai_crypto.c
|
|
index 4a4e914c283c80..044fba8332b22e 100644
|
|
--- a/arch/s390/kernel/perf_pai_crypto.c
|
|
+++ b/arch/s390/kernel/perf_pai_crypto.c
|
|
@@ -365,7 +365,7 @@ static int paicrypt_push_sample(void)
|
|
if (event->attr.sample_type & PERF_SAMPLE_RAW) {
|
|
raw.frag.size = rawsize;
|
|
raw.frag.data = cpump->save;
|
|
- perf_sample_save_raw_data(&data, &raw);
|
|
+ perf_sample_save_raw_data(&data, event, &raw);
|
|
}
|
|
|
|
overflow = perf_event_overflow(event, &data, ®s);
|
|
diff --git a/arch/s390/kernel/perf_pai_ext.c b/arch/s390/kernel/perf_pai_ext.c
|
|
index b5febe22d05464..089bd3104b3945 100644
|
|
--- a/arch/s390/kernel/perf_pai_ext.c
|
|
+++ b/arch/s390/kernel/perf_pai_ext.c
|
|
@@ -454,7 +454,7 @@ static int paiext_push_sample(void)
|
|
if (event->attr.sample_type & PERF_SAMPLE_RAW) {
|
|
raw.frag.size = rawsize;
|
|
raw.frag.data = cpump->save;
|
|
- perf_sample_save_raw_data(&data, &raw);
|
|
+ perf_sample_save_raw_data(&data, event, &raw);
|
|
}
|
|
|
|
overflow = perf_event_overflow(event, &data, ®s);
|
|
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
|
|
index 68adf1de8888b2..66bda6a8f918c2 100644
|
|
--- a/arch/s390/kernel/topology.c
|
|
+++ b/arch/s390/kernel/topology.c
|
|
@@ -522,7 +522,7 @@ static struct sched_domain_topology_level s390_topology[] = {
|
|
{ cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) },
|
|
{ cpu_book_mask, SD_INIT_NAME(BOOK) },
|
|
{ cpu_drawer_mask, SD_INIT_NAME(DRAWER) },
|
|
- { cpu_cpu_mask, SD_INIT_NAME(DIE) },
|
|
+ { cpu_cpu_mask, SD_INIT_NAME(PKG) },
|
|
{ NULL, },
|
|
};
|
|
|
|
diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
|
|
index 4e930f56687899..fe7e71f91711b2 100644
|
|
--- a/arch/s390/purgatory/Makefile
|
|
+++ b/arch/s390/purgatory/Makefile
|
|
@@ -21,7 +21,7 @@ UBSAN_SANITIZE := n
|
|
KASAN_SANITIZE := n
|
|
KCSAN_SANITIZE := n
|
|
|
|
-KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
|
|
+KBUILD_CFLAGS := -std=gnu11 -fno-strict-aliasing -Wall -Wstrict-prototypes
|
|
KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
|
|
KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
|
|
KBUILD_CFLAGS += -Os -m64 -msoft-float -fno-common
|
|
diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
|
|
index 6911c5399d02f3..f483874fa20f19 100644
|
|
--- a/arch/x86/events/amd/ibs.c
|
|
+++ b/arch/x86/events/amd/ibs.c
|
|
@@ -1115,7 +1115,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
|
|
.data = ibs_data.data,
|
|
},
|
|
};
|
|
- perf_sample_save_raw_data(&data, &raw);
|
|
+ perf_sample_save_raw_data(&data, event, &raw);
|
|
}
|
|
|
|
if (perf_ibs == &perf_ibs_op)
|
|
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
|
|
index ce77dac9a0202a..a8f2ab816d5ae2 100644
|
|
--- a/arch/x86/kernel/smpboot.c
|
|
+++ b/arch/x86/kernel/smpboot.c
|
|
@@ -604,14 +604,6 @@ static int x86_cluster_flags(void)
|
|
}
|
|
#endif
|
|
|
|
-static int x86_die_flags(void)
|
|
-{
|
|
- if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU))
|
|
- return x86_sched_itmt_flags();
|
|
-
|
|
- return 0;
|
|
-}
|
|
-
|
|
/*
|
|
* Set if a package/die has multiple NUMA nodes inside.
|
|
* AMD Magny-Cours, Intel Cluster-on-Die, and Intel
|
|
@@ -641,13 +633,13 @@ static void __init build_sched_topology(void)
|
|
};
|
|
#endif
|
|
/*
|
|
- * When there is NUMA topology inside the package skip the DIE domain
|
|
+ * When there is NUMA topology inside the package skip the PKG domain
|
|
* since the NUMA domains will auto-magically create the right spanning
|
|
* domains based on the SLIT.
|
|
*/
|
|
if (!x86_has_numa_in_package) {
|
|
x86_topology[i++] = (struct sched_domain_topology_level){
|
|
- cpu_cpu_mask, x86_die_flags, SD_INIT_NAME(DIE)
|
|
+ cpu_cpu_mask, x86_sched_itmt_flags, SD_INIT_NAME(PKG)
|
|
};
|
|
}
|
|
|
|
diff --git a/block/genhd.c b/block/genhd.c
|
|
index 6d704c37f26e71..8f72539e08dea3 100644
|
|
--- a/block/genhd.c
|
|
+++ b/block/genhd.c
|
|
@@ -763,7 +763,7 @@ static ssize_t disk_badblocks_store(struct device *dev,
|
|
}
|
|
|
|
#ifdef CONFIG_BLOCK_LEGACY_AUTOLOAD
|
|
-void blk_request_module(dev_t devt)
|
|
+static bool blk_probe_dev(dev_t devt)
|
|
{
|
|
unsigned int major = MAJOR(devt);
|
|
struct blk_major_name **n;
|
|
@@ -773,14 +773,26 @@ void blk_request_module(dev_t devt)
|
|
if ((*n)->major == major && (*n)->probe) {
|
|
(*n)->probe(devt);
|
|
mutex_unlock(&major_names_lock);
|
|
- return;
|
|
+ return true;
|
|
}
|
|
}
|
|
mutex_unlock(&major_names_lock);
|
|
+ return false;
|
|
+}
|
|
+
|
|
+void blk_request_module(dev_t devt)
|
|
+{
|
|
+ int error;
|
|
+
|
|
+ if (blk_probe_dev(devt))
|
|
+ return;
|
|
|
|
- if (request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt)) > 0)
|
|
- /* Make old-style 2.4 aliases work */
|
|
- request_module("block-major-%d", MAJOR(devt));
|
|
+ error = request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt));
|
|
+ /* Make old-style 2.4 aliases work */
|
|
+ if (error > 0)
|
|
+ error = request_module("block-major-%d", MAJOR(devt));
|
|
+ if (!error)
|
|
+ blk_probe_dev(devt);
|
|
}
|
|
#endif /* CONFIG_BLOCK_LEGACY_AUTOLOAD */
|
|
|
|
diff --git a/block/partitions/ldm.h b/block/partitions/ldm.h
|
|
index 0a747a0c782d5d..f98dbee9414977 100644
|
|
--- a/block/partitions/ldm.h
|
|
+++ b/block/partitions/ldm.h
|
|
@@ -1,5 +1,5 @@
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
-/**
|
|
+/*
|
|
* ldm - Part of the Linux-NTFS project.
|
|
*
|
|
* Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org>
|
|
diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h
|
|
index 79bbfe00d241f9..b8543a34caeada 100644
|
|
--- a/drivers/acpi/acpica/achware.h
|
|
+++ b/drivers/acpi/acpica/achware.h
|
|
@@ -103,8 +103,6 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
|
|
|
|
acpi_status acpi_hw_enable_all_runtime_gpes(void);
|
|
|
|
-acpi_status acpi_hw_enable_all_wakeup_gpes(void);
|
|
-
|
|
u8 acpi_hw_check_all_gpes(acpi_handle gpe_skip_device, u32 gpe_skip_number);
|
|
|
|
acpi_status
|
|
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
|
|
index 9dccbae9e8ea76..e416897e3931c4 100644
|
|
--- a/drivers/acpi/fan_core.c
|
|
+++ b/drivers/acpi/fan_core.c
|
|
@@ -367,19 +367,25 @@ static int acpi_fan_probe(struct platform_device *pdev)
|
|
result = sysfs_create_link(&pdev->dev.kobj,
|
|
&cdev->device.kobj,
|
|
"thermal_cooling");
|
|
- if (result)
|
|
+ if (result) {
|
|
dev_err(&pdev->dev, "Failed to create sysfs link 'thermal_cooling'\n");
|
|
+ goto err_unregister;
|
|
+ }
|
|
|
|
result = sysfs_create_link(&cdev->device.kobj,
|
|
&pdev->dev.kobj,
|
|
"device");
|
|
if (result) {
|
|
dev_err(&pdev->dev, "Failed to create sysfs link 'device'\n");
|
|
- goto err_end;
|
|
+ goto err_remove_link;
|
|
}
|
|
|
|
return 0;
|
|
|
|
+err_remove_link:
|
|
+ sysfs_remove_link(&pdev->dev.kobj, "thermal_cooling");
|
|
+err_unregister:
|
|
+ thermal_cooling_device_unregister(cdev);
|
|
err_end:
|
|
if (fan->acpi4)
|
|
acpi_fan_delete_attributes(device);
|
|
diff --git a/drivers/base/class.c b/drivers/base/class.c
|
|
index 9cd489a5770866..695e7fba580b90 100644
|
|
--- a/drivers/base/class.c
|
|
+++ b/drivers/base/class.c
|
|
@@ -314,8 +314,12 @@ void class_dev_iter_init(struct class_dev_iter *iter, const struct class *class,
|
|
struct subsys_private *sp = class_to_subsys(class);
|
|
struct klist_node *start_knode = NULL;
|
|
|
|
- if (!sp)
|
|
+ memset(iter, 0, sizeof(*iter));
|
|
+ if (!sp) {
|
|
+ pr_crit("%s: class %p was not registered yet\n",
|
|
+ __func__, class);
|
|
return;
|
|
+ }
|
|
|
|
if (start)
|
|
start_knode = &start->p->knode_class;
|
|
@@ -342,6 +346,9 @@ struct device *class_dev_iter_next(struct class_dev_iter *iter)
|
|
struct klist_node *knode;
|
|
struct device *dev;
|
|
|
|
+ if (!iter->sp)
|
|
+ return NULL;
|
|
+
|
|
while (1) {
|
|
knode = klist_next(&iter->ki);
|
|
if (!knode)
|
|
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
|
|
index 96b349148e5788..2203686156bfe0 100644
|
|
--- a/drivers/block/nbd.c
|
|
+++ b/drivers/block/nbd.c
|
|
@@ -2164,6 +2164,7 @@ static void nbd_disconnect_and_put(struct nbd_device *nbd)
|
|
flush_workqueue(nbd->recv_workq);
|
|
nbd_clear_que(nbd);
|
|
nbd->task_setup = NULL;
|
|
+ clear_bit(NBD_RT_BOUND, &nbd->config->runtime_flags);
|
|
mutex_unlock(&nbd->config_lock);
|
|
|
|
if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF,
|
|
diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
|
|
index e809bb2dbe5e07..a4274d8c7faaf3 100644
|
|
--- a/drivers/bluetooth/btnxpuart.c
|
|
+++ b/drivers/bluetooth/btnxpuart.c
|
|
@@ -1280,13 +1280,12 @@ static void btnxpuart_tx_work(struct work_struct *work)
|
|
|
|
while ((skb = nxp_dequeue(nxpdev))) {
|
|
len = serdev_device_write_buf(serdev, skb->data, skb->len);
|
|
- serdev_device_wait_until_sent(serdev, 0);
|
|
hdev->stat.byte_tx += len;
|
|
|
|
skb_pull(skb, len);
|
|
if (skb->len > 0) {
|
|
skb_queue_head(&nxpdev->txq, skb);
|
|
- break;
|
|
+ continue;
|
|
}
|
|
|
|
switch (hci_skb_pkt_type(skb)) {
|
|
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
|
|
index 9ed9239b1228f6..65163312dab8ac 100644
|
|
--- a/drivers/bus/ti-sysc.c
|
|
+++ b/drivers/bus/ti-sysc.c
|
|
@@ -2283,11 +2283,9 @@ static int sysc_init_idlemode(struct sysc *ddata, u8 *idlemodes,
|
|
const char *name)
|
|
{
|
|
struct device_node *np = ddata->dev->of_node;
|
|
- struct property *prop;
|
|
- const __be32 *p;
|
|
u32 val;
|
|
|
|
- of_property_for_each_u32(np, name, prop, p, val) {
|
|
+ of_property_for_each_u32(np, name, val) {
|
|
if (val >= SYSC_NR_IDLEMODES) {
|
|
dev_err(ddata->dev, "invalid idlemode: %i\n", val);
|
|
return -EINVAL;
|
|
diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c
|
|
index 49100845fcb7bb..93718919151292 100644
|
|
--- a/drivers/char/ipmi/ipmb_dev_int.c
|
|
+++ b/drivers/char/ipmi/ipmb_dev_int.c
|
|
@@ -321,6 +321,9 @@ static int ipmb_probe(struct i2c_client *client)
|
|
ipmb_dev->miscdev.name = devm_kasprintf(&client->dev, GFP_KERNEL,
|
|
"%s%d", "ipmb-",
|
|
client->adapter->nr);
|
|
+ if (!ipmb_dev->miscdev.name)
|
|
+ return -ENOMEM;
|
|
+
|
|
ipmb_dev->miscdev.fops = &ipmb_fops;
|
|
ipmb_dev->miscdev.parent = &client->dev;
|
|
ret = misc_register(&ipmb_dev->miscdev);
|
|
diff --git a/drivers/char/ipmi/ssif_bmc.c b/drivers/char/ipmi/ssif_bmc.c
|
|
index ab4e87a99f0874..e8460e966b83e8 100644
|
|
--- a/drivers/char/ipmi/ssif_bmc.c
|
|
+++ b/drivers/char/ipmi/ssif_bmc.c
|
|
@@ -292,7 +292,6 @@ static void complete_response(struct ssif_bmc_ctx *ssif_bmc)
|
|
ssif_bmc->nbytes_processed = 0;
|
|
ssif_bmc->remain_len = 0;
|
|
ssif_bmc->busy = false;
|
|
- memset(&ssif_bmc->part_buf, 0, sizeof(struct ssif_part_buffer));
|
|
wake_up_all(&ssif_bmc->wait_queue);
|
|
}
|
|
|
|
@@ -744,9 +743,11 @@ static void on_stop_event(struct ssif_bmc_ctx *ssif_bmc, u8 *val)
|
|
ssif_bmc->aborting = true;
|
|
}
|
|
} else if (ssif_bmc->state == SSIF_RES_SENDING) {
|
|
- if (ssif_bmc->is_singlepart_read || ssif_bmc->block_num == 0xFF)
|
|
+ if (ssif_bmc->is_singlepart_read || ssif_bmc->block_num == 0xFF) {
|
|
+ memset(&ssif_bmc->part_buf, 0, sizeof(struct ssif_part_buffer));
|
|
/* Invalidate response buffer to denote it is sent */
|
|
complete_response(ssif_bmc);
|
|
+ }
|
|
ssif_bmc->state = SSIF_READY;
|
|
}
|
|
|
|
diff --git a/drivers/clk/analogbits/wrpll-cln28hpc.c b/drivers/clk/analogbits/wrpll-cln28hpc.c
|
|
index 09ca8235639930..d8ae3929599697 100644
|
|
--- a/drivers/clk/analogbits/wrpll-cln28hpc.c
|
|
+++ b/drivers/clk/analogbits/wrpll-cln28hpc.c
|
|
@@ -291,7 +291,7 @@ int wrpll_configure_for_rate(struct wrpll_cfg *c, u32 target_rate,
|
|
vco = vco_pre * f;
|
|
}
|
|
|
|
- delta = abs(target_rate - vco);
|
|
+ delta = abs(target_vco_rate - vco);
|
|
if (delta < best_delta) {
|
|
best_delta = delta;
|
|
best_r = r;
|
|
diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
|
|
index 1a4e6340f95ce4..05842056202079 100644
|
|
--- a/drivers/clk/clk-conf.c
|
|
+++ b/drivers/clk/clk-conf.c
|
|
@@ -81,13 +81,11 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
|
|
static int __set_clk_rates(struct device_node *node, bool clk_supplier)
|
|
{
|
|
struct of_phandle_args clkspec;
|
|
- struct property *prop;
|
|
- const __be32 *cur;
|
|
int rc, index = 0;
|
|
struct clk *clk;
|
|
u32 rate;
|
|
|
|
- of_property_for_each_u32(node, "assigned-clock-rates", prop, cur, rate) {
|
|
+ of_property_for_each_u32(node, "assigned-clock-rates", rate) {
|
|
if (rate) {
|
|
rc = of_parse_phandle_with_args(node, "assigned-clocks",
|
|
"#clock-cells", index, &clkspec);
|
|
diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c
|
|
index 00fb9b09e030c3..dd3573da12545c 100644
|
|
--- a/drivers/clk/clk-si5351.c
|
|
+++ b/drivers/clk/clk-si5351.c
|
|
@@ -506,6 +506,8 @@ static int si5351_pll_set_rate(struct clk_hw *hw, unsigned long rate,
|
|
{
|
|
struct si5351_hw_data *hwdata =
|
|
container_of(hw, struct si5351_hw_data, hw);
|
|
+ struct si5351_platform_data *pdata =
|
|
+ hwdata->drvdata->client->dev.platform_data;
|
|
u8 reg = (hwdata->num == 0) ? SI5351_PLLA_PARAMETERS :
|
|
SI5351_PLLB_PARAMETERS;
|
|
|
|
@@ -518,9 +520,10 @@ static int si5351_pll_set_rate(struct clk_hw *hw, unsigned long rate,
|
|
(hwdata->params.p2 == 0) ? SI5351_CLK_INTEGER_MODE : 0);
|
|
|
|
/* Do a pll soft reset on the affected pll */
|
|
- si5351_reg_write(hwdata->drvdata, SI5351_PLL_RESET,
|
|
- hwdata->num == 0 ? SI5351_PLL_RESET_A :
|
|
- SI5351_PLL_RESET_B);
|
|
+ if (pdata->pll_reset[hwdata->num])
|
|
+ si5351_reg_write(hwdata->drvdata, SI5351_PLL_RESET,
|
|
+ hwdata->num == 0 ? SI5351_PLL_RESET_A :
|
|
+ SI5351_PLL_RESET_B);
|
|
|
|
dev_dbg(&hwdata->drvdata->client->dev,
|
|
"%s - %s: p1 = %lu, p2 = %lu, p3 = %lu, parent_rate = %lu, rate = %lu\n",
|
|
@@ -1172,8 +1175,8 @@ static int si5351_dt_parse(struct i2c_client *client,
|
|
{
|
|
struct device_node *child, *np = client->dev.of_node;
|
|
struct si5351_platform_data *pdata;
|
|
- struct property *prop;
|
|
- const __be32 *p;
|
|
+ u32 array[4];
|
|
+ int sz, i;
|
|
int num = 0;
|
|
u32 val;
|
|
|
|
@@ -1188,20 +1191,24 @@ static int si5351_dt_parse(struct i2c_client *client,
|
|
* property silabs,pll-source : <num src>, [<..>]
|
|
* allow to selectively set pll source
|
|
*/
|
|
- of_property_for_each_u32(np, "silabs,pll-source", prop, p, num) {
|
|
+ sz = of_property_read_variable_u32_array(np, "silabs,pll-source", array, 2, 4);
|
|
+ sz = (sz == -EINVAL) ? 0 : sz; /* Missing property is OK */
|
|
+ if (sz < 0)
|
|
+ return dev_err_probe(&client->dev, sz, "invalid pll-source\n");
|
|
+ if (sz % 2)
|
|
+ return dev_err_probe(&client->dev, -EINVAL,
|
|
+ "missing pll-source for pll %d\n", array[sz - 1]);
|
|
+
|
|
+ for (i = 0; i < sz; i += 2) {
|
|
+ num = array[i];
|
|
+ val = array[i + 1];
|
|
+
|
|
if (num >= 2) {
|
|
dev_err(&client->dev,
|
|
"invalid pll %d on pll-source prop\n", num);
|
|
return -EINVAL;
|
|
}
|
|
|
|
- p = of_prop_next_u32(prop, p, &val);
|
|
- if (!p) {
|
|
- dev_err(&client->dev,
|
|
- "missing pll-source for pll %d\n", num);
|
|
- return -EINVAL;
|
|
- }
|
|
-
|
|
switch (val) {
|
|
case 0:
|
|
pdata->pll_src[num] = SI5351_PLL_SRC_XTAL;
|
|
@@ -1222,6 +1229,49 @@ static int si5351_dt_parse(struct i2c_client *client,
|
|
}
|
|
}
|
|
|
|
+ /*
|
|
+ * Parse PLL reset mode. For compatibility with older device trees, the
|
|
+ * default is to always reset a PLL after setting its rate.
|
|
+ */
|
|
+ pdata->pll_reset[0] = true;
|
|
+ pdata->pll_reset[1] = true;
|
|
+
|
|
+ sz = of_property_read_variable_u32_array(np, "silabs,pll-reset-mode", array, 2, 4);
|
|
+ sz = (sz == -EINVAL) ? 0 : sz; /* Missing property is OK */
|
|
+ if (sz < 0)
|
|
+ return dev_err_probe(&client->dev, sz, "invalid pll-reset-mode\n");
|
|
+ if (sz % 2)
|
|
+ return dev_err_probe(&client->dev, -EINVAL,
|
|
+ "missing pll-reset-mode for pll %d\n", array[sz - 1]);
|
|
+
|
|
+ for (i = 0; i < sz; i += 2) {
|
|
+ num = array[i];
|
|
+ val = array[i + 1];
|
|
+
|
|
+ if (num >= 2) {
|
|
+ dev_err(&client->dev,
|
|
+ "invalid pll %d on pll-reset-mode prop\n", num);
|
|
+ return -EINVAL;
|
|
+ }
|
|
+
|
|
+
|
|
+ switch (val) {
|
|
+ case 0:
|
|
+ /* Reset PLL whenever its rate is adjusted */
|
|
+ pdata->pll_reset[num] = true;
|
|
+ break;
|
|
+ case 1:
|
|
+ /* Don't reset PLL whenever its rate is adjusted */
|
|
+ pdata->pll_reset[num] = false;
|
|
+ break;
|
|
+ default:
|
|
+ dev_err(&client->dev,
|
|
+ "invalid pll-reset-mode %d for pll %d\n", val,
|
|
+ num);
|
|
+ return -EINVAL;
|
|
+ }
|
|
+ }
|
|
+
|
|
/* per clkout properties */
|
|
for_each_child_of_node(np, child) {
|
|
if (of_property_read_u32(child, "reg", &num)) {
|
|
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
|
|
index f8776065ad1f19..5bbd036f5295f5 100644
|
|
--- a/drivers/clk/clk.c
|
|
+++ b/drivers/clk/clk.c
|
|
@@ -5316,9 +5316,8 @@ EXPORT_SYMBOL_GPL(of_clk_get_parent_count);
|
|
const char *of_clk_get_parent_name(const struct device_node *np, int index)
|
|
{
|
|
struct of_phandle_args clkspec;
|
|
- struct property *prop;
|
|
const char *clk_name;
|
|
- const __be32 *vp;
|
|
+ bool found = false;
|
|
u32 pv;
|
|
int rc;
|
|
int count;
|
|
@@ -5335,16 +5334,19 @@ const char *of_clk_get_parent_name(const struct device_node *np, int index)
|
|
/* if there is an indices property, use it to transfer the index
|
|
* specified into an array offset for the clock-output-names property.
|
|
*/
|
|
- of_property_for_each_u32(clkspec.np, "clock-indices", prop, vp, pv) {
|
|
+ of_property_for_each_u32(clkspec.np, "clock-indices", pv) {
|
|
if (index == pv) {
|
|
index = count;
|
|
+ found = true;
|
|
break;
|
|
}
|
|
count++;
|
|
}
|
|
/* We went off the end of 'clock-indices' without finding it */
|
|
- if (prop && !vp)
|
|
+ if (of_property_present(clkspec.np, "clock-indices") && !found) {
|
|
+ of_node_put(clkspec.np);
|
|
return NULL;
|
|
+ }
|
|
|
|
if (of_property_read_string_index(clkspec.np, "clock-output-names",
|
|
index,
|
|
@@ -5456,14 +5458,12 @@ static int parent_ready(struct device_node *np)
|
|
int of_clk_detect_critical(struct device_node *np, int index,
|
|
unsigned long *flags)
|
|
{
|
|
- struct property *prop;
|
|
- const __be32 *cur;
|
|
uint32_t idx;
|
|
|
|
if (!np || !flags)
|
|
return -EINVAL;
|
|
|
|
- of_property_for_each_u32(np, "clock-critical", prop, cur, idx)
|
|
+ of_property_for_each_u32(np, "clock-critical", idx)
|
|
if (index == idx)
|
|
*flags |= CLK_IS_CRITICAL;
|
|
|
|
diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
|
|
index e561ff7b135fb5..747f5397692e5f 100644
|
|
--- a/drivers/clk/imx/clk-imx8mp.c
|
|
+++ b/drivers/clk/imx/clk-imx8mp.c
|
|
@@ -399,8 +399,9 @@ static const char * const imx8mp_dram_core_sels[] = {"dram_pll_out", "dram_alt_r
|
|
|
|
static const char * const imx8mp_clkout_sels[] = {"audio_pll1_out", "audio_pll2_out", "video_pll1_out",
|
|
"dummy", "dummy", "gpu_pll_out", "vpu_pll_out",
|
|
- "arm_pll_out", "sys_pll1", "sys_pll2", "sys_pll3",
|
|
- "dummy", "dummy", "osc_24m", "dummy", "osc_32k"};
|
|
+ "arm_pll_out", "sys_pll1_out", "sys_pll2_out",
|
|
+ "sys_pll3_out", "dummy", "dummy", "osc_24m",
|
|
+ "dummy", "osc_32k"};
|
|
|
|
static struct clk_hw **hws;
|
|
static struct clk_hw_onecell_data *clk_hw_data;
|
|
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
|
|
index 75f09e6e057e1a..35bd987f2e52ab 100644
|
|
--- a/drivers/clk/qcom/common.c
|
|
+++ b/drivers/clk/qcom/common.c
|
|
@@ -208,11 +208,9 @@ EXPORT_SYMBOL_GPL(qcom_cc_register_sleep_clk);
|
|
static void qcom_cc_drop_protected(struct device *dev, struct qcom_cc *cc)
|
|
{
|
|
struct device_node *np = dev->of_node;
|
|
- struct property *prop;
|
|
- const __be32 *p;
|
|
u32 i;
|
|
|
|
- of_property_for_each_u32(np, "protected-clocks", prop, p, i) {
|
|
+ of_property_for_each_u32(np, "protected-clocks", i) {
|
|
if (i >= cc->num_rclks)
|
|
continue;
|
|
|
|
diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c
|
|
index ea4c3bf4fb9bf7..1a23bfd9356d58 100644
|
|
--- a/drivers/clk/qcom/gcc-sdm845.c
|
|
+++ b/drivers/clk/qcom/gcc-sdm845.c
|
|
@@ -454,7 +454,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s0_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap0_s0_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = {
|
|
@@ -470,7 +470,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s1_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap0_s1_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = {
|
|
@@ -486,7 +486,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s2_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap0_s2_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = {
|
|
@@ -502,7 +502,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s3_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap0_s3_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = {
|
|
@@ -518,7 +518,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s4_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap0_s4_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = {
|
|
@@ -534,7 +534,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s5_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap0_s5_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = {
|
|
@@ -550,7 +550,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s6_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap0_s6_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = {
|
|
@@ -566,7 +566,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s7_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap0_s7_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = {
|
|
@@ -582,7 +582,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s0_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap1_s0_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
|
|
@@ -598,7 +598,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s1_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap1_s1_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
|
|
@@ -614,7 +614,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s2_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap1_s2_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = {
|
|
@@ -630,7 +630,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s3_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap1_s3_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
|
|
@@ -646,7 +646,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s4_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap1_s4_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
|
|
@@ -662,7 +662,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s5_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap1_s5_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
|
|
@@ -678,7 +678,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s6_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap1_s6_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
|
|
@@ -694,7 +694,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s7_clk_src_init = {
|
|
.name = "gcc_qupv3_wrap1_s7_clk_src",
|
|
.parent_data = gcc_parent_data_0,
|
|
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
|
|
- .ops = &clk_rcg2_shared_ops,
|
|
+ .ops = &clk_rcg2_ops,
|
|
};
|
|
|
|
static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {
|
|
diff --git a/drivers/clk/ralink/clk-mtmips.c b/drivers/clk/ralink/clk-mtmips.c
|
|
index 76285fbbdeaa2d..4b5d8b741e4e17 100644
|
|
--- a/drivers/clk/ralink/clk-mtmips.c
|
|
+++ b/drivers/clk/ralink/clk-mtmips.c
|
|
@@ -264,7 +264,6 @@ static int mtmips_register_pherip_clocks(struct device_node *np,
|
|
}
|
|
|
|
static struct mtmips_clk_fixed rt3883_fixed_clocks[] = {
|
|
- CLK_FIXED("xtal", NULL, 40000000),
|
|
CLK_FIXED("periph", "xtal", 40000000)
|
|
};
|
|
|
|
diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
|
|
index 6a4b2b9ef30a82..aee1a2f14c9517 100644
|
|
--- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
|
|
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
|
|
@@ -533,11 +533,11 @@ static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents,
|
|
CLK_SET_RATE_PARENT);
|
|
|
|
/*
|
|
- * DSI output seems to work only when PLL_MIPI selected. Set it and prevent
|
|
- * the mux from reparenting.
|
|
+ * Experiments showed that RGB output requires pll-video0-2x, while DSI
|
|
+ * requires pll-mipi. It will not work with incorrect clock, the screen will
|
|
+ * be blank.
|
|
+ * sun50i-a64.dtsi assigns pll-mipi as TCON0 parent by default
|
|
*/
|
|
-#define SUN50I_A64_TCON0_CLK_REG 0x118
|
|
-
|
|
static const char * const tcon0_parents[] = { "pll-mipi", "pll-video0-2x" };
|
|
static const u8 tcon0_table[] = { 0, 2, };
|
|
static SUNXI_CCU_MUX_TABLE_WITH_GATE_CLOSEST(tcon0_clk, "tcon0", tcon0_parents,
|
|
@@ -957,11 +957,6 @@ static int sun50i_a64_ccu_probe(struct platform_device *pdev)
|
|
|
|
writel(0x515, reg + SUN50I_A64_PLL_MIPI_REG);
|
|
|
|
- /* Set PLL MIPI as parent for TCON0 */
|
|
- val = readl(reg + SUN50I_A64_TCON0_CLK_REG);
|
|
- val &= ~GENMASK(26, 24);
|
|
- writel(val | (0 << 24), reg + SUN50I_A64_TCON0_CLK_REG);
|
|
-
|
|
ret = devm_sunxi_ccu_probe(&pdev->dev, reg, &sun50i_a64_ccu_desc);
|
|
if (ret)
|
|
return ret;
|
|
diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.h b/drivers/clk/sunxi-ng/ccu-sun50i-a64.h
|
|
index a8c11c0b4e0676..dfba88a5ad0f7c 100644
|
|
--- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.h
|
|
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.h
|
|
@@ -21,7 +21,6 @@
|
|
|
|
/* PLL_VIDEO0 exported for HDMI PHY */
|
|
|
|
-#define CLK_PLL_VIDEO0_2X 8
|
|
#define CLK_PLL_VE 9
|
|
#define CLK_PLL_DDR0 10
|
|
|
|
@@ -32,7 +31,6 @@
|
|
#define CLK_PLL_PERIPH1_2X 14
|
|
#define CLK_PLL_VIDEO1 15
|
|
#define CLK_PLL_GPU 16
|
|
-#define CLK_PLL_MIPI 17
|
|
#define CLK_PLL_HSIC 18
|
|
#define CLK_PLL_DE 19
|
|
#define CLK_PLL_DDR1 20
|
|
diff --git a/drivers/clk/sunxi/clk-simple-gates.c b/drivers/clk/sunxi/clk-simple-gates.c
|
|
index 0399627c226a68..845efc1ec800b9 100644
|
|
--- a/drivers/clk/sunxi/clk-simple-gates.c
|
|
+++ b/drivers/clk/sunxi/clk-simple-gates.c
|
|
@@ -21,11 +21,9 @@ static void __init sunxi_simple_gates_setup(struct device_node *node,
|
|
{
|
|
struct clk_onecell_data *clk_data;
|
|
const char *clk_parent, *clk_name;
|
|
- struct property *prop;
|
|
struct resource res;
|
|
void __iomem *clk_reg;
|
|
void __iomem *reg;
|
|
- const __be32 *p;
|
|
int number, i = 0, j;
|
|
u8 clk_bit;
|
|
u32 index;
|
|
@@ -47,7 +45,7 @@ static void __init sunxi_simple_gates_setup(struct device_node *node,
|
|
if (!clk_data->clks)
|
|
goto err_free_data;
|
|
|
|
- of_property_for_each_u32(node, "clock-indices", prop, p, index) {
|
|
+ of_property_for_each_u32(node, "clock-indices", index) {
|
|
of_property_read_string_index(node, "clock-output-names",
|
|
i, &clk_name);
|
|
|
|
diff --git a/drivers/clk/sunxi/clk-sun8i-bus-gates.c b/drivers/clk/sunxi/clk-sun8i-bus-gates.c
|
|
index b87f331f63c9e8..8482ac8e5898a0 100644
|
|
--- a/drivers/clk/sunxi/clk-sun8i-bus-gates.c
|
|
+++ b/drivers/clk/sunxi/clk-sun8i-bus-gates.c
|
|
@@ -24,11 +24,9 @@ static void __init sun8i_h3_bus_gates_init(struct device_node *node)
|
|
const char *parents[PARENT_MAX];
|
|
struct clk_onecell_data *clk_data;
|
|
const char *clk_name;
|
|
- struct property *prop;
|
|
struct resource res;
|
|
void __iomem *clk_reg;
|
|
void __iomem *reg;
|
|
- const __be32 *p;
|
|
int number, i;
|
|
u8 clk_bit;
|
|
int index;
|
|
@@ -58,7 +56,7 @@ static void __init sun8i_h3_bus_gates_init(struct device_node *node)
|
|
goto err_free_data;
|
|
|
|
i = 0;
|
|
- of_property_for_each_u32(node, "clock-indices", prop, p, index) {
|
|
+ of_property_for_each_u32(node, "clock-indices", index) {
|
|
of_property_read_string_index(node, "clock-output-names",
|
|
i, &clk_name);
|
|
|
|
diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
|
|
index 6e46781bc9acff..b9561e3f196c42 100644
|
|
--- a/drivers/clocksource/samsung_pwm_timer.c
|
|
+++ b/drivers/clocksource/samsung_pwm_timer.c
|
|
@@ -418,8 +418,6 @@ void __init samsung_pwm_clocksource_init(void __iomem *base,
|
|
static int __init samsung_pwm_alloc(struct device_node *np,
|
|
const struct samsung_pwm_variant *variant)
|
|
{
|
|
- struct property *prop;
|
|
- const __be32 *cur;
|
|
u32 val;
|
|
int i, ret;
|
|
|
|
@@ -427,7 +425,7 @@ static int __init samsung_pwm_alloc(struct device_node *np,
|
|
for (i = 0; i < SAMSUNG_PWM_NUM; ++i)
|
|
pwm.irq[i] = irq_of_parse_and_map(np, i);
|
|
|
|
- of_property_for_each_u32(np, "samsung,pwm-outputs", prop, cur, val) {
|
|
+ of_property_for_each_u32(np, "samsung,pwm-outputs", val) {
|
|
if (val >= SAMSUNG_PWM_NUM) {
|
|
pr_warn("%s: invalid channel index in samsung,pwm-outputs property\n", __func__);
|
|
continue;
|
|
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
|
|
index 4ac3a35dcd983c..0615e7fa20ad7e 100644
|
|
--- a/drivers/cpufreq/acpi-cpufreq.c
|
|
+++ b/drivers/cpufreq/acpi-cpufreq.c
|
|
@@ -628,7 +628,14 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
|
|
#endif
|
|
|
|
#ifdef CONFIG_ACPI_CPPC_LIB
|
|
-static u64 get_max_boost_ratio(unsigned int cpu)
|
|
+/*
|
|
+ * get_max_boost_ratio: Computes the max_boost_ratio as the ratio
|
|
+ * between the highest_perf and the nominal_perf.
|
|
+ *
|
|
+ * Returns the max_boost_ratio for @cpu. Returns the CPPC nominal
|
|
+ * frequency via @nominal_freq if it is non-NULL pointer.
|
|
+ */
|
|
+static u64 get_max_boost_ratio(unsigned int cpu, u64 *nominal_freq)
|
|
{
|
|
struct cppc_perf_caps perf_caps;
|
|
u64 highest_perf, nominal_perf;
|
|
@@ -651,6 +658,9 @@ static u64 get_max_boost_ratio(unsigned int cpu)
|
|
|
|
nominal_perf = perf_caps.nominal_perf;
|
|
|
|
+ if (nominal_freq)
|
|
+ *nominal_freq = perf_caps.nominal_freq;
|
|
+
|
|
if (!highest_perf || !nominal_perf) {
|
|
pr_debug("CPU%d: highest or nominal performance missing\n", cpu);
|
|
return 0;
|
|
@@ -663,8 +673,12 @@ static u64 get_max_boost_ratio(unsigned int cpu)
|
|
|
|
return div_u64(highest_perf << SCHED_CAPACITY_SHIFT, nominal_perf);
|
|
}
|
|
+
|
|
#else
|
|
-static inline u64 get_max_boost_ratio(unsigned int cpu) { return 0; }
|
|
+static inline u64 get_max_boost_ratio(unsigned int cpu, u64 *nominal_freq)
|
|
+{
|
|
+ return 0;
|
|
+}
|
|
#endif
|
|
|
|
static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
|
|
@@ -674,9 +688,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
|
|
struct acpi_cpufreq_data *data;
|
|
unsigned int cpu = policy->cpu;
|
|
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
|
+ u64 max_boost_ratio, nominal_freq = 0;
|
|
unsigned int valid_states = 0;
|
|
unsigned int result = 0;
|
|
- u64 max_boost_ratio;
|
|
unsigned int i;
|
|
#ifdef CONFIG_SMP
|
|
static int blacklisted;
|
|
@@ -826,16 +840,20 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
|
|
}
|
|
freq_table[valid_states].frequency = CPUFREQ_TABLE_END;
|
|
|
|
- max_boost_ratio = get_max_boost_ratio(cpu);
|
|
+ max_boost_ratio = get_max_boost_ratio(cpu, &nominal_freq);
|
|
if (max_boost_ratio) {
|
|
- unsigned int freq = freq_table[0].frequency;
|
|
+ unsigned int freq = nominal_freq;
|
|
|
|
/*
|
|
- * Because the loop above sorts the freq_table entries in the
|
|
- * descending order, freq is the maximum frequency in the table.
|
|
- * Assume that it corresponds to the CPPC nominal frequency and
|
|
- * use it to set cpuinfo.max_freq.
|
|
+ * The loop above sorts the freq_table entries in the
|
|
+ * descending order. If ACPI CPPC has not advertised
|
|
+ * the nominal frequency (this is possible in CPPC
|
|
+ * revisions prior to 3), then use the first entry in
|
|
+ * the pstate table as a proxy for nominal frequency.
|
|
*/
|
|
+ if (!freq)
|
|
+ freq = freq_table[0].frequency;
|
|
+
|
|
policy->cpuinfo.max_freq = freq * max_boost_ratio >> SCHED_CAPACITY_SHIFT;
|
|
} else {
|
|
/*
|
|
diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
|
|
index 70b0f21968a010..92c0fc4a3cf60b 100644
|
|
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
|
|
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
|
|
@@ -142,14 +142,12 @@ static unsigned long qcom_lmh_get_throttle_freq(struct qcom_cpufreq_data *data)
|
|
}
|
|
|
|
/* Get the frequency requested by the cpufreq core for the CPU */
|
|
-static unsigned int qcom_cpufreq_get_freq(unsigned int cpu)
|
|
+static unsigned int qcom_cpufreq_get_freq(struct cpufreq_policy *policy)
|
|
{
|
|
struct qcom_cpufreq_data *data;
|
|
const struct qcom_cpufreq_soc_data *soc_data;
|
|
- struct cpufreq_policy *policy;
|
|
unsigned int index;
|
|
|
|
- policy = cpufreq_cpu_get_raw(cpu);
|
|
if (!policy)
|
|
return 0;
|
|
|
|
@@ -162,12 +160,10 @@ static unsigned int qcom_cpufreq_get_freq(unsigned int cpu)
|
|
return policy->freq_table[index].frequency;
|
|
}
|
|
|
|
-static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
|
|
+static unsigned int __qcom_cpufreq_hw_get(struct cpufreq_policy *policy)
|
|
{
|
|
struct qcom_cpufreq_data *data;
|
|
- struct cpufreq_policy *policy;
|
|
|
|
- policy = cpufreq_cpu_get_raw(cpu);
|
|
if (!policy)
|
|
return 0;
|
|
|
|
@@ -176,7 +172,12 @@ static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
|
|
if (data->throttle_irq >= 0)
|
|
return qcom_lmh_get_throttle_freq(data) / HZ_PER_KHZ;
|
|
|
|
- return qcom_cpufreq_get_freq(cpu);
|
|
+ return qcom_cpufreq_get_freq(policy);
|
|
+}
|
|
+
|
|
+static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
|
|
+{
|
|
+ return __qcom_cpufreq_hw_get(cpufreq_cpu_get_raw(cpu));
|
|
}
|
|
|
|
static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
|
|
@@ -362,7 +363,7 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
|
|
* If h/w throttled frequency is higher than what cpufreq has requested
|
|
* for, then stop polling and switch back to interrupt mechanism.
|
|
*/
|
|
- if (throttled_freq >= qcom_cpufreq_get_freq(cpu))
|
|
+ if (throttled_freq >= qcom_cpufreq_get_freq(cpufreq_cpu_get_raw(cpu)))
|
|
enable_irq(data->throttle_irq);
|
|
else
|
|
mod_delayed_work(system_highpri_wq, &data->throttle_work,
|
|
@@ -440,7 +441,6 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index)
|
|
return data->throttle_irq;
|
|
|
|
data->cancel_throttle = false;
|
|
- data->policy = policy;
|
|
|
|
mutex_init(&data->throttle_lock);
|
|
INIT_DEFERRABLE_WORK(&data->throttle_work, qcom_lmh_dcvs_poll);
|
|
@@ -551,6 +551,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
|
|
|
|
policy->driver_data = data;
|
|
policy->dvfs_possible_from_any_cpu = true;
|
|
+ data->policy = policy;
|
|
|
|
ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy);
|
|
if (ret) {
|
|
@@ -623,11 +624,24 @@ static unsigned long qcom_cpufreq_hw_recalc_rate(struct clk_hw *hw, unsigned lon
|
|
{
|
|
struct qcom_cpufreq_data *data = container_of(hw, struct qcom_cpufreq_data, cpu_clk);
|
|
|
|
- return qcom_lmh_get_throttle_freq(data);
|
|
+ return __qcom_cpufreq_hw_get(data->policy) * HZ_PER_KHZ;
|
|
+}
|
|
+
|
|
+/*
|
|
+ * Since we cannot determine the closest rate of the target rate, let's just
|
|
+ * return the actual rate at which the clock is running at. This is needed to
|
|
+ * make clk_set_rate() API work properly.
|
|
+ */
|
|
+static int qcom_cpufreq_hw_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
|
|
+{
|
|
+ req->rate = qcom_cpufreq_hw_recalc_rate(hw, 0);
|
|
+
|
|
+ return 0;
|
|
}
|
|
|
|
static const struct clk_ops qcom_cpufreq_hw_clk_ops = {
|
|
.recalc_rate = qcom_cpufreq_hw_recalc_rate,
|
|
+ .determine_rate = qcom_cpufreq_hw_determine_rate,
|
|
};
|
|
|
|
static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
|
|
diff --git a/drivers/crypto/caam/blob_gen.c b/drivers/crypto/caam/blob_gen.c
|
|
index 87781c1534ee5b..079a22cc9f02be 100644
|
|
--- a/drivers/crypto/caam/blob_gen.c
|
|
+++ b/drivers/crypto/caam/blob_gen.c
|
|
@@ -2,6 +2,7 @@
|
|
/*
|
|
* Copyright (C) 2015 Pengutronix, Steffen Trumtrar <kernel@pengutronix.de>
|
|
* Copyright (C) 2021 Pengutronix, Ahmad Fatoum <kernel@pengutronix.de>
|
|
+ * Copyright 2024 NXP
|
|
*/
|
|
|
|
#define pr_fmt(fmt) "caam blob_gen: " fmt
|
|
@@ -104,7 +105,7 @@ int caam_process_blob(struct caam_blob_priv *priv,
|
|
}
|
|
|
|
ctrlpriv = dev_get_drvdata(jrdev->parent);
|
|
- moo = FIELD_GET(CSTA_MOO, rd_reg32(&ctrlpriv->ctrl->perfmon.status));
|
|
+ moo = FIELD_GET(CSTA_MOO, rd_reg32(&ctrlpriv->jr[0]->perfmon.status));
|
|
if (moo != CSTA_MOO_SECURE && moo != CSTA_MOO_TRUSTED)
|
|
dev_warn(jrdev,
|
|
"using insecure test key, enable HAB to use unique device key!\n");
|
|
diff --git a/drivers/crypto/hisilicon/sec2/sec.h b/drivers/crypto/hisilicon/sec2/sec.h
|
|
index 410c83712e2851..30c2b1a64695c0 100644
|
|
--- a/drivers/crypto/hisilicon/sec2/sec.h
|
|
+++ b/drivers/crypto/hisilicon/sec2/sec.h
|
|
@@ -37,6 +37,7 @@ struct sec_aead_req {
|
|
u8 *a_ivin;
|
|
dma_addr_t a_ivin_dma;
|
|
struct aead_request *aead_req;
|
|
+ bool fallback;
|
|
};
|
|
|
|
/* SEC request of Crypto */
|
|
@@ -90,9 +91,7 @@ struct sec_auth_ctx {
|
|
dma_addr_t a_key_dma;
|
|
u8 *a_key;
|
|
u8 a_key_len;
|
|
- u8 mac_len;
|
|
u8 a_alg;
|
|
- bool fallback;
|
|
struct crypto_shash *hash_tfm;
|
|
struct crypto_aead *fallback_aead_tfm;
|
|
};
|
|
diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c
|
|
index 932cc277eb3a5e..8a6dd2513370a2 100644
|
|
--- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
|
|
+++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
|
|
@@ -849,6 +849,7 @@ static int sec_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
|
|
ret = sec_skcipher_aes_sm4_setkey(c_ctx, keylen, c_mode);
|
|
break;
|
|
default:
|
|
+ dev_err(dev, "sec c_alg err!\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
@@ -952,15 +953,14 @@ static int sec_aead_mac_init(struct sec_aead_req *req)
|
|
struct aead_request *aead_req = req->aead_req;
|
|
struct crypto_aead *tfm = crypto_aead_reqtfm(aead_req);
|
|
size_t authsize = crypto_aead_authsize(tfm);
|
|
- u8 *mac_out = req->out_mac;
|
|
struct scatterlist *sgl = aead_req->src;
|
|
+ u8 *mac_out = req->out_mac;
|
|
size_t copy_size;
|
|
off_t skip_size;
|
|
|
|
/* Copy input mac */
|
|
skip_size = aead_req->assoclen + aead_req->cryptlen - authsize;
|
|
- copy_size = sg_pcopy_to_buffer(sgl, sg_nents(sgl), mac_out,
|
|
- authsize, skip_size);
|
|
+ copy_size = sg_pcopy_to_buffer(sgl, sg_nents(sgl), mac_out, authsize, skip_size);
|
|
if (unlikely(copy_size != authsize))
|
|
return -EINVAL;
|
|
|
|
@@ -1123,10 +1123,7 @@ static int sec_aead_setauthsize(struct crypto_aead *aead, unsigned int authsize)
|
|
struct sec_ctx *ctx = crypto_tfm_ctx(tfm);
|
|
struct sec_auth_ctx *a_ctx = &ctx->a_ctx;
|
|
|
|
- if (unlikely(a_ctx->fallback_aead_tfm))
|
|
- return crypto_aead_setauthsize(a_ctx->fallback_aead_tfm, authsize);
|
|
-
|
|
- return 0;
|
|
+ return crypto_aead_setauthsize(a_ctx->fallback_aead_tfm, authsize);
|
|
}
|
|
|
|
static int sec_aead_fallback_setkey(struct sec_auth_ctx *a_ctx,
|
|
@@ -1142,7 +1139,6 @@ static int sec_aead_fallback_setkey(struct sec_auth_ctx *a_ctx,
|
|
static int sec_aead_setkey(struct crypto_aead *tfm, const u8 *key,
|
|
const u32 keylen, const enum sec_hash_alg a_alg,
|
|
const enum sec_calg c_alg,
|
|
- const enum sec_mac_len mac_len,
|
|
const enum sec_cmode c_mode)
|
|
{
|
|
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
|
|
@@ -1154,7 +1150,6 @@ static int sec_aead_setkey(struct crypto_aead *tfm, const u8 *key,
|
|
|
|
ctx->a_ctx.a_alg = a_alg;
|
|
ctx->c_ctx.c_alg = c_alg;
|
|
- ctx->a_ctx.mac_len = mac_len;
|
|
c_ctx->c_mode = c_mode;
|
|
|
|
if (c_mode == SEC_CMODE_CCM || c_mode == SEC_CMODE_GCM) {
|
|
@@ -1165,16 +1160,11 @@ static int sec_aead_setkey(struct crypto_aead *tfm, const u8 *key,
|
|
}
|
|
memcpy(c_ctx->c_key, key, keylen);
|
|
|
|
- if (unlikely(a_ctx->fallback_aead_tfm)) {
|
|
- ret = sec_aead_fallback_setkey(a_ctx, tfm, key, keylen);
|
|
- if (ret)
|
|
- return ret;
|
|
- }
|
|
-
|
|
- return 0;
|
|
+ return sec_aead_fallback_setkey(a_ctx, tfm, key, keylen);
|
|
}
|
|
|
|
- if (crypto_authenc_extractkeys(&keys, key, keylen))
|
|
+ ret = crypto_authenc_extractkeys(&keys, key, keylen);
|
|
+ if (ret)
|
|
goto bad_key;
|
|
|
|
ret = sec_aead_aes_set_key(c_ctx, &keys);
|
|
@@ -1189,9 +1179,15 @@ static int sec_aead_setkey(struct crypto_aead *tfm, const u8 *key,
|
|
goto bad_key;
|
|
}
|
|
|
|
- if ((ctx->a_ctx.mac_len & SEC_SQE_LEN_RATE_MASK) ||
|
|
- (ctx->a_ctx.a_key_len & SEC_SQE_LEN_RATE_MASK)) {
|
|
- dev_err(dev, "MAC or AUTH key length error!\n");
|
|
+ if (ctx->a_ctx.a_key_len & SEC_SQE_LEN_RATE_MASK) {
|
|
+ ret = -EINVAL;
|
|
+ dev_err(dev, "AUTH key length error!\n");
|
|
+ goto bad_key;
|
|
+ }
|
|
+
|
|
+ ret = sec_aead_fallback_setkey(a_ctx, tfm, key, keylen);
|
|
+ if (ret) {
|
|
+ dev_err(dev, "set sec fallback key err!\n");
|
|
goto bad_key;
|
|
}
|
|
|
|
@@ -1199,31 +1195,23 @@ static int sec_aead_setkey(struct crypto_aead *tfm, const u8 *key,
|
|
|
|
bad_key:
|
|
memzero_explicit(&keys, sizeof(struct crypto_authenc_keys));
|
|
- return -EINVAL;
|
|
+ return ret;
|
|
}
|
|
|
|
|
|
-#define GEN_SEC_AEAD_SETKEY_FUNC(name, aalg, calg, maclen, cmode) \
|
|
-static int sec_setkey_##name(struct crypto_aead *tfm, const u8 *key, \
|
|
- u32 keylen) \
|
|
-{ \
|
|
- return sec_aead_setkey(tfm, key, keylen, aalg, calg, maclen, cmode);\
|
|
-}
|
|
-
|
|
-GEN_SEC_AEAD_SETKEY_FUNC(aes_cbc_sha1, SEC_A_HMAC_SHA1,
|
|
- SEC_CALG_AES, SEC_HMAC_SHA1_MAC, SEC_CMODE_CBC)
|
|
-GEN_SEC_AEAD_SETKEY_FUNC(aes_cbc_sha256, SEC_A_HMAC_SHA256,
|
|
- SEC_CALG_AES, SEC_HMAC_SHA256_MAC, SEC_CMODE_CBC)
|
|
-GEN_SEC_AEAD_SETKEY_FUNC(aes_cbc_sha512, SEC_A_HMAC_SHA512,
|
|
- SEC_CALG_AES, SEC_HMAC_SHA512_MAC, SEC_CMODE_CBC)
|
|
-GEN_SEC_AEAD_SETKEY_FUNC(aes_ccm, 0, SEC_CALG_AES,
|
|
- SEC_HMAC_CCM_MAC, SEC_CMODE_CCM)
|
|
-GEN_SEC_AEAD_SETKEY_FUNC(aes_gcm, 0, SEC_CALG_AES,
|
|
- SEC_HMAC_GCM_MAC, SEC_CMODE_GCM)
|
|
-GEN_SEC_AEAD_SETKEY_FUNC(sm4_ccm, 0, SEC_CALG_SM4,
|
|
- SEC_HMAC_CCM_MAC, SEC_CMODE_CCM)
|
|
-GEN_SEC_AEAD_SETKEY_FUNC(sm4_gcm, 0, SEC_CALG_SM4,
|
|
- SEC_HMAC_GCM_MAC, SEC_CMODE_GCM)
|
|
+#define GEN_SEC_AEAD_SETKEY_FUNC(name, aalg, calg, cmode) \
|
|
+static int sec_setkey_##name(struct crypto_aead *tfm, const u8 *key, u32 keylen) \
|
|
+{ \
|
|
+ return sec_aead_setkey(tfm, key, keylen, aalg, calg, cmode); \
|
|
+}
|
|
+
|
|
+GEN_SEC_AEAD_SETKEY_FUNC(aes_cbc_sha1, SEC_A_HMAC_SHA1, SEC_CALG_AES, SEC_CMODE_CBC)
|
|
+GEN_SEC_AEAD_SETKEY_FUNC(aes_cbc_sha256, SEC_A_HMAC_SHA256, SEC_CALG_AES, SEC_CMODE_CBC)
|
|
+GEN_SEC_AEAD_SETKEY_FUNC(aes_cbc_sha512, SEC_A_HMAC_SHA512, SEC_CALG_AES, SEC_CMODE_CBC)
|
|
+GEN_SEC_AEAD_SETKEY_FUNC(aes_ccm, 0, SEC_CALG_AES, SEC_CMODE_CCM)
|
|
+GEN_SEC_AEAD_SETKEY_FUNC(aes_gcm, 0, SEC_CALG_AES, SEC_CMODE_GCM)
|
|
+GEN_SEC_AEAD_SETKEY_FUNC(sm4_ccm, 0, SEC_CALG_SM4, SEC_CMODE_CCM)
|
|
+GEN_SEC_AEAD_SETKEY_FUNC(sm4_gcm, 0, SEC_CALG_SM4, SEC_CMODE_GCM)
|
|
|
|
static int sec_aead_sgl_map(struct sec_ctx *ctx, struct sec_req *req)
|
|
{
|
|
@@ -1471,9 +1459,10 @@ static void sec_skcipher_callback(struct sec_ctx *ctx, struct sec_req *req,
|
|
static void set_aead_auth_iv(struct sec_ctx *ctx, struct sec_req *req)
|
|
{
|
|
struct aead_request *aead_req = req->aead_req.aead_req;
|
|
- struct sec_cipher_req *c_req = &req->c_req;
|
|
+ struct crypto_aead *tfm = crypto_aead_reqtfm(aead_req);
|
|
+ size_t authsize = crypto_aead_authsize(tfm);
|
|
struct sec_aead_req *a_req = &req->aead_req;
|
|
- size_t authsize = ctx->a_ctx.mac_len;
|
|
+ struct sec_cipher_req *c_req = &req->c_req;
|
|
u32 data_size = aead_req->cryptlen;
|
|
u8 flage = 0;
|
|
u8 cm, cl;
|
|
@@ -1514,10 +1503,8 @@ static void set_aead_auth_iv(struct sec_ctx *ctx, struct sec_req *req)
|
|
static void sec_aead_set_iv(struct sec_ctx *ctx, struct sec_req *req)
|
|
{
|
|
struct aead_request *aead_req = req->aead_req.aead_req;
|
|
- struct crypto_aead *tfm = crypto_aead_reqtfm(aead_req);
|
|
- size_t authsize = crypto_aead_authsize(tfm);
|
|
- struct sec_cipher_req *c_req = &req->c_req;
|
|
struct sec_aead_req *a_req = &req->aead_req;
|
|
+ struct sec_cipher_req *c_req = &req->c_req;
|
|
|
|
memcpy(c_req->c_ivin, aead_req->iv, ctx->c_ctx.ivsize);
|
|
|
|
@@ -1525,15 +1512,11 @@ static void sec_aead_set_iv(struct sec_ctx *ctx, struct sec_req *req)
|
|
/*
|
|
* CCM 16Byte Cipher_IV: {1B_Flage,13B_IV,2B_counter},
|
|
* the counter must set to 0x01
|
|
+ * CCM 16Byte Auth_IV: {1B_AFlage,13B_IV,2B_Ptext_length}
|
|
*/
|
|
- ctx->a_ctx.mac_len = authsize;
|
|
- /* CCM 16Byte Auth_IV: {1B_AFlage,13B_IV,2B_Ptext_length} */
|
|
set_aead_auth_iv(ctx, req);
|
|
- }
|
|
-
|
|
- /* GCM 12Byte Cipher_IV == Auth_IV */
|
|
- if (ctx->c_ctx.c_mode == SEC_CMODE_GCM) {
|
|
- ctx->a_ctx.mac_len = authsize;
|
|
+ } else if (ctx->c_ctx.c_mode == SEC_CMODE_GCM) {
|
|
+ /* GCM 12Byte Cipher_IV == Auth_IV */
|
|
memcpy(a_req->a_ivin, c_req->c_ivin, SEC_AIV_SIZE);
|
|
}
|
|
}
|
|
@@ -1543,9 +1526,11 @@ static void sec_auth_bd_fill_xcm(struct sec_auth_ctx *ctx, int dir,
|
|
{
|
|
struct sec_aead_req *a_req = &req->aead_req;
|
|
struct aead_request *aq = a_req->aead_req;
|
|
+ struct crypto_aead *tfm = crypto_aead_reqtfm(aq);
|
|
+ size_t authsize = crypto_aead_authsize(tfm);
|
|
|
|
/* C_ICV_Len is MAC size, 0x4 ~ 0x10 */
|
|
- sec_sqe->type2.icvw_kmode |= cpu_to_le16((u16)ctx->mac_len);
|
|
+ sec_sqe->type2.icvw_kmode |= cpu_to_le16((u16)authsize);
|
|
|
|
/* mode set to CCM/GCM, don't set {A_Alg, AKey_Len, MAC_Len} */
|
|
sec_sqe->type2.a_key_addr = sec_sqe->type2.c_key_addr;
|
|
@@ -1569,9 +1554,11 @@ static void sec_auth_bd_fill_xcm_v3(struct sec_auth_ctx *ctx, int dir,
|
|
{
|
|
struct sec_aead_req *a_req = &req->aead_req;
|
|
struct aead_request *aq = a_req->aead_req;
|
|
+ struct crypto_aead *tfm = crypto_aead_reqtfm(aq);
|
|
+ size_t authsize = crypto_aead_authsize(tfm);
|
|
|
|
/* C_ICV_Len is MAC size, 0x4 ~ 0x10 */
|
|
- sqe3->c_icv_key |= cpu_to_le16((u16)ctx->mac_len << SEC_MAC_OFFSET_V3);
|
|
+ sqe3->c_icv_key |= cpu_to_le16((u16)authsize << SEC_MAC_OFFSET_V3);
|
|
|
|
/* mode set to CCM/GCM, don't set {A_Alg, AKey_Len, MAC_Len} */
|
|
sqe3->a_key_addr = sqe3->c_key_addr;
|
|
@@ -1595,11 +1582,12 @@ static void sec_auth_bd_fill_ex(struct sec_auth_ctx *ctx, int dir,
|
|
struct sec_aead_req *a_req = &req->aead_req;
|
|
struct sec_cipher_req *c_req = &req->c_req;
|
|
struct aead_request *aq = a_req->aead_req;
|
|
+ struct crypto_aead *tfm = crypto_aead_reqtfm(aq);
|
|
+ size_t authsize = crypto_aead_authsize(tfm);
|
|
|
|
sec_sqe->type2.a_key_addr = cpu_to_le64(ctx->a_key_dma);
|
|
|
|
- sec_sqe->type2.mac_key_alg =
|
|
- cpu_to_le32(ctx->mac_len / SEC_SQE_LEN_RATE);
|
|
+ sec_sqe->type2.mac_key_alg = cpu_to_le32(authsize / SEC_SQE_LEN_RATE);
|
|
|
|
sec_sqe->type2.mac_key_alg |=
|
|
cpu_to_le32((u32)((ctx->a_key_len) /
|
|
@@ -1649,11 +1637,13 @@ static void sec_auth_bd_fill_ex_v3(struct sec_auth_ctx *ctx, int dir,
|
|
struct sec_aead_req *a_req = &req->aead_req;
|
|
struct sec_cipher_req *c_req = &req->c_req;
|
|
struct aead_request *aq = a_req->aead_req;
|
|
+ struct crypto_aead *tfm = crypto_aead_reqtfm(aq);
|
|
+ size_t authsize = crypto_aead_authsize(tfm);
|
|
|
|
sqe3->a_key_addr = cpu_to_le64(ctx->a_key_dma);
|
|
|
|
sqe3->auth_mac_key |=
|
|
- cpu_to_le32((u32)(ctx->mac_len /
|
|
+ cpu_to_le32((u32)(authsize /
|
|
SEC_SQE_LEN_RATE) << SEC_MAC_OFFSET_V3);
|
|
|
|
sqe3->auth_mac_key |=
|
|
@@ -1704,9 +1694,9 @@ static void sec_aead_callback(struct sec_ctx *c, struct sec_req *req, int err)
|
|
{
|
|
struct aead_request *a_req = req->aead_req.aead_req;
|
|
struct crypto_aead *tfm = crypto_aead_reqtfm(a_req);
|
|
+ size_t authsize = crypto_aead_authsize(tfm);
|
|
struct sec_aead_req *aead_req = &req->aead_req;
|
|
struct sec_cipher_req *c_req = &req->c_req;
|
|
- size_t authsize = crypto_aead_authsize(tfm);
|
|
struct sec_qp_ctx *qp_ctx = req->qp_ctx;
|
|
struct aead_request *backlog_aead_req;
|
|
struct sec_req *backlog_req;
|
|
@@ -1719,10 +1709,8 @@ static void sec_aead_callback(struct sec_ctx *c, struct sec_req *req, int err)
|
|
if (!err && c_req->encrypt) {
|
|
struct scatterlist *sgl = a_req->dst;
|
|
|
|
- sz = sg_pcopy_from_buffer(sgl, sg_nents(sgl),
|
|
- aead_req->out_mac,
|
|
- authsize, a_req->cryptlen +
|
|
- a_req->assoclen);
|
|
+ sz = sg_pcopy_from_buffer(sgl, sg_nents(sgl), aead_req->out_mac,
|
|
+ authsize, a_req->cryptlen + a_req->assoclen);
|
|
if (unlikely(sz != authsize)) {
|
|
dev_err(c->dev, "copy out mac err!\n");
|
|
err = -EINVAL;
|
|
@@ -1930,8 +1918,10 @@ static void sec_aead_exit(struct crypto_aead *tfm)
|
|
|
|
static int sec_aead_ctx_init(struct crypto_aead *tfm, const char *hash_name)
|
|
{
|
|
+ struct aead_alg *alg = crypto_aead_alg(tfm);
|
|
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
|
|
- struct sec_auth_ctx *auth_ctx = &ctx->a_ctx;
|
|
+ struct sec_auth_ctx *a_ctx = &ctx->a_ctx;
|
|
+ const char *aead_name = alg->base.cra_name;
|
|
int ret;
|
|
|
|
ret = sec_aead_init(tfm);
|
|
@@ -1940,11 +1930,20 @@ static int sec_aead_ctx_init(struct crypto_aead *tfm, const char *hash_name)
|
|
return ret;
|
|
}
|
|
|
|
- auth_ctx->hash_tfm = crypto_alloc_shash(hash_name, 0, 0);
|
|
- if (IS_ERR(auth_ctx->hash_tfm)) {
|
|
+ a_ctx->hash_tfm = crypto_alloc_shash(hash_name, 0, 0);
|
|
+ if (IS_ERR(a_ctx->hash_tfm)) {
|
|
dev_err(ctx->dev, "aead alloc shash error!\n");
|
|
sec_aead_exit(tfm);
|
|
- return PTR_ERR(auth_ctx->hash_tfm);
|
|
+ return PTR_ERR(a_ctx->hash_tfm);
|
|
+ }
|
|
+
|
|
+ a_ctx->fallback_aead_tfm = crypto_alloc_aead(aead_name, 0,
|
|
+ CRYPTO_ALG_NEED_FALLBACK | CRYPTO_ALG_ASYNC);
|
|
+ if (IS_ERR(a_ctx->fallback_aead_tfm)) {
|
|
+ dev_err(ctx->dev, "aead driver alloc fallback tfm error!\n");
|
|
+ crypto_free_shash(ctx->a_ctx.hash_tfm);
|
|
+ sec_aead_exit(tfm);
|
|
+ return PTR_ERR(a_ctx->fallback_aead_tfm);
|
|
}
|
|
|
|
return 0;
|
|
@@ -1954,6 +1953,7 @@ static void sec_aead_ctx_exit(struct crypto_aead *tfm)
|
|
{
|
|
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
|
|
|
|
+ crypto_free_aead(ctx->a_ctx.fallback_aead_tfm);
|
|
crypto_free_shash(ctx->a_ctx.hash_tfm);
|
|
sec_aead_exit(tfm);
|
|
}
|
|
@@ -1980,7 +1980,6 @@ static int sec_aead_xcm_ctx_init(struct crypto_aead *tfm)
|
|
sec_aead_exit(tfm);
|
|
return PTR_ERR(a_ctx->fallback_aead_tfm);
|
|
}
|
|
- a_ctx->fallback = false;
|
|
|
|
return 0;
|
|
}
|
|
@@ -2261,21 +2260,20 @@ static int sec_aead_spec_check(struct sec_ctx *ctx, struct sec_req *sreq)
|
|
{
|
|
struct aead_request *req = sreq->aead_req.aead_req;
|
|
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
|
|
- size_t authsize = crypto_aead_authsize(tfm);
|
|
+ size_t sz = crypto_aead_authsize(tfm);
|
|
u8 c_mode = ctx->c_ctx.c_mode;
|
|
struct device *dev = ctx->dev;
|
|
int ret;
|
|
|
|
- if (unlikely(req->cryptlen + req->assoclen > MAX_INPUT_DATA_LEN ||
|
|
- req->assoclen > SEC_MAX_AAD_LEN)) {
|
|
- dev_err(dev, "aead input spec error!\n");
|
|
+ /* Hardware does not handle cases where authsize is less than 4 bytes */
|
|
+ if (unlikely(sz < MIN_MAC_LEN)) {
|
|
+ sreq->aead_req.fallback = true;
|
|
return -EINVAL;
|
|
}
|
|
|
|
- if (unlikely((c_mode == SEC_CMODE_GCM && authsize < DES_BLOCK_SIZE) ||
|
|
- (c_mode == SEC_CMODE_CCM && (authsize < MIN_MAC_LEN ||
|
|
- authsize & MAC_LEN_MASK)))) {
|
|
- dev_err(dev, "aead input mac length error!\n");
|
|
+ if (unlikely(req->cryptlen + req->assoclen > MAX_INPUT_DATA_LEN ||
|
|
+ req->assoclen > SEC_MAX_AAD_LEN)) {
|
|
+ dev_err(dev, "aead input spec error!\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
@@ -2294,7 +2292,7 @@ static int sec_aead_spec_check(struct sec_ctx *ctx, struct sec_req *sreq)
|
|
if (sreq->c_req.encrypt)
|
|
sreq->c_req.c_len = req->cryptlen;
|
|
else
|
|
- sreq->c_req.c_len = req->cryptlen - authsize;
|
|
+ sreq->c_req.c_len = req->cryptlen - sz;
|
|
if (c_mode == SEC_CMODE_CBC) {
|
|
if (unlikely(sreq->c_req.c_len & (AES_BLOCK_SIZE - 1))) {
|
|
dev_err(dev, "aead crypto length error!\n");
|
|
@@ -2320,8 +2318,8 @@ static int sec_aead_param_check(struct sec_ctx *ctx, struct sec_req *sreq)
|
|
|
|
if (ctx->sec->qm.ver == QM_HW_V2) {
|
|
if (unlikely(!req->cryptlen || (!sreq->c_req.encrypt &&
|
|
- req->cryptlen <= authsize))) {
|
|
- ctx->a_ctx.fallback = true;
|
|
+ req->cryptlen <= authsize))) {
|
|
+ sreq->aead_req.fallback = true;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
@@ -2349,16 +2347,9 @@ static int sec_aead_soft_crypto(struct sec_ctx *ctx,
|
|
bool encrypt)
|
|
{
|
|
struct sec_auth_ctx *a_ctx = &ctx->a_ctx;
|
|
- struct device *dev = ctx->dev;
|
|
struct aead_request *subreq;
|
|
int ret;
|
|
|
|
- /* Kunpeng920 aead mode not support input 0 size */
|
|
- if (!a_ctx->fallback_aead_tfm) {
|
|
- dev_err(dev, "aead fallback tfm is NULL!\n");
|
|
- return -EINVAL;
|
|
- }
|
|
-
|
|
subreq = aead_request_alloc(a_ctx->fallback_aead_tfm, GFP_KERNEL);
|
|
if (!subreq)
|
|
return -ENOMEM;
|
|
@@ -2390,10 +2381,11 @@ static int sec_aead_crypto(struct aead_request *a_req, bool encrypt)
|
|
req->aead_req.aead_req = a_req;
|
|
req->c_req.encrypt = encrypt;
|
|
req->ctx = ctx;
|
|
+ req->aead_req.fallback = false;
|
|
|
|
ret = sec_aead_param_check(ctx, req);
|
|
if (unlikely(ret)) {
|
|
- if (ctx->a_ctx.fallback)
|
|
+ if (req->aead_req.fallback)
|
|
return sec_aead_soft_crypto(ctx, a_req, encrypt);
|
|
return -EINVAL;
|
|
}
|
|
diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.h b/drivers/crypto/hisilicon/sec2/sec_crypto.h
|
|
index d033f63b583f85..db3fceb88e6937 100644
|
|
--- a/drivers/crypto/hisilicon/sec2/sec_crypto.h
|
|
+++ b/drivers/crypto/hisilicon/sec2/sec_crypto.h
|
|
@@ -23,17 +23,6 @@ enum sec_hash_alg {
|
|
SEC_A_HMAC_SHA512 = 0x15,
|
|
};
|
|
|
|
-enum sec_mac_len {
|
|
- SEC_HMAC_CCM_MAC = 16,
|
|
- SEC_HMAC_GCM_MAC = 16,
|
|
- SEC_SM3_MAC = 32,
|
|
- SEC_HMAC_SM3_MAC = 32,
|
|
- SEC_HMAC_MD5_MAC = 16,
|
|
- SEC_HMAC_SHA1_MAC = 20,
|
|
- SEC_HMAC_SHA256_MAC = 32,
|
|
- SEC_HMAC_SHA512_MAC = 64,
|
|
-};
|
|
-
|
|
enum sec_cmode {
|
|
SEC_CMODE_ECB = 0x0,
|
|
SEC_CMODE_CBC = 0x1,
|
|
diff --git a/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c b/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
|
|
index 4a18095ae5d808..662aac9ea186df 100644
|
|
--- a/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
|
|
+++ b/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
|
|
@@ -471,6 +471,7 @@ static int init_ixp_crypto(struct device *dev)
|
|
return -ENODEV;
|
|
}
|
|
npe_id = npe_spec.args[0];
|
|
+ of_node_put(npe_spec.np);
|
|
|
|
ret = of_parse_phandle_with_fixed_args(np, "queue-rx", 1, 0,
|
|
&queue_spec);
|
|
@@ -479,6 +480,7 @@ static int init_ixp_crypto(struct device *dev)
|
|
return -ENODEV;
|
|
}
|
|
recv_qid = queue_spec.args[0];
|
|
+ of_node_put(queue_spec.np);
|
|
|
|
ret = of_parse_phandle_with_fixed_args(np, "queue-txready", 1, 0,
|
|
&queue_spec);
|
|
@@ -487,6 +489,7 @@ static int init_ixp_crypto(struct device *dev)
|
|
return -ENODEV;
|
|
}
|
|
send_qid = queue_spec.args[0];
|
|
+ of_node_put(queue_spec.np);
|
|
} else {
|
|
/*
|
|
* Hardcoded engine when using platform data, this goes away
|
|
diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
|
|
index 155c409d2b434d..c0fa5413246756 100644
|
|
--- a/drivers/dma/ti/edma.c
|
|
+++ b/drivers/dma/ti/edma.c
|
|
@@ -208,7 +208,6 @@ struct edma_desc {
|
|
struct edma_cc;
|
|
|
|
struct edma_tc {
|
|
- struct device_node *node;
|
|
u16 id;
|
|
};
|
|
|
|
@@ -2466,13 +2465,13 @@ static int edma_probe(struct platform_device *pdev)
|
|
if (ret || i == ecc->num_tc)
|
|
break;
|
|
|
|
- ecc->tc_list[i].node = tc_args.np;
|
|
ecc->tc_list[i].id = i;
|
|
queue_priority_mapping[i][1] = tc_args.args[0];
|
|
if (queue_priority_mapping[i][1] > lowest_priority) {
|
|
lowest_priority = queue_priority_mapping[i][1];
|
|
info->default_queue = i;
|
|
}
|
|
+ of_node_put(tc_args.np);
|
|
}
|
|
|
|
/* See if we have optional dma-channel-mask array */
|
|
diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c
|
|
index 456d0e5eaf78b5..f479680299838a 100644
|
|
--- a/drivers/firmware/efi/sysfb_efi.c
|
|
+++ b/drivers/firmware/efi/sysfb_efi.c
|
|
@@ -91,6 +91,7 @@ void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
|
|
_ret_; \
|
|
})
|
|
|
|
+#ifdef CONFIG_EFI
|
|
static int __init efifb_set_system(const struct dmi_system_id *id)
|
|
{
|
|
struct efifb_dmi_info *info = id->driver_data;
|
|
@@ -346,7 +347,6 @@ static const struct fwnode_operations efifb_fwnode_ops = {
|
|
.add_links = efifb_add_links,
|
|
};
|
|
|
|
-#ifdef CONFIG_EFI
|
|
static struct fwnode_handle efifb_fwnode;
|
|
|
|
__init void sysfb_apply_efi_quirks(void)
|
|
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
|
|
index bccdbfd5ec805c..4588666a52d505 100644
|
|
--- a/drivers/gpio/gpio-brcmstb.c
|
|
+++ b/drivers/gpio/gpio-brcmstb.c
|
|
@@ -594,8 +594,6 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
|
|
void __iomem *reg_base;
|
|
struct brcmstb_gpio_priv *priv;
|
|
struct resource *res;
|
|
- struct property *prop;
|
|
- const __be32 *p;
|
|
u32 bank_width;
|
|
int num_banks = 0;
|
|
int err;
|
|
@@ -640,8 +638,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
|
|
flags = BGPIOF_BIG_ENDIAN_BYTE_ORDER;
|
|
#endif
|
|
|
|
- of_property_for_each_u32(np, "brcm,gpio-bank-widths", prop, p,
|
|
- bank_width) {
|
|
+ of_property_for_each_u32(np, "brcm,gpio-bank-widths", bank_width) {
|
|
struct brcmstb_gpio_bank *bank;
|
|
struct gpio_chip *gc;
|
|
|
|
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
|
|
index 4cb455b2bdee71..619b6fb9d833a4 100644
|
|
--- a/drivers/gpio/gpio-mxc.c
|
|
+++ b/drivers/gpio/gpio-mxc.c
|
|
@@ -490,8 +490,7 @@ static int mxc_gpio_probe(struct platform_device *pdev)
|
|
port->gc.request = mxc_gpio_request;
|
|
port->gc.free = mxc_gpio_free;
|
|
port->gc.to_irq = mxc_gpio_to_irq;
|
|
- port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
|
|
- pdev->id * 32;
|
|
+ port->gc.base = of_alias_get_id(np, "gpio") * 32;
|
|
|
|
err = devm_gpiochip_add_data(&pdev->dev, &port->gc, port);
|
|
if (err)
|
|
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
|
|
index ce9a94e332801f..9c33f9da724cfd 100644
|
|
--- a/drivers/gpio/gpio-pca953x.c
|
|
+++ b/drivers/gpio/gpio-pca953x.c
|
|
@@ -211,7 +211,6 @@ struct pca953x_chip {
|
|
|
|
struct i2c_client *client;
|
|
struct gpio_chip gpio_chip;
|
|
- const char *const *names;
|
|
unsigned long driver_data;
|
|
struct regulator *regulator;
|
|
|
|
@@ -712,7 +711,6 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
|
|
gc->label = dev_name(&chip->client->dev);
|
|
gc->parent = &chip->client->dev;
|
|
gc->owner = THIS_MODULE;
|
|
- gc->names = chip->names;
|
|
}
|
|
|
|
#ifdef CONFIG_GPIO_PCA953X_IRQ
|
|
@@ -1000,7 +998,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
|
|
}
|
|
#endif
|
|
|
|
-static int device_pca95xx_init(struct pca953x_chip *chip, u32 invert)
|
|
+static int device_pca95xx_init(struct pca953x_chip *chip)
|
|
{
|
|
DECLARE_BITMAP(val, MAX_LINE);
|
|
u8 regaddr;
|
|
@@ -1018,24 +1016,21 @@ static int device_pca95xx_init(struct pca953x_chip *chip, u32 invert)
|
|
if (ret)
|
|
goto out;
|
|
|
|
- /* set platform specific polarity inversion */
|
|
- if (invert)
|
|
- bitmap_fill(val, MAX_LINE);
|
|
- else
|
|
- bitmap_zero(val, MAX_LINE);
|
|
+ /* clear polarity inversion */
|
|
+ bitmap_zero(val, MAX_LINE);
|
|
|
|
ret = pca953x_write_regs(chip, chip->regs->invert, val);
|
|
out:
|
|
return ret;
|
|
}
|
|
|
|
-static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
|
|
+static int device_pca957x_init(struct pca953x_chip *chip)
|
|
{
|
|
DECLARE_BITMAP(val, MAX_LINE);
|
|
unsigned int i;
|
|
int ret;
|
|
|
|
- ret = device_pca95xx_init(chip, invert);
|
|
+ ret = device_pca95xx_init(chip);
|
|
if (ret)
|
|
goto out;
|
|
|
|
@@ -1052,14 +1047,40 @@ static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
|
|
return ret;
|
|
}
|
|
|
|
+static void pca953x_disable_regulator(void *reg)
|
|
+{
|
|
+ regulator_disable(reg);
|
|
+}
|
|
+
|
|
+static int pca953x_get_and_enable_regulator(struct pca953x_chip *chip)
|
|
+{
|
|
+ struct device *dev = &chip->client->dev;
|
|
+ struct regulator *reg = chip->regulator;
|
|
+ int ret;
|
|
+
|
|
+ reg = devm_regulator_get(dev, "vcc");
|
|
+ if (IS_ERR(reg))
|
|
+ return dev_err_probe(dev, PTR_ERR(reg), "reg get err\n");
|
|
+
|
|
+ ret = regulator_enable(reg);
|
|
+ if (ret)
|
|
+ return dev_err_probe(dev, ret, "reg en err\n");
|
|
+
|
|
+ ret = devm_add_action_or_reset(dev, pca953x_disable_regulator, reg);
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ chip->regulator = reg;
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static int pca953x_probe(struct i2c_client *client)
|
|
{
|
|
+ struct device *dev = &client->dev;
|
|
struct pca953x_platform_data *pdata;
|
|
struct pca953x_chip *chip;
|
|
- int irq_base = 0;
|
|
+ int irq_base;
|
|
int ret;
|
|
- u32 invert = 0;
|
|
- struct regulator *reg;
|
|
const struct regmap_config *regmap_config;
|
|
|
|
chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
|
|
@@ -1070,8 +1091,6 @@ static int pca953x_probe(struct i2c_client *client)
|
|
if (pdata) {
|
|
irq_base = pdata->irq_base;
|
|
chip->gpio_start = pdata->gpio_base;
|
|
- invert = pdata->invert;
|
|
- chip->names = pdata->names;
|
|
} else {
|
|
struct gpio_desc *reset_gpio;
|
|
|
|
@@ -1088,7 +1107,8 @@ static int pca953x_probe(struct i2c_client *client)
|
|
reset_gpio = devm_gpiod_get_optional(&client->dev, "reset",
|
|
GPIOD_OUT_LOW);
|
|
if (IS_ERR(reset_gpio))
|
|
- return PTR_ERR(reset_gpio);
|
|
+ return dev_err_probe(dev, PTR_ERR(reset_gpio),
|
|
+ "Failed to get reset gpio\n");
|
|
}
|
|
|
|
chip->client = client;
|
|
@@ -1096,16 +1116,9 @@ static int pca953x_probe(struct i2c_client *client)
|
|
if (!chip->driver_data)
|
|
return -ENODEV;
|
|
|
|
- reg = devm_regulator_get(&client->dev, "vcc");
|
|
- if (IS_ERR(reg))
|
|
- return dev_err_probe(&client->dev, PTR_ERR(reg), "reg get err\n");
|
|
-
|
|
- ret = regulator_enable(reg);
|
|
- if (ret) {
|
|
- dev_err(&client->dev, "reg en err: %d\n", ret);
|
|
+ ret = pca953x_get_and_enable_regulator(chip);
|
|
+ if (ret)
|
|
return ret;
|
|
- }
|
|
- chip->regulator = reg;
|
|
|
|
i2c_set_clientdata(client, chip);
|
|
|
|
@@ -1128,10 +1141,8 @@ static int pca953x_probe(struct i2c_client *client)
|
|
}
|
|
|
|
chip->regmap = devm_regmap_init_i2c(client, regmap_config);
|
|
- if (IS_ERR(chip->regmap)) {
|
|
- ret = PTR_ERR(chip->regmap);
|
|
- goto err_exit;
|
|
- }
|
|
+ if (IS_ERR(chip->regmap))
|
|
+ return PTR_ERR(chip->regmap);
|
|
|
|
regcache_mark_dirty(chip->regmap);
|
|
|
|
@@ -1160,47 +1171,19 @@ static int pca953x_probe(struct i2c_client *client)
|
|
*/
|
|
if (PCA_CHIP_TYPE(chip->driver_data) == PCA957X_TYPE) {
|
|
chip->regs = &pca957x_regs;
|
|
- ret = device_pca957x_init(chip, invert);
|
|
+ ret = device_pca957x_init(chip);
|
|
} else {
|
|
chip->regs = &pca953x_regs;
|
|
- ret = device_pca95xx_init(chip, invert);
|
|
+ ret = device_pca95xx_init(chip);
|
|
}
|
|
if (ret)
|
|
- goto err_exit;
|
|
+ return ret;
|
|
|
|
ret = pca953x_irq_setup(chip, irq_base);
|
|
if (ret)
|
|
- goto err_exit;
|
|
-
|
|
- ret = devm_gpiochip_add_data(&client->dev, &chip->gpio_chip, chip);
|
|
- if (ret)
|
|
- goto err_exit;
|
|
-
|
|
- if (pdata && pdata->setup) {
|
|
- ret = pdata->setup(client, chip->gpio_chip.base,
|
|
- chip->gpio_chip.ngpio, pdata->context);
|
|
- if (ret < 0)
|
|
- dev_warn(&client->dev, "setup failed, %d\n", ret);
|
|
- }
|
|
-
|
|
- return 0;
|
|
-
|
|
-err_exit:
|
|
- regulator_disable(chip->regulator);
|
|
- return ret;
|
|
-}
|
|
-
|
|
-static void pca953x_remove(struct i2c_client *client)
|
|
-{
|
|
- struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev);
|
|
- struct pca953x_chip *chip = i2c_get_clientdata(client);
|
|
-
|
|
- if (pdata && pdata->teardown) {
|
|
- pdata->teardown(client, chip->gpio_chip.base,
|
|
- chip->gpio_chip.ngpio, pdata->context);
|
|
- }
|
|
+ return ret;
|
|
|
|
- regulator_disable(chip->regulator);
|
|
+ return devm_gpiochip_add_data(dev, &chip->gpio_chip, chip);
|
|
}
|
|
|
|
#ifdef CONFIG_PM_SLEEP
|
|
@@ -1368,7 +1351,6 @@ static struct i2c_driver pca953x_driver = {
|
|
.acpi_match_table = pca953x_acpi_ids,
|
|
},
|
|
.probe = pca953x_probe,
|
|
- .remove = pca953x_remove,
|
|
.id_table = pca953x_id,
|
|
};
|
|
|
|
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
|
|
index c89264242bea3a..69dfc3da5e15c9 100644
|
|
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
|
|
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
|
|
@@ -2049,6 +2049,7 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)
|
|
ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_GDS);
|
|
ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_GWS);
|
|
ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_OA);
|
|
+ ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_DOORBELL);
|
|
ttm_device_fini(&adev->mman.bdev);
|
|
adev->mman.initialized = false;
|
|
DRM_INFO("amdgpu: ttm finalized\n");
|
|
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
|
|
index e80c4f5b4f4023..d1141a9baa916b 100644
|
|
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
|
|
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
|
|
@@ -896,6 +896,8 @@ static int vcn_v4_0_3_start_sriov(struct amdgpu_device *adev)
|
|
for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
|
|
vcn_inst = GET_INST(VCN, i);
|
|
|
|
+ vcn_v4_0_3_fw_shared_init(adev, vcn_inst);
|
|
+
|
|
memset(&header, 0, sizeof(struct mmsch_v4_0_3_init_header));
|
|
header.version = MMSCH_VERSION;
|
|
header.total_size = sizeof(struct mmsch_v4_0_3_init_header) >> 2;
|
|
diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
|
|
index cc3b62f7339417..1fbd23922082ae 100644
|
|
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
|
|
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
|
|
@@ -1420,6 +1420,8 @@ int atomctrl_get_smc_sclk_range_table(struct pp_hwmgr *hwmgr, struct pp_atom_ctr
|
|
GetIndexIntoMasterTable(DATA, SMU_Info),
|
|
&size, &frev, &crev);
|
|
|
|
+ if (!psmu_info)
|
|
+ return -EINVAL;
|
|
|
|
for (i = 0; i < psmu_info->ucSclkEntryNum; i++) {
|
|
table->entry[i].ucVco_setting = psmu_info->asSclkFcwRangeEntry[i].ucVco_setting;
|
|
diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_powertune.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_powertune.c
|
|
index 3007b054c873c9..776d58ea63ae90 100644
|
|
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_powertune.c
|
|
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_powertune.c
|
|
@@ -1120,13 +1120,14 @@ static int vega10_enable_se_edc_force_stall_config(struct pp_hwmgr *hwmgr)
|
|
result = vega10_program_didt_config_registers(hwmgr, SEEDCForceStallPatternConfig_Vega10, VEGA10_CONFIGREG_DIDT);
|
|
result |= vega10_program_didt_config_registers(hwmgr, SEEDCCtrlForceStallConfig_Vega10, VEGA10_CONFIGREG_DIDT);
|
|
if (0 != result)
|
|
- return result;
|
|
+ goto exit_safe_mode;
|
|
|
|
vega10_didt_set_mask(hwmgr, false);
|
|
|
|
+exit_safe_mode:
|
|
amdgpu_gfx_rlc_exit_safe_mode(adev, 0);
|
|
|
|
- return 0;
|
|
+ return result;
|
|
}
|
|
|
|
static int vega10_disable_se_edc_force_stall_config(struct pp_hwmgr *hwmgr)
|
|
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
|
|
index 26d3b9b8432675..24c5a926af8d1d 100644
|
|
--- a/drivers/gpu/drm/bridge/ite-it6505.c
|
|
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
|
|
@@ -299,7 +299,7 @@
|
|
#define MAX_CR_LEVEL 0x03
|
|
#define MAX_EQ_LEVEL 0x03
|
|
#define AUX_WAIT_TIMEOUT_MS 15
|
|
-#define AUX_FIFO_MAX_SIZE 32
|
|
+#define AUX_FIFO_MAX_SIZE 16
|
|
#define PIXEL_CLK_DELAY 1
|
|
#define PIXEL_CLK_INVERSE 0
|
|
#define ADJUST_PHASE_THRESHOLD 80000
|
|
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
|
|
index 69fccbcd92c622..84b7789454962a 100644
|
|
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
|
|
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
|
|
@@ -343,6 +343,7 @@ void *etnaviv_gem_vmap(struct drm_gem_object *obj)
|
|
static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj)
|
|
{
|
|
struct page **pages;
|
|
+ pgprot_t prot;
|
|
|
|
lockdep_assert_held(&obj->lock);
|
|
|
|
@@ -350,8 +351,19 @@ static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj)
|
|
if (IS_ERR(pages))
|
|
return NULL;
|
|
|
|
- return vmap(pages, obj->base.size >> PAGE_SHIFT,
|
|
- VM_MAP, pgprot_writecombine(PAGE_KERNEL));
|
|
+ switch (obj->flags & ETNA_BO_CACHE_MASK) {
|
|
+ case ETNA_BO_CACHED:
|
|
+ prot = PAGE_KERNEL;
|
|
+ break;
|
|
+ case ETNA_BO_UNCACHED:
|
|
+ prot = pgprot_noncached(PAGE_KERNEL);
|
|
+ break;
|
|
+ case ETNA_BO_WC:
|
|
+ default:
|
|
+ prot = pgprot_writecombine(PAGE_KERNEL);
|
|
+ }
|
|
+
|
|
+ return vmap(pages, obj->base.size >> PAGE_SHIFT, VM_MAP, prot);
|
|
}
|
|
|
|
static inline enum dma_data_direction etnaviv_op_to_dma_dir(u32 op)
|
|
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
|
|
index c9edaa6d763697..9009442b543dda 100644
|
|
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
|
|
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
|
|
@@ -1510,7 +1510,9 @@ int a6xx_gmu_wrapper_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
|
|
|
|
gmu->dev = &pdev->dev;
|
|
|
|
- of_dma_configure(gmu->dev, node, true);
|
|
+ ret = of_dma_configure(gmu->dev, node, true);
|
|
+ if (ret)
|
|
+ return ret;
|
|
|
|
pm_runtime_enable(gmu->dev);
|
|
|
|
@@ -1574,7 +1576,9 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
|
|
|
|
gmu->dev = &pdev->dev;
|
|
|
|
- of_dma_configure(gmu->dev, node, true);
|
|
+ ret = of_dma_configure(gmu->dev, node, true);
|
|
+ if (ret)
|
|
+ return ret;
|
|
|
|
/* Fow now, don't do anything fancy until we get our feet under us */
|
|
gmu->idle_level = GMU_IDLE_STATE_ACTIVE;
|
|
diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h
|
|
index f0c3804f425879..76b668f36477a3 100644
|
|
--- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h
|
|
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h
|
|
@@ -164,6 +164,7 @@ static const struct dpu_lm_cfg sm8150_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_3,
|
|
.pingpong = PINGPONG_2,
|
|
+ .dspp = DSPP_2,
|
|
}, {
|
|
.name = "lm_3", .id = LM_3,
|
|
.base = 0x47000, .len = 0x320,
|
|
@@ -171,6 +172,7 @@ static const struct dpu_lm_cfg sm8150_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_2,
|
|
.pingpong = PINGPONG_3,
|
|
+ .dspp = DSPP_3,
|
|
}, {
|
|
.name = "lm_4", .id = LM_4,
|
|
.base = 0x48000, .len = 0x320,
|
|
diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h
|
|
index 47de71e71e3108..427dec0cd1d36d 100644
|
|
--- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h
|
|
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h
|
|
@@ -163,6 +163,7 @@ static const struct dpu_lm_cfg sc8180x_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_3,
|
|
.pingpong = PINGPONG_2,
|
|
+ .dspp = DSPP_2,
|
|
}, {
|
|
.name = "lm_3", .id = LM_3,
|
|
.base = 0x47000, .len = 0x320,
|
|
@@ -170,6 +171,7 @@ static const struct dpu_lm_cfg sc8180x_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_2,
|
|
.pingpong = PINGPONG_3,
|
|
+ .dspp = DSPP_3,
|
|
}, {
|
|
.name = "lm_4", .id = LM_4,
|
|
.base = 0x48000, .len = 0x320,
|
|
diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h
|
|
index ee781037ada93e..a38fb057ceda6b 100644
|
|
--- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h
|
|
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h
|
|
@@ -163,6 +163,7 @@ static const struct dpu_lm_cfg sm8250_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_3,
|
|
.pingpong = PINGPONG_2,
|
|
+ .dspp = DSPP_2,
|
|
}, {
|
|
.name = "lm_3", .id = LM_3,
|
|
.base = 0x47000, .len = 0x320,
|
|
@@ -170,6 +171,7 @@ static const struct dpu_lm_cfg sm8250_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_2,
|
|
.pingpong = PINGPONG_3,
|
|
+ .dspp = DSPP_3,
|
|
}, {
|
|
.name = "lm_4", .id = LM_4,
|
|
.base = 0x48000, .len = 0x320,
|
|
diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h
|
|
index 428bcbcfbf1925..e2f181077d11e7 100644
|
|
--- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h
|
|
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h
|
|
@@ -163,6 +163,7 @@ static const struct dpu_lm_cfg sm8350_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_3,
|
|
.pingpong = PINGPONG_2,
|
|
+ .dspp = DSPP_2,
|
|
}, {
|
|
.name = "lm_3", .id = LM_3,
|
|
.base = 0x47000, .len = 0x320,
|
|
@@ -170,6 +171,7 @@ static const struct dpu_lm_cfg sm8350_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_2,
|
|
.pingpong = PINGPONG_3,
|
|
+ .dspp = DSPP_3,
|
|
}, {
|
|
.name = "lm_4", .id = LM_4,
|
|
.base = 0x48000, .len = 0x320,
|
|
diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h
|
|
index 7bed819dfc3902..69b238ed01b980 100644
|
|
--- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h
|
|
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h
|
|
@@ -181,6 +181,7 @@ static const struct dpu_lm_cfg sm8550_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_3,
|
|
.pingpong = PINGPONG_2,
|
|
+ .dspp = DSPP_2,
|
|
}, {
|
|
.name = "lm_3", .id = LM_3,
|
|
.base = 0x47000, .len = 0x320,
|
|
@@ -188,6 +189,7 @@ static const struct dpu_lm_cfg sm8550_lm[] = {
|
|
.sblk = &sdm845_lm_sblk,
|
|
.lm_pair = LM_2,
|
|
.pingpong = PINGPONG_3,
|
|
+ .dspp = DSPP_3,
|
|
}, {
|
|
.name = "lm_4", .id = LM_4,
|
|
.base = 0x48000, .len = 0x320,
|
|
diff --git a/drivers/gpu/drm/msm/dp/dp_audio.c b/drivers/gpu/drm/msm/dp/dp_audio.c
|
|
index 4a2e479723a852..610cbe23aa8398 100644
|
|
--- a/drivers/gpu/drm/msm/dp/dp_audio.c
|
|
+++ b/drivers/gpu/drm/msm/dp/dp_audio.c
|
|
@@ -410,10 +410,10 @@ static void dp_audio_safe_to_exit_level(struct dp_audio_private *audio)
|
|
safe_to_exit_level = 5;
|
|
break;
|
|
default:
|
|
+ safe_to_exit_level = 14;
|
|
drm_dbg_dp(audio->drm_dev,
|
|
"setting the default safe_to_exit_level = %u\n",
|
|
safe_to_exit_level);
|
|
- safe_to_exit_level = 14;
|
|
break;
|
|
}
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
|
|
index 84aa811ca1e9cf..bd08d57486fef4 100644
|
|
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
|
|
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
|
|
@@ -30,7 +30,6 @@
|
|
#include <drm/drm_simple_kms_helper.h>
|
|
|
|
#include "rockchip_drm_drv.h"
|
|
-#include "rockchip_drm_vop.h"
|
|
|
|
#define RK3288_GRF_SOC_CON6 0x25c
|
|
#define RK3288_EDP_LCDC_SEL BIT(5)
|
|
diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
|
|
index 3793863c210ebd..fca403ccce47eb 100644
|
|
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
|
|
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
|
|
@@ -24,7 +24,6 @@
|
|
|
|
#include "cdn-dp-core.h"
|
|
#include "cdn-dp-reg.h"
|
|
-#include "rockchip_drm_vop.h"
|
|
|
|
static inline struct cdn_dp_device *connector_to_dp(struct drm_connector *connector)
|
|
{
|
|
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
|
|
index 0100162a73b295..002486741aec2b 100644
|
|
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
|
|
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
|
|
@@ -26,7 +26,6 @@
|
|
#include <drm/drm_simple_kms_helper.h>
|
|
|
|
#include "rockchip_drm_drv.h"
|
|
-#include "rockchip_drm_vop.h"
|
|
|
|
#define DSI_PHY_RSTZ 0xa0
|
|
#define PHY_DISFORCEPLL 0
|
|
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
|
index 89bc86d620146c..aae48e906af11b 100644
|
|
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
|
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
|
@@ -18,7 +18,6 @@
|
|
#include <drm/drm_simple_kms_helper.h>
|
|
|
|
#include "rockchip_drm_drv.h"
|
|
-#include "rockchip_drm_vop.h"
|
|
|
|
#define RK3228_GRF_SOC_CON2 0x0408
|
|
#define RK3228_HDMI_SDAIN_MSK BIT(14)
|
|
diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
|
|
index 345253e033c538..50c984ac107d63 100644
|
|
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
|
|
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
|
|
@@ -23,7 +23,6 @@
|
|
#include <drm/drm_simple_kms_helper.h>
|
|
|
|
#include "rockchip_drm_drv.h"
|
|
-#include "rockchip_drm_vop.h"
|
|
|
|
#include "inno_hdmi.h"
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
|
|
index fa6e592e0276c3..78136d0c5a659e 100644
|
|
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
|
|
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
|
|
@@ -17,7 +17,6 @@
|
|
#include "rk3066_hdmi.h"
|
|
|
|
#include "rockchip_drm_drv.h"
|
|
-#include "rockchip_drm_vop.h"
|
|
|
|
#define DEFAULT_PLLA_RATE 30000000
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
|
|
index aeb03a57240fd9..bbb9e0bf68048a 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
|
|
@@ -20,6 +20,23 @@
|
|
#define ROCKCHIP_MAX_CONNECTOR 2
|
|
#define ROCKCHIP_MAX_CRTC 4
|
|
|
|
+/*
|
|
+ * display output interface supported by rockchip lcdc
|
|
+ */
|
|
+#define ROCKCHIP_OUT_MODE_P888 0
|
|
+#define ROCKCHIP_OUT_MODE_BT1120 0
|
|
+#define ROCKCHIP_OUT_MODE_P666 1
|
|
+#define ROCKCHIP_OUT_MODE_P565 2
|
|
+#define ROCKCHIP_OUT_MODE_BT656 5
|
|
+#define ROCKCHIP_OUT_MODE_S888 8
|
|
+#define ROCKCHIP_OUT_MODE_S888_DUMMY 12
|
|
+#define ROCKCHIP_OUT_MODE_YUV420 14
|
|
+/* for use special outface */
|
|
+#define ROCKCHIP_OUT_MODE_AAAA 15
|
|
+
|
|
+/* output flags */
|
|
+#define ROCKCHIP_OUTPUT_DSI_DUAL BIT(0)
|
|
+
|
|
struct drm_device;
|
|
struct drm_connector;
|
|
struct iommu_domain;
|
|
@@ -31,6 +48,7 @@ struct rockchip_crtc_state {
|
|
int output_bpc;
|
|
int output_flags;
|
|
bool enable_afbc;
|
|
+ bool yuv_overlay;
|
|
u32 bus_format;
|
|
u32 bus_flags;
|
|
int color_space;
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
|
index c5c716a69171a8..4ea369e004a912 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
|
@@ -277,18 +277,6 @@ struct vop_data {
|
|
/* dst alpha ctrl define */
|
|
#define DST_FACTOR_M0(x) (((x) & 0x7) << 6)
|
|
|
|
-/*
|
|
- * display output interface supported by rockchip lcdc
|
|
- */
|
|
-#define ROCKCHIP_OUT_MODE_P888 0
|
|
-#define ROCKCHIP_OUT_MODE_P666 1
|
|
-#define ROCKCHIP_OUT_MODE_P565 2
|
|
-/* for use special outface */
|
|
-#define ROCKCHIP_OUT_MODE_AAAA 15
|
|
-
|
|
-/* output flags */
|
|
-#define ROCKCHIP_OUTPUT_DSI_DUAL BIT(0)
|
|
-
|
|
enum alpha_mode {
|
|
ALPHA_STRAIGHT,
|
|
ALPHA_INVERSE,
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
|
|
index d1de12e850e746..d8f8c37c326c43 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
|
|
@@ -33,7 +33,6 @@
|
|
#include <uapi/linux/videodev2.h>
|
|
#include <dt-bindings/soc/rockchip,vop2.h>
|
|
|
|
-#include "rockchip_drm_drv.h"
|
|
#include "rockchip_drm_gem.h"
|
|
#include "rockchip_drm_fb.h"
|
|
#include "rockchip_drm_vop2.h"
|
|
@@ -465,6 +464,16 @@ static bool rockchip_vop2_mod_supported(struct drm_plane *plane, u32 format,
|
|
if (modifier == DRM_FORMAT_MOD_INVALID)
|
|
return false;
|
|
|
|
+ if (vop2->data->soc_id == 3568 || vop2->data->soc_id == 3566) {
|
|
+ if (vop2_cluster_window(win)) {
|
|
+ if (modifier == DRM_FORMAT_MOD_LINEAR) {
|
|
+ drm_dbg_kms(vop2->drm,
|
|
+ "Cluster window only supports format with afbc\n");
|
|
+ return false;
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
if (modifier == DRM_FORMAT_MOD_LINEAR)
|
|
return true;
|
|
|
|
@@ -1397,8 +1406,18 @@ static void vop2_post_config(struct drm_crtc *crtc)
|
|
u32 top_margin = 100, bottom_margin = 100;
|
|
u16 hsize = hdisplay * (left_margin + right_margin) / 200;
|
|
u16 vsize = vdisplay * (top_margin + bottom_margin) / 200;
|
|
+ u16 hsync_len = mode->crtc_hsync_end - mode->crtc_hsync_start;
|
|
u16 hact_end, vact_end;
|
|
u32 val;
|
|
+ u32 bg_dly;
|
|
+ u32 pre_scan_dly;
|
|
+
|
|
+ bg_dly = vp->data->pre_scan_max_dly[3];
|
|
+ vop2_writel(vp->vop2, RK3568_VP_BG_MIX_CTRL(vp->id),
|
|
+ FIELD_PREP(RK3568_VP_BG_MIX_CTRL__BG_DLY, bg_dly));
|
|
+
|
|
+ pre_scan_dly = ((bg_dly + (hdisplay >> 1) - 1) << 16) | hsync_len;
|
|
+ vop2_vp_write(vp, RK3568_VP_PRE_SCAN_HTIMING, pre_scan_dly);
|
|
|
|
vsize = rounddown(vsize, 2);
|
|
hsize = rounddown(hsize, 2);
|
|
@@ -1560,6 +1579,8 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc,
|
|
|
|
vop2->enable_count++;
|
|
|
|
+ vcstate->yuv_overlay = is_yuv_output(vcstate->bus_format);
|
|
+
|
|
vop2_crtc_enable_irq(vp, VP_INT_POST_BUF_EMPTY);
|
|
|
|
polflags = 0;
|
|
@@ -1587,7 +1608,7 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc,
|
|
if (vop2_output_uv_swap(vcstate->bus_format, vcstate->output_mode))
|
|
dsp_ctrl |= RK3568_VP_DSP_CTRL__DSP_RB_SWAP;
|
|
|
|
- if (is_yuv_output(vcstate->bus_format))
|
|
+ if (vcstate->yuv_overlay)
|
|
dsp_ctrl |= RK3568_VP_DSP_CTRL__POST_DSP_OUT_R2Y;
|
|
|
|
vop2_dither_setup(crtc, &dsp_ctrl);
|
|
@@ -1741,7 +1762,6 @@ static int vop2_find_start_mixer_id_for_vp(struct vop2 *vop2, u8 port_id)
|
|
|
|
static void vop2_setup_cluster_alpha(struct vop2 *vop2, struct vop2_win *main_win)
|
|
{
|
|
- u32 offset = (main_win->data->phys_id * 0x10);
|
|
struct vop2_alpha_config alpha_config;
|
|
struct vop2_alpha alpha;
|
|
struct drm_plane_state *bottom_win_pstate;
|
|
@@ -1749,6 +1769,7 @@ static void vop2_setup_cluster_alpha(struct vop2 *vop2, struct vop2_win *main_wi
|
|
u16 src_glb_alpha_val, dst_glb_alpha_val;
|
|
bool premulti_en = false;
|
|
bool swap = false;
|
|
+ u32 offset = 0;
|
|
|
|
/* At one win mode, win0 is dst/bottom win, and win1 is a all zero src/top win */
|
|
bottom_win_pstate = main_win->base.state;
|
|
@@ -1767,6 +1788,22 @@ static void vop2_setup_cluster_alpha(struct vop2 *vop2, struct vop2_win *main_wi
|
|
vop2_parse_alpha(&alpha_config, &alpha);
|
|
|
|
alpha.src_color_ctrl.bits.src_dst_swap = swap;
|
|
+
|
|
+ switch (main_win->data->phys_id) {
|
|
+ case ROCKCHIP_VOP2_CLUSTER0:
|
|
+ offset = 0x0;
|
|
+ break;
|
|
+ case ROCKCHIP_VOP2_CLUSTER1:
|
|
+ offset = 0x10;
|
|
+ break;
|
|
+ case ROCKCHIP_VOP2_CLUSTER2:
|
|
+ offset = 0x20;
|
|
+ break;
|
|
+ case ROCKCHIP_VOP2_CLUSTER3:
|
|
+ offset = 0x30;
|
|
+ break;
|
|
+ }
|
|
+
|
|
vop2_writel(vop2, RK3568_CLUSTER0_MIX_SRC_COLOR_CTRL + offset,
|
|
alpha.src_color_ctrl.val);
|
|
vop2_writel(vop2, RK3568_CLUSTER0_MIX_DST_COLOR_CTRL + offset,
|
|
@@ -1814,6 +1851,12 @@ static void vop2_setup_alpha(struct vop2_video_port *vp)
|
|
struct vop2_win *win = to_vop2_win(plane);
|
|
int zpos = plane->state->normalized_zpos;
|
|
|
|
+ /*
|
|
+ * Need to configure alpha from second layer.
|
|
+ */
|
|
+ if (zpos == 0)
|
|
+ continue;
|
|
+
|
|
if (plane->state->pixel_blend_mode == DRM_MODE_BLEND_PREMULTI)
|
|
premulti_en = 1;
|
|
else
|
|
@@ -1890,29 +1933,26 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)
|
|
struct drm_plane *plane;
|
|
u32 layer_sel = 0;
|
|
u32 port_sel;
|
|
- unsigned int nlayer, ofs;
|
|
- struct drm_display_mode *adjusted_mode;
|
|
- u16 hsync_len;
|
|
- u16 hdisplay;
|
|
- u32 bg_dly;
|
|
- u32 pre_scan_dly;
|
|
+ u8 layer_id;
|
|
+ u8 old_layer_id;
|
|
+ u8 layer_sel_id;
|
|
+ unsigned int ofs;
|
|
+ u32 ovl_ctrl;
|
|
int i;
|
|
struct vop2_video_port *vp0 = &vop2->vps[0];
|
|
struct vop2_video_port *vp1 = &vop2->vps[1];
|
|
struct vop2_video_port *vp2 = &vop2->vps[2];
|
|
+ struct rockchip_crtc_state *vcstate = to_rockchip_crtc_state(vp->crtc.state);
|
|
|
|
- adjusted_mode = &vp->crtc.state->adjusted_mode;
|
|
- hsync_len = adjusted_mode->crtc_hsync_end - adjusted_mode->crtc_hsync_start;
|
|
- hdisplay = adjusted_mode->crtc_hdisplay;
|
|
-
|
|
- bg_dly = vp->data->pre_scan_max_dly[3];
|
|
- vop2_writel(vop2, RK3568_VP_BG_MIX_CTRL(vp->id),
|
|
- FIELD_PREP(RK3568_VP_BG_MIX_CTRL__BG_DLY, bg_dly));
|
|
+ ovl_ctrl = vop2_readl(vop2, RK3568_OVL_CTRL);
|
|
+ ovl_ctrl |= RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD;
|
|
+ if (vcstate->yuv_overlay)
|
|
+ ovl_ctrl |= RK3568_OVL_CTRL__YUV_MODE(vp->id);
|
|
+ else
|
|
+ ovl_ctrl &= ~RK3568_OVL_CTRL__YUV_MODE(vp->id);
|
|
|
|
- pre_scan_dly = ((bg_dly + (hdisplay >> 1) - 1) << 16) | hsync_len;
|
|
- vop2_vp_write(vp, RK3568_VP_PRE_SCAN_HTIMING, pre_scan_dly);
|
|
+ vop2_writel(vop2, RK3568_OVL_CTRL, ovl_ctrl);
|
|
|
|
- vop2_writel(vop2, RK3568_OVL_CTRL, 0);
|
|
port_sel = vop2_readl(vop2, RK3568_OVL_PORT_SEL);
|
|
port_sel &= RK3568_OVL_PORT_SEL__SEL_PORT;
|
|
|
|
@@ -1940,9 +1980,30 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)
|
|
for (i = 0; i < vp->id; i++)
|
|
ofs += vop2->vps[i].nlayers;
|
|
|
|
- nlayer = 0;
|
|
drm_atomic_crtc_for_each_plane(plane, &vp->crtc) {
|
|
struct vop2_win *win = to_vop2_win(plane);
|
|
+ struct vop2_win *old_win;
|
|
+
|
|
+ layer_id = (u8)(plane->state->normalized_zpos + ofs);
|
|
+
|
|
+ /*
|
|
+ * Find the layer this win bind in old state.
|
|
+ */
|
|
+ for (old_layer_id = 0; old_layer_id < vop2->data->win_size; old_layer_id++) {
|
|
+ layer_sel_id = (layer_sel >> (4 * old_layer_id)) & 0xf;
|
|
+ if (layer_sel_id == win->data->layer_sel_id)
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ /*
|
|
+ * Find the win bind to this layer in old state
|
|
+ */
|
|
+ for (i = 0; i < vop2->data->win_size; i++) {
|
|
+ old_win = &vop2->win[i];
|
|
+ layer_sel_id = (layer_sel >> (4 * layer_id)) & 0xf;
|
|
+ if (layer_sel_id == old_win->data->layer_sel_id)
|
|
+ break;
|
|
+ }
|
|
|
|
switch (win->data->phys_id) {
|
|
case ROCKCHIP_VOP2_CLUSTER0:
|
|
@@ -1971,22 +2032,18 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)
|
|
break;
|
|
}
|
|
|
|
- layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER(plane->state->normalized_zpos + ofs,
|
|
- 0x7);
|
|
- layer_sel |= RK3568_OVL_LAYER_SEL__LAYER(plane->state->normalized_zpos + ofs,
|
|
- win->data->layer_sel_id);
|
|
- nlayer++;
|
|
- }
|
|
-
|
|
- /* configure unused layers to 0x5 (reserved) */
|
|
- for (; nlayer < vp->nlayers; nlayer++) {
|
|
- layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER(nlayer + ofs, 0x7);
|
|
- layer_sel |= RK3568_OVL_LAYER_SEL__LAYER(nlayer + ofs, 5);
|
|
+ layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER(layer_id, 0x7);
|
|
+ layer_sel |= RK3568_OVL_LAYER_SEL__LAYER(layer_id, win->data->layer_sel_id);
|
|
+ /*
|
|
+ * When we bind a window from layerM to layerN, we also need to move the old
|
|
+ * window on layerN to layerM to avoid one window selected by two or more layers.
|
|
+ */
|
|
+ layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER(old_layer_id, 0x7);
|
|
+ layer_sel |= RK3568_OVL_LAYER_SEL__LAYER(old_layer_id, old_win->data->layer_sel_id);
|
|
}
|
|
|
|
vop2_writel(vop2, RK3568_OVL_LAYER_SEL, layer_sel);
|
|
vop2_writel(vop2, RK3568_OVL_PORT_SEL, port_sel);
|
|
- vop2_writel(vop2, RK3568_OVL_CTRL, RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD);
|
|
}
|
|
|
|
static void vop2_setup_dly_for_windows(struct vop2 *vop2)
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
|
|
index f1234a151130fa..eec06ab1d73713 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
|
|
@@ -7,10 +7,10 @@
|
|
#ifndef _ROCKCHIP_DRM_VOP2_H
|
|
#define _ROCKCHIP_DRM_VOP2_H
|
|
|
|
-#include "rockchip_drm_vop.h"
|
|
-
|
|
#include <linux/regmap.h>
|
|
#include <drm/drm_modes.h>
|
|
+#include "rockchip_drm_drv.h"
|
|
+#include "rockchip_drm_vop.h"
|
|
|
|
#define VOP_FEATURE_OUTPUT_10BIT BIT(0)
|
|
|
|
@@ -169,19 +169,6 @@ struct vop2_data {
|
|
#define WB_YRGB_FIFO_FULL_INTR BIT(18)
|
|
#define WB_COMPLETE_INTR BIT(19)
|
|
|
|
-/*
|
|
- * display output interface supported by rockchip lcdc
|
|
- */
|
|
-#define ROCKCHIP_OUT_MODE_P888 0
|
|
-#define ROCKCHIP_OUT_MODE_BT1120 0
|
|
-#define ROCKCHIP_OUT_MODE_P666 1
|
|
-#define ROCKCHIP_OUT_MODE_P565 2
|
|
-#define ROCKCHIP_OUT_MODE_BT656 5
|
|
-#define ROCKCHIP_OUT_MODE_S888 8
|
|
-#define ROCKCHIP_OUT_MODE_S888_DUMMY 12
|
|
-#define ROCKCHIP_OUT_MODE_YUV420 14
|
|
-/* for use special outface */
|
|
-#define ROCKCHIP_OUT_MODE_AAAA 15
|
|
|
|
enum vop_csc_format {
|
|
CSC_BT601L,
|
|
@@ -418,6 +405,7 @@ enum dst_factor_mode {
|
|
#define VOP2_COLOR_KEY_MASK BIT(31)
|
|
|
|
#define RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD BIT(28)
|
|
+#define RK3568_OVL_CTRL__YUV_MODE(vp) BIT(vp)
|
|
|
|
#define RK3568_VP_BG_MIX_CTRL__BG_DLY GENMASK(31, 24)
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c
|
|
index 1b6e0b210aa530..107959530c2201 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_lvds.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c
|
|
@@ -27,7 +27,6 @@
|
|
#include <drm/drm_simple_kms_helper.h>
|
|
|
|
#include "rockchip_drm_drv.h"
|
|
-#include "rockchip_drm_vop.h"
|
|
#include "rockchip_lvds.h"
|
|
|
|
#define DISPLAY_OUTPUT_RGB 0
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c b/drivers/gpu/drm/rockchip/rockchip_rgb.c
|
|
index c677b71ae516be..dbfbde24698ef0 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_rgb.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c
|
|
@@ -19,7 +19,6 @@
|
|
#include <drm/drm_simple_kms_helper.h>
|
|
|
|
#include "rockchip_drm_drv.h"
|
|
-#include "rockchip_drm_vop.h"
|
|
#include "rockchip_rgb.h"
|
|
|
|
struct rockchip_rgb {
|
|
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
|
|
index 558f3988fb2cff..8f156a69912c89 100644
|
|
--- a/drivers/hid/hid-core.c
|
|
+++ b/drivers/hid/hid-core.c
|
|
@@ -1125,6 +1125,8 @@ static void hid_apply_multiplier(struct hid_device *hid,
|
|
while (multiplier_collection->parent_idx != -1 &&
|
|
multiplier_collection->type != HID_COLLECTION_LOGICAL)
|
|
multiplier_collection = &hid->collection[multiplier_collection->parent_idx];
|
|
+ if (multiplier_collection->type != HID_COLLECTION_LOGICAL)
|
|
+ multiplier_collection = NULL;
|
|
|
|
effective_multiplier = hid_calculate_multiplier(hid, multiplier);
|
|
|
|
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
|
|
index fda9dce3da9980..9d80635a91ebd8 100644
|
|
--- a/drivers/hid/hid-input.c
|
|
+++ b/drivers/hid/hid-input.c
|
|
@@ -810,10 +810,23 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
|
break;
|
|
}
|
|
|
|
- if ((usage->hid & 0xf0) == 0x90) { /* SystemControl*/
|
|
- switch (usage->hid & 0xf) {
|
|
- case 0xb: map_key_clear(KEY_DO_NOT_DISTURB); break;
|
|
- default: goto ignore;
|
|
+ if ((usage->hid & 0xf0) == 0x90) { /* SystemControl & D-pad */
|
|
+ switch (usage->hid) {
|
|
+ case HID_GD_UP: usage->hat_dir = 1; break;
|
|
+ case HID_GD_DOWN: usage->hat_dir = 5; break;
|
|
+ case HID_GD_RIGHT: usage->hat_dir = 3; break;
|
|
+ case HID_GD_LEFT: usage->hat_dir = 7; break;
|
|
+ case HID_GD_DO_NOT_DISTURB:
|
|
+ map_key_clear(KEY_DO_NOT_DISTURB); break;
|
|
+ default: goto unknown;
|
|
+ }
|
|
+
|
|
+ if (usage->hid <= HID_GD_LEFT) {
|
|
+ if (field->dpad) {
|
|
+ map_abs(field->dpad);
|
|
+ goto ignore;
|
|
+ }
|
|
+ map_abs(ABS_HAT0X);
|
|
}
|
|
break;
|
|
}
|
|
@@ -844,22 +857,6 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
|
if (field->application == HID_GD_SYSTEM_CONTROL)
|
|
goto ignore;
|
|
|
|
- if ((usage->hid & 0xf0) == 0x90) { /* D-pad */
|
|
- switch (usage->hid) {
|
|
- case HID_GD_UP: usage->hat_dir = 1; break;
|
|
- case HID_GD_DOWN: usage->hat_dir = 5; break;
|
|
- case HID_GD_RIGHT: usage->hat_dir = 3; break;
|
|
- case HID_GD_LEFT: usage->hat_dir = 7; break;
|
|
- default: goto unknown;
|
|
- }
|
|
- if (field->dpad) {
|
|
- map_abs(field->dpad);
|
|
- goto ignore;
|
|
- }
|
|
- map_abs(ABS_HAT0X);
|
|
- break;
|
|
- }
|
|
-
|
|
switch (usage->hid) {
|
|
/* These usage IDs map directly to the usage codes. */
|
|
case HID_GD_X: case HID_GD_Y: case HID_GD_Z:
|
|
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
|
|
index e62104e1a6038b..5ad871a7d1a44c 100644
|
|
--- a/drivers/hid/hid-multitouch.c
|
|
+++ b/drivers/hid/hid-multitouch.c
|
|
@@ -2072,7 +2072,7 @@ static const struct hid_device_id mt_devices[] = {
|
|
I2C_DEVICE_ID_GOODIX_01E8) },
|
|
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU,
|
|
HID_DEVICE(BUS_I2C, HID_GROUP_ANY, I2C_VENDOR_ID_GOODIX,
|
|
- I2C_DEVICE_ID_GOODIX_01E8) },
|
|
+ I2C_DEVICE_ID_GOODIX_01E9) },
|
|
|
|
/* GoodTouch panels */
|
|
{ .driver_data = MT_CLS_NSMU,
|
|
diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c
|
|
index cf1679b0d4fbb5..6c3e758bbb09e3 100644
|
|
--- a/drivers/hid/hid-thrustmaster.c
|
|
+++ b/drivers/hid/hid-thrustmaster.c
|
|
@@ -170,6 +170,14 @@ static void thrustmaster_interrupts(struct hid_device *hdev)
|
|
ep = &usbif->cur_altsetting->endpoint[1];
|
|
b_ep = ep->desc.bEndpointAddress;
|
|
|
|
+ /* Are the expected endpoints present? */
|
|
+ u8 ep_addr[1] = {b_ep};
|
|
+
|
|
+ if (!usb_check_int_endpoints(usbif, ep_addr)) {
|
|
+ hid_err(hdev, "Unexpected non-int endpoint\n");
|
|
+ return;
|
|
+ }
|
|
+
|
|
for (i = 0; i < ARRAY_SIZE(setup_arr); ++i) {
|
|
memcpy(send_buf, setup_arr[i], setup_arr_sizes[i]);
|
|
|
|
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
|
|
index 235235613c1b99..030127525672e7 100644
|
|
--- a/drivers/i3c/master/dw-i3c-master.c
|
|
+++ b/drivers/i3c/master/dw-i3c-master.c
|
|
@@ -1136,6 +1136,23 @@ static void dw_i3c_master_free_ibi(struct i3c_dev_desc *dev)
|
|
data->ibi_pool = NULL;
|
|
}
|
|
|
|
+static void dw_i3c_master_enable_sir_signal(struct dw_i3c_master *master, bool enable)
|
|
+{
|
|
+ u32 reg;
|
|
+
|
|
+ reg = readl(master->regs + INTR_STATUS_EN);
|
|
+ reg &= ~INTR_IBI_THLD_STAT;
|
|
+ if (enable)
|
|
+ reg |= INTR_IBI_THLD_STAT;
|
|
+ writel(reg, master->regs + INTR_STATUS_EN);
|
|
+
|
|
+ reg = readl(master->regs + INTR_SIGNAL_EN);
|
|
+ reg &= ~INTR_IBI_THLD_STAT;
|
|
+ if (enable)
|
|
+ reg |= INTR_IBI_THLD_STAT;
|
|
+ writel(reg, master->regs + INTR_SIGNAL_EN);
|
|
+}
|
|
+
|
|
static void dw_i3c_master_set_sir_enabled(struct dw_i3c_master *master,
|
|
struct i3c_dev_desc *dev,
|
|
u8 idx, bool enable)
|
|
@@ -1170,23 +1187,34 @@ static void dw_i3c_master_set_sir_enabled(struct dw_i3c_master *master,
|
|
}
|
|
writel(reg, master->regs + IBI_SIR_REQ_REJECT);
|
|
|
|
- if (global) {
|
|
- reg = readl(master->regs + INTR_STATUS_EN);
|
|
- reg &= ~INTR_IBI_THLD_STAT;
|
|
- if (enable)
|
|
- reg |= INTR_IBI_THLD_STAT;
|
|
- writel(reg, master->regs + INTR_STATUS_EN);
|
|
-
|
|
- reg = readl(master->regs + INTR_SIGNAL_EN);
|
|
- reg &= ~INTR_IBI_THLD_STAT;
|
|
- if (enable)
|
|
- reg |= INTR_IBI_THLD_STAT;
|
|
- writel(reg, master->regs + INTR_SIGNAL_EN);
|
|
- }
|
|
+ if (global)
|
|
+ dw_i3c_master_enable_sir_signal(master, enable);
|
|
+
|
|
|
|
spin_unlock_irqrestore(&master->devs_lock, flags);
|
|
}
|
|
|
|
+static int dw_i3c_master_enable_hotjoin(struct i3c_master_controller *m)
|
|
+{
|
|
+ struct dw_i3c_master *master = to_dw_i3c_master(m);
|
|
+
|
|
+ dw_i3c_master_enable_sir_signal(master, true);
|
|
+ writel(readl(master->regs + DEVICE_CTRL) & ~DEV_CTRL_HOT_JOIN_NACK,
|
|
+ master->regs + DEVICE_CTRL);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int dw_i3c_master_disable_hotjoin(struct i3c_master_controller *m)
|
|
+{
|
|
+ struct dw_i3c_master *master = to_dw_i3c_master(m);
|
|
+
|
|
+ writel(readl(master->regs + DEVICE_CTRL) | DEV_CTRL_HOT_JOIN_NACK,
|
|
+ master->regs + DEVICE_CTRL);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static int dw_i3c_master_enable_ibi(struct i3c_dev_desc *dev)
|
|
{
|
|
struct dw_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
|
|
@@ -1326,6 +1354,8 @@ static void dw_i3c_master_irq_handle_ibis(struct dw_i3c_master *master)
|
|
|
|
if (IBI_TYPE_SIRQ(reg)) {
|
|
dw_i3c_master_handle_ibi_sir(master, reg);
|
|
+ } else if (IBI_TYPE_HJ(reg)) {
|
|
+ queue_work(master->base.wq, &master->hj_work);
|
|
} else {
|
|
len = IBI_QUEUE_STATUS_DATA_LEN(reg);
|
|
dev_info(&master->base.dev,
|
|
@@ -1393,6 +1423,8 @@ static const struct i3c_master_controller_ops dw_mipi_i3c_ibi_ops = {
|
|
.enable_ibi = dw_i3c_master_enable_ibi,
|
|
.disable_ibi = dw_i3c_master_disable_ibi,
|
|
.recycle_ibi_slot = dw_i3c_master_recycle_ibi_slot,
|
|
+ .enable_hotjoin = dw_i3c_master_enable_hotjoin,
|
|
+ .disable_hotjoin = dw_i3c_master_disable_hotjoin,
|
|
};
|
|
|
|
/* default platform ops implementations */
|
|
@@ -1412,6 +1444,14 @@ static const struct dw_i3c_platform_ops dw_i3c_platform_ops_default = {
|
|
.set_dat_ibi = dw_i3c_platform_set_dat_ibi_nop,
|
|
};
|
|
|
|
+static void dw_i3c_hj_work(struct work_struct *work)
|
|
+{
|
|
+ struct dw_i3c_master *master =
|
|
+ container_of(work, typeof(*master), hj_work);
|
|
+
|
|
+ i3c_master_do_daa(&master->base);
|
|
+}
|
|
+
|
|
int dw_i3c_common_probe(struct dw_i3c_master *master,
|
|
struct platform_device *pdev)
|
|
{
|
|
@@ -1469,6 +1509,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
|
|
if (master->ibi_capable)
|
|
ops = &dw_mipi_i3c_ibi_ops;
|
|
|
|
+ INIT_WORK(&master->hj_work, dw_i3c_hj_work);
|
|
ret = i3c_master_register(&master->base, &pdev->dev, ops, false);
|
|
if (ret)
|
|
goto err_assert_rst;
|
|
@@ -1487,6 +1528,7 @@ EXPORT_SYMBOL_GPL(dw_i3c_common_probe);
|
|
|
|
void dw_i3c_common_remove(struct dw_i3c_master *master)
|
|
{
|
|
+ cancel_work_sync(&master->hj_work);
|
|
i3c_master_unregister(&master->base);
|
|
|
|
reset_control_assert(master->core_rst);
|
|
diff --git a/drivers/i3c/master/dw-i3c-master.h b/drivers/i3c/master/dw-i3c-master.h
|
|
index ab862c5d15fe72..4ab94aa72252e4 100644
|
|
--- a/drivers/i3c/master/dw-i3c-master.h
|
|
+++ b/drivers/i3c/master/dw-i3c-master.h
|
|
@@ -57,6 +57,8 @@ struct dw_i3c_master {
|
|
|
|
/* platform-specific data */
|
|
const struct dw_i3c_platform_ops *platform_ops;
|
|
+
|
|
+ struct work_struct hj_work;
|
|
};
|
|
|
|
struct dw_i3c_platform_ops {
|
|
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
|
|
index 5f879598699545..32f1f91e272046 100644
|
|
--- a/drivers/iio/adc/ti_am335x_adc.c
|
|
+++ b/drivers/iio/adc/ti_am335x_adc.c
|
|
@@ -564,13 +564,11 @@ static int tiadc_parse_dt(struct platform_device *pdev,
|
|
struct tiadc_device *adc_dev)
|
|
{
|
|
struct device_node *node = pdev->dev.of_node;
|
|
- struct property *prop;
|
|
- const __be32 *cur;
|
|
int channels = 0;
|
|
u32 val;
|
|
int i;
|
|
|
|
- of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) {
|
|
+ of_property_for_each_u32(node, "ti,adc-channels", val) {
|
|
adc_dev->channel_line[channels] = val;
|
|
|
|
/* Set Default values for optional DT parameters */
|
|
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
|
|
index 08da793969ee55..f7345e4890a141 100644
|
|
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
|
|
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
|
|
@@ -4278,9 +4278,10 @@ int bnxt_re_mmap(struct ib_ucontext *ib_uctx, struct vm_area_struct *vma)
|
|
case BNXT_RE_MMAP_DBR_PAGE:
|
|
/* Driver doesn't expect write access for user space */
|
|
if (vma->vm_flags & VM_WRITE)
|
|
- return -EFAULT;
|
|
- ret = vm_insert_page(vma, vma->vm_start,
|
|
- virt_to_page((void *)bnxt_entry->mem_offset));
|
|
+ ret = -EFAULT;
|
|
+ else
|
|
+ ret = vm_insert_page(vma, vma->vm_start,
|
|
+ virt_to_page((void *)bnxt_entry->mem_offset));
|
|
break;
|
|
default:
|
|
ret = -EINVAL;
|
|
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
|
|
index 80970a1738f8a6..034b85c4225555 100644
|
|
--- a/drivers/infiniband/hw/cxgb4/device.c
|
|
+++ b/drivers/infiniband/hw/cxgb4/device.c
|
|
@@ -1114,8 +1114,10 @@ static inline struct sk_buff *copy_gl_to_skb_pkt(const struct pkt_gl *gl,
|
|
* The math here assumes sizeof cpl_pass_accept_req >= sizeof
|
|
* cpl_rx_pkt.
|
|
*/
|
|
- skb = alloc_skb(gl->tot_len + sizeof(struct cpl_pass_accept_req) +
|
|
- sizeof(struct rss_header) - pktshift, GFP_ATOMIC);
|
|
+ skb = alloc_skb(size_add(gl->tot_len,
|
|
+ sizeof(struct cpl_pass_accept_req) +
|
|
+ sizeof(struct rss_header)) - pktshift,
|
|
+ GFP_ATOMIC);
|
|
if (unlikely(!skb))
|
|
return NULL;
|
|
|
|
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
|
|
index 529db874d67c69..b1bbdcff631d56 100644
|
|
--- a/drivers/infiniband/hw/mlx4/main.c
|
|
+++ b/drivers/infiniband/hw/mlx4/main.c
|
|
@@ -351,7 +351,7 @@ static int mlx4_ib_del_gid(const struct ib_gid_attr *attr, void **context)
|
|
struct mlx4_port_gid_table *port_gid_table;
|
|
int ret = 0;
|
|
int hw_update = 0;
|
|
- struct gid_entry *gids;
|
|
+ struct gid_entry *gids = NULL;
|
|
|
|
if (!rdma_cap_roce_gid_table(attr->device, attr->port_num))
|
|
return -EINVAL;
|
|
@@ -389,10 +389,10 @@ static int mlx4_ib_del_gid(const struct ib_gid_attr *attr, void **context)
|
|
}
|
|
spin_unlock_bh(&iboe->lock);
|
|
|
|
- if (!ret && hw_update) {
|
|
+ if (gids)
|
|
ret = mlx4_ib_update_gids(gids, ibdev, attr->port_num);
|
|
- kfree(gids);
|
|
- }
|
|
+
|
|
+ kfree(gids);
|
|
return ret;
|
|
}
|
|
|
|
diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
|
|
index 3a4605fda6d57e..f1a0a324223c0d 100644
|
|
--- a/drivers/infiniband/hw/mlx5/odp.c
|
|
+++ b/drivers/infiniband/hw/mlx5/odp.c
|
|
@@ -807,8 +807,7 @@ static bool mkey_is_eq(struct mlx5_ib_mkey *mmkey, u32 key)
|
|
/*
|
|
* Handle a single data segment in a page-fault WQE or RDMA region.
|
|
*
|
|
- * Returns number of OS pages retrieved on success. The caller may continue to
|
|
- * the next data segment.
|
|
+ * Returns zero on success. The caller may continue to the next data segment.
|
|
* Can return the following error codes:
|
|
* -EAGAIN to designate a temporary error. The caller will abort handling the
|
|
* page fault and resolve it.
|
|
@@ -821,7 +820,7 @@ static int pagefault_single_data_segment(struct mlx5_ib_dev *dev,
|
|
u32 *bytes_committed,
|
|
u32 *bytes_mapped)
|
|
{
|
|
- int npages = 0, ret, i, outlen, cur_outlen = 0, depth = 0;
|
|
+ int ret, i, outlen, cur_outlen = 0, depth = 0, pages_in_range;
|
|
struct pf_frame *head = NULL, *frame;
|
|
struct mlx5_ib_mkey *mmkey;
|
|
struct mlx5_ib_mr *mr;
|
|
@@ -864,13 +863,20 @@ static int pagefault_single_data_segment(struct mlx5_ib_dev *dev,
|
|
case MLX5_MKEY_MR:
|
|
mr = container_of(mmkey, struct mlx5_ib_mr, mmkey);
|
|
|
|
+ pages_in_range = (ALIGN(io_virt + bcnt, PAGE_SIZE) -
|
|
+ (io_virt & PAGE_MASK)) >>
|
|
+ PAGE_SHIFT;
|
|
ret = pagefault_mr(mr, io_virt, bcnt, bytes_mapped, 0, false);
|
|
if (ret < 0)
|
|
goto end;
|
|
|
|
mlx5_update_odp_stats(mr, faults, ret);
|
|
|
|
- npages += ret;
|
|
+ if (ret < pages_in_range) {
|
|
+ ret = -EFAULT;
|
|
+ goto end;
|
|
+ }
|
|
+
|
|
ret = 0;
|
|
break;
|
|
|
|
@@ -961,7 +967,7 @@ static int pagefault_single_data_segment(struct mlx5_ib_dev *dev,
|
|
kfree(out);
|
|
|
|
*bytes_committed = 0;
|
|
- return ret ? ret : npages;
|
|
+ return ret;
|
|
}
|
|
|
|
/*
|
|
@@ -980,8 +986,7 @@ static int pagefault_single_data_segment(struct mlx5_ib_dev *dev,
|
|
* the committed bytes).
|
|
* @receive_queue: receive WQE end of sg list
|
|
*
|
|
- * Returns the number of pages loaded if positive, zero for an empty WQE, or a
|
|
- * negative error code.
|
|
+ * Returns zero for success or a negative error code.
|
|
*/
|
|
static int pagefault_data_segments(struct mlx5_ib_dev *dev,
|
|
struct mlx5_pagefault *pfault,
|
|
@@ -989,7 +994,7 @@ static int pagefault_data_segments(struct mlx5_ib_dev *dev,
|
|
void *wqe_end, u32 *bytes_mapped,
|
|
u32 *total_wqe_bytes, bool receive_queue)
|
|
{
|
|
- int ret = 0, npages = 0;
|
|
+ int ret = 0;
|
|
u64 io_virt;
|
|
__be32 key;
|
|
u32 byte_count;
|
|
@@ -1046,10 +1051,9 @@ static int pagefault_data_segments(struct mlx5_ib_dev *dev,
|
|
bytes_mapped);
|
|
if (ret < 0)
|
|
break;
|
|
- npages += ret;
|
|
}
|
|
|
|
- return ret < 0 ? ret : npages;
|
|
+ return ret;
|
|
}
|
|
|
|
/*
|
|
@@ -1285,12 +1289,6 @@ static void mlx5_ib_mr_wqe_pfault_handler(struct mlx5_ib_dev *dev,
|
|
free_page((unsigned long)wqe_start);
|
|
}
|
|
|
|
-static int pages_in_range(u64 address, u32 length)
|
|
-{
|
|
- return (ALIGN(address + length, PAGE_SIZE) -
|
|
- (address & PAGE_MASK)) >> PAGE_SHIFT;
|
|
-}
|
|
-
|
|
static void mlx5_ib_mr_rdma_pfault_handler(struct mlx5_ib_dev *dev,
|
|
struct mlx5_pagefault *pfault)
|
|
{
|
|
@@ -1329,7 +1327,7 @@ static void mlx5_ib_mr_rdma_pfault_handler(struct mlx5_ib_dev *dev,
|
|
if (ret == -EAGAIN) {
|
|
/* We're racing with an invalidation, don't prefetch */
|
|
prefetch_activated = 0;
|
|
- } else if (ret < 0 || pages_in_range(address, length) > ret) {
|
|
+ } else if (ret < 0) {
|
|
mlx5_ib_page_fault_resume(dev, pfault, 1);
|
|
if (ret != -ENOENT)
|
|
mlx5_ib_dbg(dev, "PAGE FAULT error %d. QP 0x%x, type: 0x%x\n",
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
|
|
index 6f9ec8db014c79..0f8356cea2931e 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe.c
|
|
@@ -163,7 +163,7 @@ void rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
|
|
port->attr.active_mtu = mtu;
|
|
port->mtu_cap = ib_mtu_enum_to_int(mtu);
|
|
|
|
- rxe_info_dev(rxe, "Set mtu to %d", port->mtu_cap);
|
|
+ rxe_info_dev(rxe, "Set mtu to %d\n", port->mtu_cap);
|
|
}
|
|
|
|
/* called by ifc layer to create new rxe device.
|
|
@@ -183,7 +183,7 @@ static int rxe_newlink(const char *ibdev_name, struct net_device *ndev)
|
|
int err = 0;
|
|
|
|
if (is_vlan_dev(ndev)) {
|
|
- rxe_err("rxe creation allowed on top of a real device only");
|
|
+ rxe_err("rxe creation allowed on top of a real device only\n");
|
|
err = -EPERM;
|
|
goto err;
|
|
}
|
|
@@ -191,7 +191,7 @@ static int rxe_newlink(const char *ibdev_name, struct net_device *ndev)
|
|
rxe = rxe_get_dev_from_net(ndev);
|
|
if (rxe) {
|
|
ib_device_put(&rxe->ib_dev);
|
|
- rxe_err_dev(rxe, "already configured on %s", ndev->name);
|
|
+ rxe_err_dev(rxe, "already configured on %s\n", ndev->name);
|
|
err = -EEXIST;
|
|
goto err;
|
|
}
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe.h b/drivers/infiniband/sw/rxe/rxe.h
|
|
index d33dd6cf83d377..d8fb2c7af30a7e 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe.h
|
|
+++ b/drivers/infiniband/sw/rxe/rxe.h
|
|
@@ -38,7 +38,7 @@
|
|
|
|
#define RXE_ROCE_V2_SPORT (0xc000)
|
|
|
|
-#define rxe_dbg(fmt, ...) pr_debug("%s: " fmt "\n", __func__, ##__VA_ARGS__)
|
|
+#define rxe_dbg(fmt, ...) pr_debug("%s: " fmt, __func__, ##__VA_ARGS__)
|
|
#define rxe_dbg_dev(rxe, fmt, ...) ibdev_dbg(&(rxe)->ib_dev, \
|
|
"%s: " fmt, __func__, ##__VA_ARGS__)
|
|
#define rxe_dbg_uc(uc, fmt, ...) ibdev_dbg((uc)->ibuc.device, \
|
|
@@ -58,7 +58,7 @@
|
|
#define rxe_dbg_mw(mw, fmt, ...) ibdev_dbg((mw)->ibmw.device, \
|
|
"mw#%d %s: " fmt, (mw)->elem.index, __func__, ##__VA_ARGS__)
|
|
|
|
-#define rxe_err(fmt, ...) pr_err_ratelimited("%s: " fmt "\n", __func__, \
|
|
+#define rxe_err(fmt, ...) pr_err_ratelimited("%s: " fmt, __func__, \
|
|
##__VA_ARGS__)
|
|
#define rxe_err_dev(rxe, fmt, ...) ibdev_err_ratelimited(&(rxe)->ib_dev, \
|
|
"%s: " fmt, __func__, ##__VA_ARGS__)
|
|
@@ -79,7 +79,7 @@
|
|
#define rxe_err_mw(mw, fmt, ...) ibdev_err_ratelimited((mw)->ibmw.device, \
|
|
"mw#%d %s: " fmt, (mw)->elem.index, __func__, ##__VA_ARGS__)
|
|
|
|
-#define rxe_info(fmt, ...) pr_info_ratelimited("%s: " fmt "\n", __func__, \
|
|
+#define rxe_info(fmt, ...) pr_info_ratelimited("%s: " fmt, __func__, \
|
|
##__VA_ARGS__)
|
|
#define rxe_info_dev(rxe, fmt, ...) ibdev_info_ratelimited(&(rxe)->ib_dev, \
|
|
"%s: " fmt, __func__, ##__VA_ARGS__)
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c
|
|
index acd2172bf092bd..c997b7cbf2a9e8 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_comp.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_comp.c
|
|
@@ -433,7 +433,7 @@ static void make_send_cqe(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
|
|
}
|
|
} else {
|
|
if (wqe->status != IB_WC_WR_FLUSH_ERR)
|
|
- rxe_err_qp(qp, "non-flush error status = %d",
|
|
+ rxe_err_qp(qp, "non-flush error status = %d\n",
|
|
wqe->status);
|
|
}
|
|
}
|
|
@@ -582,7 +582,7 @@ static int flush_send_wqe(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
|
|
|
|
err = rxe_cq_post(qp->scq, &cqe, 0);
|
|
if (err)
|
|
- rxe_dbg_cq(qp->scq, "post cq failed, err = %d", err);
|
|
+ rxe_dbg_cq(qp->scq, "post cq failed, err = %d\n", err);
|
|
|
|
return err;
|
|
}
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_cq.c b/drivers/infiniband/sw/rxe/rxe_cq.c
|
|
index d5486cbb3f1004..fec87c9030abdc 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_cq.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_cq.c
|
|
@@ -27,7 +27,7 @@ int rxe_cq_chk_attr(struct rxe_dev *rxe, struct rxe_cq *cq,
|
|
if (cq) {
|
|
count = queue_count(cq->queue, QUEUE_TYPE_TO_CLIENT);
|
|
if (cqe < count) {
|
|
- rxe_dbg_cq(cq, "cqe(%d) < current # elements in queue (%d)",
|
|
+ rxe_dbg_cq(cq, "cqe(%d) < current # elements in queue (%d)\n",
|
|
cqe, count);
|
|
goto err1;
|
|
}
|
|
@@ -96,7 +96,7 @@ int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited)
|
|
|
|
full = queue_full(cq->queue, QUEUE_TYPE_TO_CLIENT);
|
|
if (unlikely(full)) {
|
|
- rxe_err_cq(cq, "queue full");
|
|
+ rxe_err_cq(cq, "queue full\n");
|
|
spin_unlock_irqrestore(&cq->cq_lock, flags);
|
|
if (cq->ibcq.event_handler) {
|
|
ev.device = cq->ibcq.device;
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
|
|
index f54042e9aeb268..bc81fde696ee96 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_mr.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_mr.c
|
|
@@ -34,7 +34,7 @@ int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length)
|
|
case IB_MR_TYPE_MEM_REG:
|
|
if (iova < mr->ibmr.iova ||
|
|
iova + length > mr->ibmr.iova + mr->ibmr.length) {
|
|
- rxe_dbg_mr(mr, "iova/length out of range");
|
|
+ rxe_dbg_mr(mr, "iova/length out of range\n");
|
|
return -EINVAL;
|
|
}
|
|
return 0;
|
|
@@ -319,7 +319,7 @@ int rxe_mr_copy(struct rxe_mr *mr, u64 iova, void *addr,
|
|
|
|
err = mr_check_range(mr, iova, length);
|
|
if (unlikely(err)) {
|
|
- rxe_dbg_mr(mr, "iova out of range");
|
|
+ rxe_dbg_mr(mr, "iova out of range\n");
|
|
return err;
|
|
}
|
|
|
|
@@ -477,7 +477,7 @@ int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
|
|
u64 *va;
|
|
|
|
if (unlikely(mr->state != RXE_MR_STATE_VALID)) {
|
|
- rxe_dbg_mr(mr, "mr not in valid state");
|
|
+ rxe_dbg_mr(mr, "mr not in valid state\n");
|
|
return RESPST_ERR_RKEY_VIOLATION;
|
|
}
|
|
|
|
@@ -490,7 +490,7 @@ int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
|
|
|
|
err = mr_check_range(mr, iova, sizeof(value));
|
|
if (err) {
|
|
- rxe_dbg_mr(mr, "iova out of range");
|
|
+ rxe_dbg_mr(mr, "iova out of range\n");
|
|
return RESPST_ERR_RKEY_VIOLATION;
|
|
}
|
|
page_offset = rxe_mr_iova_to_page_offset(mr, iova);
|
|
@@ -501,7 +501,7 @@ int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
|
|
}
|
|
|
|
if (unlikely(page_offset & 0x7)) {
|
|
- rxe_dbg_mr(mr, "iova not aligned");
|
|
+ rxe_dbg_mr(mr, "iova not aligned\n");
|
|
return RESPST_ERR_MISALIGNED_ATOMIC;
|
|
}
|
|
|
|
@@ -534,7 +534,7 @@ int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
|
|
|
|
/* See IBA oA19-28 */
|
|
if (unlikely(mr->state != RXE_MR_STATE_VALID)) {
|
|
- rxe_dbg_mr(mr, "mr not in valid state");
|
|
+ rxe_dbg_mr(mr, "mr not in valid state\n");
|
|
return RESPST_ERR_RKEY_VIOLATION;
|
|
}
|
|
|
|
@@ -548,7 +548,7 @@ int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
|
|
/* See IBA oA19-28 */
|
|
err = mr_check_range(mr, iova, sizeof(value));
|
|
if (unlikely(err)) {
|
|
- rxe_dbg_mr(mr, "iova out of range");
|
|
+ rxe_dbg_mr(mr, "iova out of range\n");
|
|
return RESPST_ERR_RKEY_VIOLATION;
|
|
}
|
|
page_offset = rxe_mr_iova_to_page_offset(mr, iova);
|
|
@@ -560,7 +560,7 @@ int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
|
|
|
|
/* See IBA A19.4.2 */
|
|
if (unlikely(page_offset & 0x7)) {
|
|
- rxe_dbg_mr(mr, "misaligned address");
|
|
+ rxe_dbg_mr(mr, "misaligned address\n");
|
|
return RESPST_ERR_MISALIGNED_ATOMIC;
|
|
}
|
|
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_mw.c b/drivers/infiniband/sw/rxe/rxe_mw.c
|
|
index d9312b5c9d207e..379e65bfcd49af 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_mw.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_mw.c
|
|
@@ -198,7 +198,7 @@ int rxe_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
|
|
}
|
|
|
|
if (access & ~RXE_ACCESS_SUPPORTED_MW) {
|
|
- rxe_err_mw(mw, "access %#x not supported", access);
|
|
+ rxe_err_mw(mw, "access %#x not supported\n", access);
|
|
ret = -EOPNOTSUPP;
|
|
goto err_drop_mr;
|
|
}
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_param.h b/drivers/infiniband/sw/rxe/rxe_param.h
|
|
index d2f57ead78ad12..003f681e5dc022 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_param.h
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_param.h
|
|
@@ -129,7 +129,7 @@ enum rxe_device_param {
|
|
enum rxe_port_param {
|
|
RXE_PORT_GID_TBL_LEN = 1024,
|
|
RXE_PORT_PORT_CAP_FLAGS = IB_PORT_CM_SUP,
|
|
- RXE_PORT_MAX_MSG_SZ = 0x800000,
|
|
+ RXE_PORT_MAX_MSG_SZ = (1UL << 31),
|
|
RXE_PORT_BAD_PKEY_CNTR = 0,
|
|
RXE_PORT_QKEY_VIOL_CNTR = 0,
|
|
RXE_PORT_LID = 0,
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_pool.c b/drivers/infiniband/sw/rxe/rxe_pool.c
|
|
index 6215c6de3a8408..368e366f254d49 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_pool.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_pool.c
|
|
@@ -178,7 +178,6 @@ int __rxe_cleanup(struct rxe_pool_elem *elem, bool sleepable)
|
|
{
|
|
struct rxe_pool *pool = elem->pool;
|
|
struct xarray *xa = &pool->xa;
|
|
- static int timeout = RXE_POOL_TIMEOUT;
|
|
int ret, err = 0;
|
|
void *xa_ret;
|
|
|
|
@@ -202,19 +201,19 @@ int __rxe_cleanup(struct rxe_pool_elem *elem, bool sleepable)
|
|
* return to rdma-core
|
|
*/
|
|
if (sleepable) {
|
|
- if (!completion_done(&elem->complete) && timeout) {
|
|
+ if (!completion_done(&elem->complete)) {
|
|
ret = wait_for_completion_timeout(&elem->complete,
|
|
- timeout);
|
|
+ msecs_to_jiffies(50000));
|
|
|
|
/* Shouldn't happen. There are still references to
|
|
* the object but, rather than deadlock, free the
|
|
* object or pass back to rdma-core.
|
|
*/
|
|
if (WARN_ON(!ret))
|
|
- err = -EINVAL;
|
|
+ err = -ETIMEDOUT;
|
|
}
|
|
} else {
|
|
- unsigned long until = jiffies + timeout;
|
|
+ unsigned long until = jiffies + RXE_POOL_TIMEOUT;
|
|
|
|
/* AH objects are unique in that the destroy_ah verb
|
|
* can be called in atomic context. This delay
|
|
@@ -226,7 +225,7 @@ int __rxe_cleanup(struct rxe_pool_elem *elem, bool sleepable)
|
|
mdelay(1);
|
|
|
|
if (WARN_ON(!completion_done(&elem->complete)))
|
|
- err = -EINVAL;
|
|
+ err = -ETIMEDOUT;
|
|
}
|
|
|
|
if (pool->cleanup)
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
|
|
index 3767d7fc0aac82..287fc8b8f5bafe 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_qp.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_qp.c
|
|
@@ -201,7 +201,7 @@ static int rxe_init_sq(struct rxe_qp *qp, struct ib_qp_init_attr *init,
|
|
qp->sq.queue = rxe_queue_init(rxe, &qp->sq.max_wr, wqe_size,
|
|
QUEUE_TYPE_FROM_CLIENT);
|
|
if (!qp->sq.queue) {
|
|
- rxe_err_qp(qp, "Unable to allocate send queue");
|
|
+ rxe_err_qp(qp, "Unable to allocate send queue\n");
|
|
err = -ENOMEM;
|
|
goto err_out;
|
|
}
|
|
@@ -211,7 +211,7 @@ static int rxe_init_sq(struct rxe_qp *qp, struct ib_qp_init_attr *init,
|
|
qp->sq.queue->buf, qp->sq.queue->buf_size,
|
|
&qp->sq.queue->ip);
|
|
if (err) {
|
|
- rxe_err_qp(qp, "do_mmap_info failed, err = %d", err);
|
|
+ rxe_err_qp(qp, "do_mmap_info failed, err = %d\n", err);
|
|
goto err_free;
|
|
}
|
|
|
|
@@ -292,7 +292,7 @@ static int rxe_init_rq(struct rxe_qp *qp, struct ib_qp_init_attr *init,
|
|
qp->rq.queue = rxe_queue_init(rxe, &qp->rq.max_wr, wqe_size,
|
|
QUEUE_TYPE_FROM_CLIENT);
|
|
if (!qp->rq.queue) {
|
|
- rxe_err_qp(qp, "Unable to allocate recv queue");
|
|
+ rxe_err_qp(qp, "Unable to allocate recv queue\n");
|
|
err = -ENOMEM;
|
|
goto err_out;
|
|
}
|
|
@@ -302,7 +302,7 @@ static int rxe_init_rq(struct rxe_qp *qp, struct ib_qp_init_attr *init,
|
|
qp->rq.queue->buf, qp->rq.queue->buf_size,
|
|
&qp->rq.queue->ip);
|
|
if (err) {
|
|
- rxe_err_qp(qp, "do_mmap_info failed, err = %d", err);
|
|
+ rxe_err_qp(qp, "do_mmap_info failed, err = %d\n", err);
|
|
goto err_free;
|
|
}
|
|
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
|
|
index c02aa27fe5d817..fa2b87c7492920 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
|
|
@@ -375,18 +375,18 @@ static enum resp_states rxe_resp_check_length(struct rxe_qp *qp,
|
|
if ((pkt->mask & RXE_START_MASK) &&
|
|
(pkt->mask & RXE_END_MASK)) {
|
|
if (unlikely(payload > mtu)) {
|
|
- rxe_dbg_qp(qp, "only packet too long");
|
|
+ rxe_dbg_qp(qp, "only packet too long\n");
|
|
return RESPST_ERR_LENGTH;
|
|
}
|
|
} else if ((pkt->mask & RXE_START_MASK) ||
|
|
(pkt->mask & RXE_MIDDLE_MASK)) {
|
|
if (unlikely(payload != mtu)) {
|
|
- rxe_dbg_qp(qp, "first or middle packet not mtu");
|
|
+ rxe_dbg_qp(qp, "first or middle packet not mtu\n");
|
|
return RESPST_ERR_LENGTH;
|
|
}
|
|
} else if (pkt->mask & RXE_END_MASK) {
|
|
if (unlikely((payload == 0) || (payload > mtu))) {
|
|
- rxe_dbg_qp(qp, "last packet zero or too long");
|
|
+ rxe_dbg_qp(qp, "last packet zero or too long\n");
|
|
return RESPST_ERR_LENGTH;
|
|
}
|
|
}
|
|
@@ -395,7 +395,7 @@ static enum resp_states rxe_resp_check_length(struct rxe_qp *qp,
|
|
/* See IBA C9-94 */
|
|
if (pkt->mask & RXE_RETH_MASK) {
|
|
if (reth_len(pkt) > (1U << 31)) {
|
|
- rxe_dbg_qp(qp, "dma length too long");
|
|
+ rxe_dbg_qp(qp, "dma length too long\n");
|
|
return RESPST_ERR_LENGTH;
|
|
}
|
|
}
|
|
@@ -1146,7 +1146,7 @@ static enum resp_states do_complete(struct rxe_qp *qp,
|
|
}
|
|
} else {
|
|
if (wc->status != IB_WC_WR_FLUSH_ERR)
|
|
- rxe_err_qp(qp, "non-flush error status = %d",
|
|
+ rxe_err_qp(qp, "non-flush error status = %d\n",
|
|
wc->status);
|
|
}
|
|
|
|
@@ -1455,7 +1455,7 @@ static int flush_recv_wqe(struct rxe_qp *qp, struct rxe_recv_wqe *wqe)
|
|
|
|
err = rxe_cq_post(qp->rcq, &cqe, 0);
|
|
if (err)
|
|
- rxe_dbg_cq(qp->rcq, "post cq failed err = %d", err);
|
|
+ rxe_dbg_cq(qp->rcq, "post cq failed err = %d\n", err);
|
|
|
|
return err;
|
|
}
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_task.c b/drivers/infiniband/sw/rxe/rxe_task.c
|
|
index 1501120d4f5241..80332638d9e3ac 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_task.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_task.c
|
|
@@ -156,7 +156,7 @@ static void do_task(struct rxe_task *task)
|
|
|
|
default:
|
|
WARN_ON(1);
|
|
- rxe_dbg_qp(task->qp, "unexpected task state = %d",
|
|
+ rxe_dbg_qp(task->qp, "unexpected task state = %d\n",
|
|
task->state);
|
|
task->state = TASK_STATE_IDLE;
|
|
}
|
|
@@ -167,7 +167,7 @@ static void do_task(struct rxe_task *task)
|
|
if (WARN_ON(task->num_done != task->num_sched))
|
|
rxe_dbg_qp(
|
|
task->qp,
|
|
- "%ld tasks scheduled, %ld tasks done",
|
|
+ "%ld tasks scheduled, %ld tasks done\n",
|
|
task->num_sched, task->num_done);
|
|
}
|
|
spin_unlock_irqrestore(&task->lock, flags);
|
|
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
|
|
index 9f46b9f74825ff..dbb9baa4ffd002 100644
|
|
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
|
|
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
|
|
@@ -23,7 +23,7 @@ static int rxe_query_device(struct ib_device *ibdev,
|
|
int err;
|
|
|
|
if (udata->inlen || udata->outlen) {
|
|
- rxe_dbg_dev(rxe, "malformed udata");
|
|
+ rxe_dbg_dev(rxe, "malformed udata\n");
|
|
err = -EINVAL;
|
|
goto err_out;
|
|
}
|
|
@@ -33,7 +33,7 @@ static int rxe_query_device(struct ib_device *ibdev,
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -45,7 +45,7 @@ static int rxe_query_port(struct ib_device *ibdev,
|
|
|
|
if (port_num != 1) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_dev(rxe, "bad port_num = %d", port_num);
|
|
+ rxe_dbg_dev(rxe, "bad port_num = %d\n", port_num);
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -67,7 +67,7 @@ static int rxe_query_port(struct ib_device *ibdev,
|
|
return ret;
|
|
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -79,7 +79,7 @@ static int rxe_query_pkey(struct ib_device *ibdev,
|
|
|
|
if (index != 0) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_dev(rxe, "bad pkey index = %d", index);
|
|
+ rxe_dbg_dev(rxe, "bad pkey index = %d\n", index);
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -87,7 +87,7 @@ static int rxe_query_pkey(struct ib_device *ibdev,
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -100,7 +100,7 @@ static int rxe_modify_device(struct ib_device *ibdev,
|
|
if (mask & ~(IB_DEVICE_MODIFY_SYS_IMAGE_GUID |
|
|
IB_DEVICE_MODIFY_NODE_DESC)) {
|
|
err = -EOPNOTSUPP;
|
|
- rxe_dbg_dev(rxe, "unsupported mask = 0x%x", mask);
|
|
+ rxe_dbg_dev(rxe, "unsupported mask = 0x%x\n", mask);
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -115,7 +115,7 @@ static int rxe_modify_device(struct ib_device *ibdev,
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -128,14 +128,14 @@ static int rxe_modify_port(struct ib_device *ibdev, u32 port_num,
|
|
|
|
if (port_num != 1) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_dev(rxe, "bad port_num = %d", port_num);
|
|
+ rxe_dbg_dev(rxe, "bad port_num = %d\n", port_num);
|
|
goto err_out;
|
|
}
|
|
|
|
//TODO is shutdown useful
|
|
if (mask & ~(IB_PORT_RESET_QKEY_CNTR)) {
|
|
err = -EOPNOTSUPP;
|
|
- rxe_dbg_dev(rxe, "unsupported mask = 0x%x", mask);
|
|
+ rxe_dbg_dev(rxe, "unsupported mask = 0x%x\n", mask);
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -149,7 +149,7 @@ static int rxe_modify_port(struct ib_device *ibdev, u32 port_num,
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -161,14 +161,14 @@ static enum rdma_link_layer rxe_get_link_layer(struct ib_device *ibdev,
|
|
|
|
if (port_num != 1) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_dev(rxe, "bad port_num = %d", port_num);
|
|
+ rxe_dbg_dev(rxe, "bad port_num = %d\n", port_num);
|
|
goto err_out;
|
|
}
|
|
|
|
return IB_LINK_LAYER_ETHERNET;
|
|
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -181,7 +181,7 @@ static int rxe_port_immutable(struct ib_device *ibdev, u32 port_num,
|
|
|
|
if (port_num != 1) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_dev(rxe, "bad port_num = %d", port_num);
|
|
+ rxe_dbg_dev(rxe, "bad port_num = %d\n", port_num);
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -197,7 +197,7 @@ static int rxe_port_immutable(struct ib_device *ibdev, u32 port_num,
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -210,7 +210,7 @@ static int rxe_alloc_ucontext(struct ib_ucontext *ibuc, struct ib_udata *udata)
|
|
|
|
err = rxe_add_to_pool(&rxe->uc_pool, uc);
|
|
if (err)
|
|
- rxe_err_dev(rxe, "unable to create uc");
|
|
+ rxe_err_dev(rxe, "unable to create uc\n");
|
|
|
|
return err;
|
|
}
|
|
@@ -222,7 +222,7 @@ static void rxe_dealloc_ucontext(struct ib_ucontext *ibuc)
|
|
|
|
err = rxe_cleanup(uc);
|
|
if (err)
|
|
- rxe_err_uc(uc, "cleanup failed, err = %d", err);
|
|
+ rxe_err_uc(uc, "cleanup failed, err = %d\n", err);
|
|
}
|
|
|
|
/* pd */
|
|
@@ -234,14 +234,14 @@ static int rxe_alloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
|
|
|
|
err = rxe_add_to_pool(&rxe->pd_pool, pd);
|
|
if (err) {
|
|
- rxe_dbg_dev(rxe, "unable to alloc pd");
|
|
+ rxe_dbg_dev(rxe, "unable to alloc pd\n");
|
|
goto err_out;
|
|
}
|
|
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -252,7 +252,7 @@ static int rxe_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
|
|
|
|
err = rxe_cleanup(pd);
|
|
if (err)
|
|
- rxe_err_pd(pd, "cleanup failed, err = %d", err);
|
|
+ rxe_err_pd(pd, "cleanup failed, err = %d\n", err);
|
|
|
|
return 0;
|
|
}
|
|
@@ -279,7 +279,7 @@ static int rxe_create_ah(struct ib_ah *ibah,
|
|
err = rxe_add_to_pool_ah(&rxe->ah_pool, ah,
|
|
init_attr->flags & RDMA_CREATE_AH_SLEEPABLE);
|
|
if (err) {
|
|
- rxe_dbg_dev(rxe, "unable to create ah");
|
|
+ rxe_dbg_dev(rxe, "unable to create ah\n");
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -288,7 +288,7 @@ static int rxe_create_ah(struct ib_ah *ibah,
|
|
|
|
err = rxe_ah_chk_attr(ah, init_attr->ah_attr);
|
|
if (err) {
|
|
- rxe_dbg_ah(ah, "bad attr");
|
|
+ rxe_dbg_ah(ah, "bad attr\n");
|
|
goto err_cleanup;
|
|
}
|
|
|
|
@@ -298,7 +298,7 @@ static int rxe_create_ah(struct ib_ah *ibah,
|
|
sizeof(uresp->ah_num));
|
|
if (err) {
|
|
err = -EFAULT;
|
|
- rxe_dbg_ah(ah, "unable to copy to user");
|
|
+ rxe_dbg_ah(ah, "unable to copy to user\n");
|
|
goto err_cleanup;
|
|
}
|
|
} else if (ah->is_user) {
|
|
@@ -314,9 +314,9 @@ static int rxe_create_ah(struct ib_ah *ibah,
|
|
err_cleanup:
|
|
cleanup_err = rxe_cleanup(ah);
|
|
if (cleanup_err)
|
|
- rxe_err_ah(ah, "cleanup failed, err = %d", cleanup_err);
|
|
+ rxe_err_ah(ah, "cleanup failed, err = %d\n", cleanup_err);
|
|
err_out:
|
|
- rxe_err_ah(ah, "returned err = %d", err);
|
|
+ rxe_err_ah(ah, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -327,7 +327,7 @@ static int rxe_modify_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr)
|
|
|
|
err = rxe_ah_chk_attr(ah, attr);
|
|
if (err) {
|
|
- rxe_dbg_ah(ah, "bad attr");
|
|
+ rxe_dbg_ah(ah, "bad attr\n");
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -336,7 +336,7 @@ static int rxe_modify_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr)
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_ah(ah, "returned err = %d", err);
|
|
+ rxe_err_ah(ah, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -358,7 +358,7 @@ static int rxe_destroy_ah(struct ib_ah *ibah, u32 flags)
|
|
|
|
err = rxe_cleanup_ah(ah, flags & RDMA_DESTROY_AH_SLEEPABLE);
|
|
if (err)
|
|
- rxe_err_ah(ah, "cleanup failed, err = %d", err);
|
|
+ rxe_err_ah(ah, "cleanup failed, err = %d\n", err);
|
|
|
|
return 0;
|
|
}
|
|
@@ -376,7 +376,7 @@ static int rxe_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init,
|
|
if (udata) {
|
|
if (udata->outlen < sizeof(*uresp)) {
|
|
err = -EINVAL;
|
|
- rxe_err_dev(rxe, "malformed udata");
|
|
+ rxe_err_dev(rxe, "malformed udata\n");
|
|
goto err_out;
|
|
}
|
|
uresp = udata->outbuf;
|
|
@@ -384,20 +384,20 @@ static int rxe_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init,
|
|
|
|
if (init->srq_type != IB_SRQT_BASIC) {
|
|
err = -EOPNOTSUPP;
|
|
- rxe_dbg_dev(rxe, "srq type = %d, not supported",
|
|
+ rxe_dbg_dev(rxe, "srq type = %d, not supported\n",
|
|
init->srq_type);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_srq_chk_init(rxe, init);
|
|
if (err) {
|
|
- rxe_dbg_dev(rxe, "invalid init attributes");
|
|
+ rxe_dbg_dev(rxe, "invalid init attributes\n");
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_add_to_pool(&rxe->srq_pool, srq);
|
|
if (err) {
|
|
- rxe_dbg_dev(rxe, "unable to create srq, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "unable to create srq, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -406,7 +406,7 @@ static int rxe_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init,
|
|
|
|
err = rxe_srq_from_init(rxe, srq, init, udata, uresp);
|
|
if (err) {
|
|
- rxe_dbg_srq(srq, "create srq failed, err = %d", err);
|
|
+ rxe_dbg_srq(srq, "create srq failed, err = %d\n", err);
|
|
goto err_cleanup;
|
|
}
|
|
|
|
@@ -415,9 +415,9 @@ static int rxe_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init,
|
|
err_cleanup:
|
|
cleanup_err = rxe_cleanup(srq);
|
|
if (cleanup_err)
|
|
- rxe_err_srq(srq, "cleanup failed, err = %d", cleanup_err);
|
|
+ rxe_err_srq(srq, "cleanup failed, err = %d\n", cleanup_err);
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -433,34 +433,34 @@ static int rxe_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
|
|
if (udata) {
|
|
if (udata->inlen < sizeof(cmd)) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_srq(srq, "malformed udata");
|
|
+ rxe_dbg_srq(srq, "malformed udata\n");
|
|
goto err_out;
|
|
}
|
|
|
|
err = ib_copy_from_udata(&cmd, udata, sizeof(cmd));
|
|
if (err) {
|
|
err = -EFAULT;
|
|
- rxe_dbg_srq(srq, "unable to read udata");
|
|
+ rxe_dbg_srq(srq, "unable to read udata\n");
|
|
goto err_out;
|
|
}
|
|
}
|
|
|
|
err = rxe_srq_chk_attr(rxe, srq, attr, mask);
|
|
if (err) {
|
|
- rxe_dbg_srq(srq, "bad init attributes");
|
|
+ rxe_dbg_srq(srq, "bad init attributes\n");
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_srq_from_attr(rxe, srq, attr, mask, &cmd, udata);
|
|
if (err) {
|
|
- rxe_dbg_srq(srq, "bad attr");
|
|
+ rxe_dbg_srq(srq, "bad attr\n");
|
|
goto err_out;
|
|
}
|
|
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_srq(srq, "returned err = %d", err);
|
|
+ rxe_err_srq(srq, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -471,7 +471,7 @@ static int rxe_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr)
|
|
|
|
if (srq->error) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_srq(srq, "srq in error state");
|
|
+ rxe_dbg_srq(srq, "srq in error state\n");
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -481,7 +481,7 @@ static int rxe_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr)
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_srq(srq, "returned err = %d", err);
|
|
+ rxe_err_srq(srq, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -505,7 +505,7 @@ static int rxe_post_srq_recv(struct ib_srq *ibsrq, const struct ib_recv_wr *wr,
|
|
|
|
if (err) {
|
|
*bad_wr = wr;
|
|
- rxe_err_srq(srq, "returned err = %d", err);
|
|
+ rxe_err_srq(srq, "returned err = %d\n", err);
|
|
}
|
|
|
|
return err;
|
|
@@ -518,7 +518,7 @@ static int rxe_destroy_srq(struct ib_srq *ibsrq, struct ib_udata *udata)
|
|
|
|
err = rxe_cleanup(srq);
|
|
if (err)
|
|
- rxe_err_srq(srq, "cleanup failed, err = %d", err);
|
|
+ rxe_err_srq(srq, "cleanup failed, err = %d\n", err);
|
|
|
|
return 0;
|
|
}
|
|
@@ -536,13 +536,13 @@ static int rxe_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init,
|
|
if (udata) {
|
|
if (udata->inlen) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_dev(rxe, "malformed udata, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "malformed udata, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
if (udata->outlen < sizeof(*uresp)) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_dev(rxe, "malformed udata, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "malformed udata, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -554,25 +554,25 @@ static int rxe_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init,
|
|
|
|
if (init->create_flags) {
|
|
err = -EOPNOTSUPP;
|
|
- rxe_dbg_dev(rxe, "unsupported create_flags, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "unsupported create_flags, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_qp_chk_init(rxe, init);
|
|
if (err) {
|
|
- rxe_dbg_dev(rxe, "bad init attr, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "bad init attr, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_add_to_pool(&rxe->qp_pool, qp);
|
|
if (err) {
|
|
- rxe_dbg_dev(rxe, "unable to create qp, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "unable to create qp, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_qp_from_init(rxe, qp, pd, init, uresp, ibqp->pd, udata);
|
|
if (err) {
|
|
- rxe_dbg_qp(qp, "create qp failed, err = %d", err);
|
|
+ rxe_dbg_qp(qp, "create qp failed, err = %d\n", err);
|
|
goto err_cleanup;
|
|
}
|
|
|
|
@@ -582,9 +582,9 @@ static int rxe_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init,
|
|
err_cleanup:
|
|
cleanup_err = rxe_cleanup(qp);
|
|
if (cleanup_err)
|
|
- rxe_err_qp(qp, "cleanup failed, err = %d", cleanup_err);
|
|
+ rxe_err_qp(qp, "cleanup failed, err = %d\n", cleanup_err);
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -597,20 +597,20 @@ static int rxe_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
|
|
|
|
if (mask & ~IB_QP_ATTR_STANDARD_BITS) {
|
|
err = -EOPNOTSUPP;
|
|
- rxe_dbg_qp(qp, "unsupported mask = 0x%x, err = %d",
|
|
+ rxe_dbg_qp(qp, "unsupported mask = 0x%x, err = %d\n",
|
|
mask, err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_qp_chk_attr(rxe, qp, attr, mask);
|
|
if (err) {
|
|
- rxe_dbg_qp(qp, "bad mask/attr, err = %d", err);
|
|
+ rxe_dbg_qp(qp, "bad mask/attr, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_qp_from_attr(qp, attr, mask, udata);
|
|
if (err) {
|
|
- rxe_dbg_qp(qp, "modify qp failed, err = %d", err);
|
|
+ rxe_dbg_qp(qp, "modify qp failed, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -622,7 +622,7 @@ static int rxe_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_qp(qp, "returned err = %d", err);
|
|
+ rxe_err_qp(qp, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -644,18 +644,18 @@ static int rxe_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata)
|
|
|
|
err = rxe_qp_chk_destroy(qp);
|
|
if (err) {
|
|
- rxe_dbg_qp(qp, "unable to destroy qp, err = %d", err);
|
|
+ rxe_dbg_qp(qp, "unable to destroy qp, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_cleanup(qp);
|
|
if (err)
|
|
- rxe_err_qp(qp, "cleanup failed, err = %d", err);
|
|
+ rxe_err_qp(qp, "cleanup failed, err = %d\n", err);
|
|
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_qp(qp, "returned err = %d", err);
|
|
+ rxe_err_qp(qp, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -675,12 +675,12 @@ static int validate_send_wr(struct rxe_qp *qp, const struct ib_send_wr *ibwr,
|
|
do {
|
|
mask = wr_opcode_mask(ibwr->opcode, qp);
|
|
if (!mask) {
|
|
- rxe_err_qp(qp, "bad wr opcode for qp type");
|
|
+ rxe_err_qp(qp, "bad wr opcode for qp type\n");
|
|
break;
|
|
}
|
|
|
|
if (num_sge > sq->max_sge) {
|
|
- rxe_err_qp(qp, "num_sge > max_sge");
|
|
+ rxe_err_qp(qp, "num_sge > max_sge\n");
|
|
break;
|
|
}
|
|
|
|
@@ -688,28 +688,28 @@ static int validate_send_wr(struct rxe_qp *qp, const struct ib_send_wr *ibwr,
|
|
for (i = 0; i < ibwr->num_sge; i++)
|
|
length += ibwr->sg_list[i].length;
|
|
|
|
- if (length > (1UL << 31)) {
|
|
- rxe_err_qp(qp, "message length too long");
|
|
+ if (length > RXE_PORT_MAX_MSG_SZ) {
|
|
+ rxe_err_qp(qp, "message length too long\n");
|
|
break;
|
|
}
|
|
|
|
if (mask & WR_ATOMIC_MASK) {
|
|
if (length != 8) {
|
|
- rxe_err_qp(qp, "atomic length != 8");
|
|
+ rxe_err_qp(qp, "atomic length != 8\n");
|
|
break;
|
|
}
|
|
if (atomic_wr(ibwr)->remote_addr & 0x7) {
|
|
- rxe_err_qp(qp, "misaligned atomic address");
|
|
+ rxe_err_qp(qp, "misaligned atomic address\n");
|
|
break;
|
|
}
|
|
}
|
|
if (ibwr->send_flags & IB_SEND_INLINE) {
|
|
if (!(mask & WR_INLINE_MASK)) {
|
|
- rxe_err_qp(qp, "opcode doesn't support inline data");
|
|
+ rxe_err_qp(qp, "opcode doesn't support inline data\n");
|
|
break;
|
|
}
|
|
if (length > sq->max_inline) {
|
|
- rxe_err_qp(qp, "inline length too big");
|
|
+ rxe_err_qp(qp, "inline length too big\n");
|
|
break;
|
|
}
|
|
}
|
|
@@ -747,7 +747,7 @@ static int init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr,
|
|
case IB_WR_SEND:
|
|
break;
|
|
default:
|
|
- rxe_err_qp(qp, "bad wr opcode %d for UD/GSI QP",
|
|
+ rxe_err_qp(qp, "bad wr opcode %d for UD/GSI QP\n",
|
|
wr->opcode);
|
|
return -EINVAL;
|
|
}
|
|
@@ -795,7 +795,7 @@ static int init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr,
|
|
case IB_WR_ATOMIC_WRITE:
|
|
break;
|
|
default:
|
|
- rxe_err_qp(qp, "unsupported wr opcode %d",
|
|
+ rxe_err_qp(qp, "unsupported wr opcode %d\n",
|
|
wr->opcode);
|
|
return -EINVAL;
|
|
}
|
|
@@ -870,7 +870,7 @@ static int post_one_send(struct rxe_qp *qp, const struct ib_send_wr *ibwr)
|
|
|
|
full = queue_full(sq->queue, QUEUE_TYPE_FROM_ULP);
|
|
if (unlikely(full)) {
|
|
- rxe_err_qp(qp, "send queue full");
|
|
+ rxe_err_qp(qp, "send queue full\n");
|
|
return -ENOMEM;
|
|
}
|
|
|
|
@@ -926,14 +926,14 @@ static int rxe_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,
|
|
/* caller has already called destroy_qp */
|
|
if (WARN_ON_ONCE(!qp->valid)) {
|
|
spin_unlock_irqrestore(&qp->state_lock, flags);
|
|
- rxe_err_qp(qp, "qp has been destroyed");
|
|
+ rxe_err_qp(qp, "qp has been destroyed\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
if (unlikely(qp_state(qp) < IB_QPS_RTS)) {
|
|
spin_unlock_irqrestore(&qp->state_lock, flags);
|
|
*bad_wr = wr;
|
|
- rxe_err_qp(qp, "qp not ready to send");
|
|
+ rxe_err_qp(qp, "qp not ready to send\n");
|
|
return -EINVAL;
|
|
}
|
|
spin_unlock_irqrestore(&qp->state_lock, flags);
|
|
@@ -963,13 +963,13 @@ static int post_one_recv(struct rxe_rq *rq, const struct ib_recv_wr *ibwr)
|
|
full = queue_full(rq->queue, QUEUE_TYPE_FROM_ULP);
|
|
if (unlikely(full)) {
|
|
err = -ENOMEM;
|
|
- rxe_dbg("queue full");
|
|
+ rxe_dbg("queue full\n");
|
|
goto err_out;
|
|
}
|
|
|
|
if (unlikely(num_sge > rq->max_sge)) {
|
|
err = -EINVAL;
|
|
- rxe_dbg("bad num_sge > max_sge");
|
|
+ rxe_dbg("bad num_sge > max_sge\n");
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -977,10 +977,9 @@ static int post_one_recv(struct rxe_rq *rq, const struct ib_recv_wr *ibwr)
|
|
for (i = 0; i < num_sge; i++)
|
|
length += ibwr->sg_list[i].length;
|
|
|
|
- /* IBA max message size is 2^31 */
|
|
- if (length >= (1UL<<31)) {
|
|
+ if (length > RXE_PORT_MAX_MSG_SZ) {
|
|
err = -EINVAL;
|
|
- rxe_dbg("message length too long");
|
|
+ rxe_dbg("message length too long\n");
|
|
goto err_out;
|
|
}
|
|
|
|
@@ -1000,7 +999,7 @@ static int post_one_recv(struct rxe_rq *rq, const struct ib_recv_wr *ibwr)
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_dbg("returned err = %d", err);
|
|
+ rxe_dbg("returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -1016,7 +1015,7 @@ static int rxe_post_recv(struct ib_qp *ibqp, const struct ib_recv_wr *wr,
|
|
/* caller has already called destroy_qp */
|
|
if (WARN_ON_ONCE(!qp->valid)) {
|
|
spin_unlock_irqrestore(&qp->state_lock, flags);
|
|
- rxe_err_qp(qp, "qp has been destroyed");
|
|
+ rxe_err_qp(qp, "qp has been destroyed\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
@@ -1024,14 +1023,14 @@ static int rxe_post_recv(struct ib_qp *ibqp, const struct ib_recv_wr *wr,
|
|
if (unlikely((qp_state(qp) < IB_QPS_INIT))) {
|
|
spin_unlock_irqrestore(&qp->state_lock, flags);
|
|
*bad_wr = wr;
|
|
- rxe_dbg_qp(qp, "qp not ready to post recv");
|
|
+ rxe_dbg_qp(qp, "qp not ready to post recv\n");
|
|
return -EINVAL;
|
|
}
|
|
spin_unlock_irqrestore(&qp->state_lock, flags);
|
|
|
|
if (unlikely(qp->srq)) {
|
|
*bad_wr = wr;
|
|
- rxe_dbg_qp(qp, "qp has srq, use post_srq_recv instead");
|
|
+ rxe_dbg_qp(qp, "qp has srq, use post_srq_recv instead\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
@@ -1069,7 +1068,7 @@ static int rxe_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
|
|
if (udata) {
|
|
if (udata->outlen < sizeof(*uresp)) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_dev(rxe, "malformed udata, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "malformed udata, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
uresp = udata->outbuf;
|
|
@@ -1077,26 +1076,26 @@ static int rxe_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
|
|
|
|
if (attr->flags) {
|
|
err = -EOPNOTSUPP;
|
|
- rxe_dbg_dev(rxe, "bad attr->flags, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "bad attr->flags, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_cq_chk_attr(rxe, NULL, attr->cqe, attr->comp_vector);
|
|
if (err) {
|
|
- rxe_dbg_dev(rxe, "bad init attributes, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "bad init attributes, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_add_to_pool(&rxe->cq_pool, cq);
|
|
if (err) {
|
|
- rxe_dbg_dev(rxe, "unable to create cq, err = %d", err);
|
|
+ rxe_dbg_dev(rxe, "unable to create cq, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_cq_from_init(rxe, cq, attr->cqe, attr->comp_vector, udata,
|
|
uresp);
|
|
if (err) {
|
|
- rxe_dbg_cq(cq, "create cq failed, err = %d", err);
|
|
+ rxe_dbg_cq(cq, "create cq failed, err = %d\n", err);
|
|
goto err_cleanup;
|
|
}
|
|
|
|
@@ -1105,9 +1104,9 @@ static int rxe_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
|
|
err_cleanup:
|
|
cleanup_err = rxe_cleanup(cq);
|
|
if (cleanup_err)
|
|
- rxe_err_cq(cq, "cleanup failed, err = %d", cleanup_err);
|
|
+ rxe_err_cq(cq, "cleanup failed, err = %d\n", cleanup_err);
|
|
err_out:
|
|
- rxe_err_dev(rxe, "returned err = %d", err);
|
|
+ rxe_err_dev(rxe, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -1121,7 +1120,7 @@ static int rxe_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
|
|
if (udata) {
|
|
if (udata->outlen < sizeof(*uresp)) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_cq(cq, "malformed udata");
|
|
+ rxe_dbg_cq(cq, "malformed udata\n");
|
|
goto err_out;
|
|
}
|
|
uresp = udata->outbuf;
|
|
@@ -1129,20 +1128,20 @@ static int rxe_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
|
|
|
|
err = rxe_cq_chk_attr(rxe, cq, cqe, 0);
|
|
if (err) {
|
|
- rxe_dbg_cq(cq, "bad attr, err = %d", err);
|
|
+ rxe_dbg_cq(cq, "bad attr, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_cq_resize_queue(cq, cqe, uresp, udata);
|
|
if (err) {
|
|
- rxe_dbg_cq(cq, "resize cq failed, err = %d", err);
|
|
+ rxe_dbg_cq(cq, "resize cq failed, err = %d\n", err);
|
|
goto err_out;
|
|
}
|
|
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_cq(cq, "returned err = %d", err);
|
|
+ rxe_err_cq(cq, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -1206,18 +1205,18 @@ static int rxe_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata)
|
|
*/
|
|
if (atomic_read(&cq->num_wq)) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_cq(cq, "still in use");
|
|
+ rxe_dbg_cq(cq, "still in use\n");
|
|
goto err_out;
|
|
}
|
|
|
|
err = rxe_cleanup(cq);
|
|
if (err)
|
|
- rxe_err_cq(cq, "cleanup failed, err = %d", err);
|
|
+ rxe_err_cq(cq, "cleanup failed, err = %d\n", err);
|
|
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_cq(cq, "returned err = %d", err);
|
|
+ rxe_err_cq(cq, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
@@ -1235,7 +1234,7 @@ static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access)
|
|
|
|
err = rxe_add_to_pool(&rxe->mr_pool, mr);
|
|
if (err) {
|
|
- rxe_dbg_dev(rxe, "unable to create mr");
|
|
+ rxe_dbg_dev(rxe, "unable to create mr\n");
|
|
goto err_free;
|
|
}
|
|
|
|
@@ -1249,7 +1248,7 @@ static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access)
|
|
|
|
err_free:
|
|
kfree(mr);
|
|
- rxe_err_pd(pd, "returned err = %d", err);
|
|
+ rxe_err_pd(pd, "returned err = %d\n", err);
|
|
return ERR_PTR(err);
|
|
}
|
|
|
|
@@ -1263,7 +1262,7 @@ static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd, u64 start,
|
|
int err, cleanup_err;
|
|
|
|
if (access & ~RXE_ACCESS_SUPPORTED_MR) {
|
|
- rxe_err_pd(pd, "access = %#x not supported (%#x)", access,
|
|
+ rxe_err_pd(pd, "access = %#x not supported (%#x)\n", access,
|
|
RXE_ACCESS_SUPPORTED_MR);
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
}
|
|
@@ -1274,7 +1273,7 @@ static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd, u64 start,
|
|
|
|
err = rxe_add_to_pool(&rxe->mr_pool, mr);
|
|
if (err) {
|
|
- rxe_dbg_pd(pd, "unable to create mr");
|
|
+ rxe_dbg_pd(pd, "unable to create mr\n");
|
|
goto err_free;
|
|
}
|
|
|
|
@@ -1284,7 +1283,7 @@ static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd, u64 start,
|
|
|
|
err = rxe_mr_init_user(rxe, start, length, iova, access, mr);
|
|
if (err) {
|
|
- rxe_dbg_mr(mr, "reg_user_mr failed, err = %d", err);
|
|
+ rxe_dbg_mr(mr, "reg_user_mr failed, err = %d\n", err);
|
|
goto err_cleanup;
|
|
}
|
|
|
|
@@ -1294,10 +1293,10 @@ static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd, u64 start,
|
|
err_cleanup:
|
|
cleanup_err = rxe_cleanup(mr);
|
|
if (cleanup_err)
|
|
- rxe_err_mr(mr, "cleanup failed, err = %d", cleanup_err);
|
|
+ rxe_err_mr(mr, "cleanup failed, err = %d\n", cleanup_err);
|
|
err_free:
|
|
kfree(mr);
|
|
- rxe_err_pd(pd, "returned err = %d", err);
|
|
+ rxe_err_pd(pd, "returned err = %d\n", err);
|
|
return ERR_PTR(err);
|
|
}
|
|
|
|
@@ -1314,7 +1313,7 @@ static struct ib_mr *rxe_rereg_user_mr(struct ib_mr *ibmr, int flags,
|
|
* rereg_pd and rereg_access
|
|
*/
|
|
if (flags & ~RXE_MR_REREG_SUPPORTED) {
|
|
- rxe_err_mr(mr, "flags = %#x not supported", flags);
|
|
+ rxe_err_mr(mr, "flags = %#x not supported\n", flags);
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
}
|
|
|
|
@@ -1326,7 +1325,7 @@ static struct ib_mr *rxe_rereg_user_mr(struct ib_mr *ibmr, int flags,
|
|
|
|
if (flags & IB_MR_REREG_ACCESS) {
|
|
if (access & ~RXE_ACCESS_SUPPORTED_MR) {
|
|
- rxe_err_mr(mr, "access = %#x not supported", access);
|
|
+ rxe_err_mr(mr, "access = %#x not supported\n", access);
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
}
|
|
mr->access = access;
|
|
@@ -1345,7 +1344,7 @@ static struct ib_mr *rxe_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type,
|
|
|
|
if (mr_type != IB_MR_TYPE_MEM_REG) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_pd(pd, "mr type %d not supported, err = %d",
|
|
+ rxe_dbg_pd(pd, "mr type %d not supported, err = %d\n",
|
|
mr_type, err);
|
|
goto err_out;
|
|
}
|
|
@@ -1364,7 +1363,7 @@ static struct ib_mr *rxe_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type,
|
|
|
|
err = rxe_mr_init_fast(max_num_sg, mr);
|
|
if (err) {
|
|
- rxe_dbg_mr(mr, "alloc_mr failed, err = %d", err);
|
|
+ rxe_dbg_mr(mr, "alloc_mr failed, err = %d\n", err);
|
|
goto err_cleanup;
|
|
}
|
|
|
|
@@ -1374,11 +1373,11 @@ static struct ib_mr *rxe_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type,
|
|
err_cleanup:
|
|
cleanup_err = rxe_cleanup(mr);
|
|
if (cleanup_err)
|
|
- rxe_err_mr(mr, "cleanup failed, err = %d", err);
|
|
+ rxe_err_mr(mr, "cleanup failed, err = %d\n", err);
|
|
err_free:
|
|
kfree(mr);
|
|
err_out:
|
|
- rxe_err_pd(pd, "returned err = %d", err);
|
|
+ rxe_err_pd(pd, "returned err = %d\n", err);
|
|
return ERR_PTR(err);
|
|
}
|
|
|
|
@@ -1390,19 +1389,19 @@ static int rxe_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
|
|
/* See IBA 10.6.7.2.6 */
|
|
if (atomic_read(&mr->num_mw) > 0) {
|
|
err = -EINVAL;
|
|
- rxe_dbg_mr(mr, "mr has mw's bound");
|
|
+ rxe_dbg_mr(mr, "mr has mw's bound\n");
|
|
goto err_out;
|
|
}
|
|
|
|
cleanup_err = rxe_cleanup(mr);
|
|
if (cleanup_err)
|
|
- rxe_err_mr(mr, "cleanup failed, err = %d", cleanup_err);
|
|
+ rxe_err_mr(mr, "cleanup failed, err = %d\n", cleanup_err);
|
|
|
|
kfree_rcu_mightsleep(mr);
|
|
return 0;
|
|
|
|
err_out:
|
|
- rxe_err_mr(mr, "returned err = %d", err);
|
|
+ rxe_err_mr(mr, "returned err = %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
|
|
index 2916e77f589b81..7289ae0b83aced 100644
|
|
--- a/drivers/infiniband/ulp/srp/ib_srp.c
|
|
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
|
|
@@ -3978,7 +3978,6 @@ static struct srp_host *srp_add_port(struct srp_device *device, u32 port)
|
|
return host;
|
|
|
|
put_host:
|
|
- device_del(&host->dev);
|
|
put_device(&host->dev);
|
|
return NULL;
|
|
}
|
|
diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c
|
|
index 072bd227b6c677..4525366d16d615 100644
|
|
--- a/drivers/irqchip/irq-atmel-aic-common.c
|
|
+++ b/drivers/irqchip/irq-atmel-aic-common.c
|
|
@@ -111,8 +111,6 @@ static void __init aic_common_ext_irq_of_init(struct irq_domain *domain)
|
|
struct device_node *node = irq_domain_get_of_node(domain);
|
|
struct irq_chip_generic *gc;
|
|
struct aic_chip_data *aic;
|
|
- struct property *prop;
|
|
- const __be32 *p;
|
|
u32 hwirq;
|
|
|
|
gc = irq_get_domain_generic_chip(domain, 0);
|
|
@@ -120,7 +118,7 @@ static void __init aic_common_ext_irq_of_init(struct irq_domain *domain)
|
|
aic = gc->private;
|
|
aic->ext_irqs |= 1;
|
|
|
|
- of_property_for_each_u32(node, "atmel,external-irqs", prop, p, hwirq) {
|
|
+ of_property_for_each_u32(node, "atmel,external-irqs", hwirq) {
|
|
gc = irq_get_domain_generic_chip(domain, hwirq);
|
|
if (!gc) {
|
|
pr_warn("AIC: external irq %d >= %d skip it\n",
|
|
diff --git a/drivers/irqchip/irq-pic32-evic.c b/drivers/irqchip/irq-pic32-evic.c
|
|
index 1d9bb28d13e5d9..5d6b8e025bb876 100644
|
|
--- a/drivers/irqchip/irq-pic32-evic.c
|
|
+++ b/drivers/irqchip/irq-pic32-evic.c
|
|
@@ -190,13 +190,11 @@ static void __init pic32_ext_irq_of_init(struct irq_domain *domain)
|
|
{
|
|
struct device_node *node = irq_domain_get_of_node(domain);
|
|
struct evic_chip_data *priv = domain->host_data;
|
|
- struct property *prop;
|
|
- const __le32 *p;
|
|
u32 hwirq;
|
|
int i = 0;
|
|
const char *pname = "microchip,external-irqs";
|
|
|
|
- of_property_for_each_u32(node, pname, prop, p, hwirq) {
|
|
+ of_property_for_each_u32(node, pname, hwirq) {
|
|
if (i >= ARRAY_SIZE(priv->ext_irqs)) {
|
|
pr_warn("More than %d external irq, skip rest\n",
|
|
ARRAY_SIZE(priv->ext_irqs));
|
|
diff --git a/drivers/leds/leds-cht-wcove.c b/drivers/leds/leds-cht-wcove.c
|
|
index b4998402b8c6f0..711ac4bd60580d 100644
|
|
--- a/drivers/leds/leds-cht-wcove.c
|
|
+++ b/drivers/leds/leds-cht-wcove.c
|
|
@@ -394,7 +394,7 @@ static int cht_wc_leds_probe(struct platform_device *pdev)
|
|
led->cdev.pattern_clear = cht_wc_leds_pattern_clear;
|
|
led->cdev.max_brightness = 255;
|
|
|
|
- ret = led_classdev_register(&pdev->dev, &led->cdev);
|
|
+ ret = devm_led_classdev_register(&pdev->dev, &led->cdev);
|
|
if (ret < 0)
|
|
return ret;
|
|
}
|
|
@@ -406,10 +406,6 @@ static int cht_wc_leds_probe(struct platform_device *pdev)
|
|
static void cht_wc_leds_remove(struct platform_device *pdev)
|
|
{
|
|
struct cht_wc_leds *leds = platform_get_drvdata(pdev);
|
|
- int i;
|
|
-
|
|
- for (i = 0; i < CHT_WC_LED_COUNT; i++)
|
|
- led_classdev_unregister(&leds->leds[i].cdev);
|
|
|
|
/* Restore LED1 regs if hw-control was active else leave LED1 off */
|
|
if (!(leds->led1_initial_regs.ctrl & CHT_WC_LED1_SWCTL))
|
|
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
|
|
index 77213b79f84d95..6692de0af68f1c 100644
|
|
--- a/drivers/leds/leds-netxbig.c
|
|
+++ b/drivers/leds/leds-netxbig.c
|
|
@@ -440,6 +440,7 @@ static int netxbig_leds_get_of_pdata(struct device *dev,
|
|
}
|
|
gpio_ext_pdev = of_find_device_by_node(gpio_ext_np);
|
|
if (!gpio_ext_pdev) {
|
|
+ of_node_put(gpio_ext_np);
|
|
dev_err(dev, "Failed to find platform device for gpio-ext\n");
|
|
return -ENODEV;
|
|
}
|
|
diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
|
|
index 6dacd38ae947a1..f8ada6c1ef65bf 100644
|
|
--- a/drivers/media/i2c/imx290.c
|
|
+++ b/drivers/media/i2c/imx290.c
|
|
@@ -269,7 +269,6 @@ static const struct cci_reg_sequence imx290_global_init_settings[] = {
|
|
{ IMX290_WINWV, 1097 },
|
|
{ IMX290_XSOUTSEL, IMX290_XSOUTSEL_XVSOUTSEL_VSYNC |
|
|
IMX290_XSOUTSEL_XHSOUTSEL_HSYNC },
|
|
- { CCI_REG8(0x3011), 0x02 },
|
|
{ CCI_REG8(0x3012), 0x64 },
|
|
{ CCI_REG8(0x3013), 0x00 },
|
|
};
|
|
@@ -277,6 +276,7 @@ static const struct cci_reg_sequence imx290_global_init_settings[] = {
|
|
static const struct cci_reg_sequence imx290_global_init_settings_290[] = {
|
|
{ CCI_REG8(0x300f), 0x00 },
|
|
{ CCI_REG8(0x3010), 0x21 },
|
|
+ { CCI_REG8(0x3011), 0x00 },
|
|
{ CCI_REG8(0x3016), 0x09 },
|
|
{ CCI_REG8(0x3070), 0x02 },
|
|
{ CCI_REG8(0x3071), 0x11 },
|
|
@@ -330,6 +330,7 @@ static const struct cci_reg_sequence xclk_regs[][IMX290_NUM_CLK_REGS] = {
|
|
};
|
|
|
|
static const struct cci_reg_sequence imx290_global_init_settings_327[] = {
|
|
+ { CCI_REG8(0x3011), 0x02 },
|
|
{ CCI_REG8(0x309e), 0x4A },
|
|
{ CCI_REG8(0x309f), 0x4A },
|
|
{ CCI_REG8(0x313b), 0x61 },
|
|
diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
|
|
index 8597f98a8dcf80..90fc8eea171f43 100644
|
|
--- a/drivers/media/i2c/imx412.c
|
|
+++ b/drivers/media/i2c/imx412.c
|
|
@@ -549,7 +549,7 @@ static int imx412_update_exp_gain(struct imx412 *imx412, u32 exposure, u32 gain)
|
|
|
|
lpfr = imx412->vblank + imx412->cur_mode->height;
|
|
|
|
- dev_dbg(imx412->dev, "Set exp %u, analog gain %u, lpfr %u",
|
|
+ dev_dbg(imx412->dev, "Set exp %u, analog gain %u, lpfr %u\n",
|
|
exposure, gain, lpfr);
|
|
|
|
ret = imx412_write_reg(imx412, IMX412_REG_HOLD, 1, 1);
|
|
@@ -596,7 +596,7 @@ static int imx412_set_ctrl(struct v4l2_ctrl *ctrl)
|
|
case V4L2_CID_VBLANK:
|
|
imx412->vblank = imx412->vblank_ctrl->val;
|
|
|
|
- dev_dbg(imx412->dev, "Received vblank %u, new lpfr %u",
|
|
+ dev_dbg(imx412->dev, "Received vblank %u, new lpfr %u\n",
|
|
imx412->vblank,
|
|
imx412->vblank + imx412->cur_mode->height);
|
|
|
|
@@ -615,7 +615,7 @@ static int imx412_set_ctrl(struct v4l2_ctrl *ctrl)
|
|
exposure = ctrl->val;
|
|
analog_gain = imx412->again_ctrl->val;
|
|
|
|
- dev_dbg(imx412->dev, "Received exp %u, analog gain %u",
|
|
+ dev_dbg(imx412->dev, "Received exp %u, analog gain %u\n",
|
|
exposure, analog_gain);
|
|
|
|
ret = imx412_update_exp_gain(imx412, exposure, analog_gain);
|
|
@@ -624,7 +624,7 @@ static int imx412_set_ctrl(struct v4l2_ctrl *ctrl)
|
|
|
|
break;
|
|
default:
|
|
- dev_err(imx412->dev, "Invalid control %d", ctrl->id);
|
|
+ dev_err(imx412->dev, "Invalid control %d\n", ctrl->id);
|
|
ret = -EINVAL;
|
|
}
|
|
|
|
@@ -805,14 +805,14 @@ static int imx412_start_streaming(struct imx412 *imx412)
|
|
ret = imx412_write_regs(imx412, reg_list->regs,
|
|
reg_list->num_of_regs);
|
|
if (ret) {
|
|
- dev_err(imx412->dev, "fail to write initial registers");
|
|
+ dev_err(imx412->dev, "fail to write initial registers\n");
|
|
return ret;
|
|
}
|
|
|
|
/* Setup handler will write actual exposure and gain */
|
|
ret = __v4l2_ctrl_handler_setup(imx412->sd.ctrl_handler);
|
|
if (ret) {
|
|
- dev_err(imx412->dev, "fail to setup handler");
|
|
+ dev_err(imx412->dev, "fail to setup handler\n");
|
|
return ret;
|
|
}
|
|
|
|
@@ -823,7 +823,7 @@ static int imx412_start_streaming(struct imx412 *imx412)
|
|
ret = imx412_write_reg(imx412, IMX412_REG_MODE_SELECT,
|
|
1, IMX412_MODE_STREAMING);
|
|
if (ret) {
|
|
- dev_err(imx412->dev, "fail to start streaming");
|
|
+ dev_err(imx412->dev, "fail to start streaming\n");
|
|
return ret;
|
|
}
|
|
|
|
@@ -904,7 +904,7 @@ static int imx412_detect(struct imx412 *imx412)
|
|
return ret;
|
|
|
|
if (val != IMX412_ID) {
|
|
- dev_err(imx412->dev, "chip id mismatch: %x!=%x",
|
|
+ dev_err(imx412->dev, "chip id mismatch: %x!=%x\n",
|
|
IMX412_ID, val);
|
|
return -ENXIO;
|
|
}
|
|
@@ -936,7 +936,7 @@ static int imx412_parse_hw_config(struct imx412 *imx412)
|
|
imx412->reset_gpio = devm_gpiod_get_optional(imx412->dev, "reset",
|
|
GPIOD_OUT_LOW);
|
|
if (IS_ERR(imx412->reset_gpio)) {
|
|
- dev_err(imx412->dev, "failed to get reset gpio %ld",
|
|
+ dev_err(imx412->dev, "failed to get reset gpio %ld\n",
|
|
PTR_ERR(imx412->reset_gpio));
|
|
return PTR_ERR(imx412->reset_gpio);
|
|
}
|
|
@@ -944,13 +944,13 @@ static int imx412_parse_hw_config(struct imx412 *imx412)
|
|
/* Get sensor input clock */
|
|
imx412->inclk = devm_clk_get(imx412->dev, NULL);
|
|
if (IS_ERR(imx412->inclk)) {
|
|
- dev_err(imx412->dev, "could not get inclk");
|
|
+ dev_err(imx412->dev, "could not get inclk\n");
|
|
return PTR_ERR(imx412->inclk);
|
|
}
|
|
|
|
rate = clk_get_rate(imx412->inclk);
|
|
if (rate != IMX412_INCLK_RATE) {
|
|
- dev_err(imx412->dev, "inclk frequency mismatch");
|
|
+ dev_err(imx412->dev, "inclk frequency mismatch\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
@@ -975,14 +975,14 @@ static int imx412_parse_hw_config(struct imx412 *imx412)
|
|
|
|
if (bus_cfg.bus.mipi_csi2.num_data_lanes != IMX412_NUM_DATA_LANES) {
|
|
dev_err(imx412->dev,
|
|
- "number of CSI2 data lanes %d is not supported",
|
|
+ "number of CSI2 data lanes %d is not supported\n",
|
|
bus_cfg.bus.mipi_csi2.num_data_lanes);
|
|
ret = -EINVAL;
|
|
goto done_endpoint_free;
|
|
}
|
|
|
|
if (!bus_cfg.nr_of_link_frequencies) {
|
|
- dev_err(imx412->dev, "no link frequencies defined");
|
|
+ dev_err(imx412->dev, "no link frequencies defined\n");
|
|
ret = -EINVAL;
|
|
goto done_endpoint_free;
|
|
}
|
|
@@ -1040,7 +1040,7 @@ static int imx412_power_on(struct device *dev)
|
|
|
|
ret = clk_prepare_enable(imx412->inclk);
|
|
if (ret) {
|
|
- dev_err(imx412->dev, "fail to enable inclk");
|
|
+ dev_err(imx412->dev, "fail to enable inclk\n");
|
|
goto error_reset;
|
|
}
|
|
|
|
@@ -1151,7 +1151,7 @@ static int imx412_init_controls(struct imx412 *imx412)
|
|
imx412->hblank_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
|
|
|
if (ctrl_hdlr->error) {
|
|
- dev_err(imx412->dev, "control init failed: %d",
|
|
+ dev_err(imx412->dev, "control init failed: %d\n",
|
|
ctrl_hdlr->error);
|
|
v4l2_ctrl_handler_free(ctrl_hdlr);
|
|
return ctrl_hdlr->error;
|
|
@@ -1188,7 +1188,7 @@ static int imx412_probe(struct i2c_client *client)
|
|
|
|
ret = imx412_parse_hw_config(imx412);
|
|
if (ret) {
|
|
- dev_err(imx412->dev, "HW configuration is not supported");
|
|
+ dev_err(imx412->dev, "HW configuration is not supported\n");
|
|
return ret;
|
|
}
|
|
|
|
@@ -1196,14 +1196,14 @@ static int imx412_probe(struct i2c_client *client)
|
|
|
|
ret = imx412_power_on(imx412->dev);
|
|
if (ret) {
|
|
- dev_err(imx412->dev, "failed to power-on the sensor");
|
|
+ dev_err(imx412->dev, "failed to power-on the sensor\n");
|
|
goto error_mutex_destroy;
|
|
}
|
|
|
|
/* Check module identity */
|
|
ret = imx412_detect(imx412);
|
|
if (ret) {
|
|
- dev_err(imx412->dev, "failed to find sensor: %d", ret);
|
|
+ dev_err(imx412->dev, "failed to find sensor: %d\n", ret);
|
|
goto error_power_off;
|
|
}
|
|
|
|
@@ -1213,7 +1213,7 @@ static int imx412_probe(struct i2c_client *client)
|
|
|
|
ret = imx412_init_controls(imx412);
|
|
if (ret) {
|
|
- dev_err(imx412->dev, "failed to init controls: %d", ret);
|
|
+ dev_err(imx412->dev, "failed to init controls: %d\n", ret);
|
|
goto error_power_off;
|
|
}
|
|
|
|
@@ -1227,14 +1227,14 @@ static int imx412_probe(struct i2c_client *client)
|
|
imx412->pad.flags = MEDIA_PAD_FL_SOURCE;
|
|
ret = media_entity_pads_init(&imx412->sd.entity, 1, &imx412->pad);
|
|
if (ret) {
|
|
- dev_err(imx412->dev, "failed to init entity pads: %d", ret);
|
|
+ dev_err(imx412->dev, "failed to init entity pads: %d\n", ret);
|
|
goto error_handler_free;
|
|
}
|
|
|
|
ret = v4l2_async_register_subdev_sensor(&imx412->sd);
|
|
if (ret < 0) {
|
|
dev_err(imx412->dev,
|
|
- "failed to register async subdev: %d", ret);
|
|
+ "failed to register async subdev: %d\n", ret);
|
|
goto error_media_entity;
|
|
}
|
|
|
|
diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
|
|
index 068c7449f50ed5..7498f55b3ef2b7 100644
|
|
--- a/drivers/media/i2c/ov9282.c
|
|
+++ b/drivers/media/i2c/ov9282.c
|
|
@@ -40,7 +40,7 @@
|
|
/* Exposure control */
|
|
#define OV9282_REG_EXPOSURE 0x3500
|
|
#define OV9282_EXPOSURE_MIN 1
|
|
-#define OV9282_EXPOSURE_OFFSET 12
|
|
+#define OV9282_EXPOSURE_OFFSET 25
|
|
#define OV9282_EXPOSURE_STEP 1
|
|
#define OV9282_EXPOSURE_DEFAULT 0x0282
|
|
|
|
diff --git a/drivers/media/platform/marvell/mcam-core.c b/drivers/media/platform/marvell/mcam-core.c
|
|
index 66688b4aece5d8..555f560238c9a1 100644
|
|
--- a/drivers/media/platform/marvell/mcam-core.c
|
|
+++ b/drivers/media/platform/marvell/mcam-core.c
|
|
@@ -935,7 +935,12 @@ static int mclk_enable(struct clk_hw *hw)
|
|
ret = pm_runtime_resume_and_get(cam->dev);
|
|
if (ret < 0)
|
|
return ret;
|
|
- clk_enable(cam->clk[0]);
|
|
+ ret = clk_enable(cam->clk[0]);
|
|
+ if (ret) {
|
|
+ pm_runtime_put(cam->dev);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
mcam_reg_write(cam, REG_CLKCTRL, (mclk_src << 29) | mclk_div);
|
|
mcam_ctlr_power_up(cam);
|
|
|
|
diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
|
|
index e8dcd44f6e4692..092d83b7e79549 100644
|
|
--- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
|
|
+++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
|
|
@@ -2674,11 +2674,12 @@ static void mxc_jpeg_detach_pm_domains(struct mxc_jpeg_dev *jpeg)
|
|
int i;
|
|
|
|
for (i = 0; i < jpeg->num_domains; i++) {
|
|
- if (jpeg->pd_dev[i] && !pm_runtime_suspended(jpeg->pd_dev[i]))
|
|
+ if (!IS_ERR_OR_NULL(jpeg->pd_dev[i]) &&
|
|
+ !pm_runtime_suspended(jpeg->pd_dev[i]))
|
|
pm_runtime_force_suspend(jpeg->pd_dev[i]);
|
|
- if (jpeg->pd_link[i] && !IS_ERR(jpeg->pd_link[i]))
|
|
+ if (!IS_ERR_OR_NULL(jpeg->pd_link[i]))
|
|
device_link_del(jpeg->pd_link[i]);
|
|
- if (jpeg->pd_dev[i] && !IS_ERR(jpeg->pd_dev[i]))
|
|
+ if (!IS_ERR_OR_NULL(jpeg->pd_dev[i]))
|
|
dev_pm_domain_detach(jpeg->pd_dev[i], true);
|
|
jpeg->pd_dev[i] = NULL;
|
|
jpeg->pd_link[i] = NULL;
|
|
diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
|
|
index 10840c9a0912b1..111be77eca1caf 100644
|
|
--- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
|
|
+++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
|
|
@@ -861,6 +861,7 @@ int mxc_isi_video_buffer_prepare(struct mxc_isi_dev *isi, struct vb2_buffer *vb2
|
|
const struct mxc_isi_format_info *info,
|
|
const struct v4l2_pix_format_mplane *pix)
|
|
{
|
|
+ struct vb2_v4l2_buffer *v4l2_buf = to_vb2_v4l2_buffer(vb2);
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < info->mem_planes; i++) {
|
|
@@ -875,6 +876,8 @@ int mxc_isi_video_buffer_prepare(struct mxc_isi_dev *isi, struct vb2_buffer *vb2
|
|
vb2_set_plane_payload(vb2, i, size);
|
|
}
|
|
|
|
+ v4l2_buf->field = pix->field;
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
|
|
index 686ca8753ba22a..87c6fb88ab920f 100644
|
|
--- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
|
|
+++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
|
|
@@ -940,13 +940,19 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime)
|
|
state->supplies);
|
|
goto unlock;
|
|
}
|
|
- clk_enable(state->clock[CSIS_CLK_GATE]);
|
|
+ ret = clk_enable(state->clock[CSIS_CLK_GATE]);
|
|
+ if (ret) {
|
|
+ phy_power_off(state->phy);
|
|
+ regulator_bulk_disable(CSIS_NUM_SUPPLIES,
|
|
+ state->supplies);
|
|
+ goto unlock;
|
|
+ }
|
|
}
|
|
if (state->flags & ST_STREAMING)
|
|
s5pcsis_start_stream(state);
|
|
|
|
state->flags &= ~ST_SUSPENDED;
|
|
- unlock:
|
|
+unlock:
|
|
mutex_unlock(&state->lock);
|
|
return ret ? -EAGAIN : 0;
|
|
}
|
|
diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c
|
|
index e4529f666e2060..8c597dd01713a6 100644
|
|
--- a/drivers/media/platform/samsung/s3c-camif/camif-core.c
|
|
+++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c
|
|
@@ -527,10 +527,19 @@ static void s3c_camif_remove(struct platform_device *pdev)
|
|
static int s3c_camif_runtime_resume(struct device *dev)
|
|
{
|
|
struct camif_dev *camif = dev_get_drvdata(dev);
|
|
+ int ret;
|
|
+
|
|
+ ret = clk_enable(camif->clock[CLK_GATE]);
|
|
+ if (ret)
|
|
+ return ret;
|
|
|
|
- clk_enable(camif->clock[CLK_GATE]);
|
|
/* null op on s3c244x */
|
|
- clk_enable(camif->clock[CLK_CAM]);
|
|
+ ret = clk_enable(camif->clock[CLK_CAM]);
|
|
+ if (ret) {
|
|
+ clk_disable(camif->clock[CLK_GATE]);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c
|
|
index 276bf3c8a8cb49..8af94246e5916e 100644
|
|
--- a/drivers/media/rc/iguanair.c
|
|
+++ b/drivers/media/rc/iguanair.c
|
|
@@ -194,8 +194,10 @@ static int iguanair_send(struct iguanair *ir, unsigned size)
|
|
if (rc)
|
|
return rc;
|
|
|
|
- if (wait_for_completion_timeout(&ir->completion, TIMEOUT) == 0)
|
|
+ if (wait_for_completion_timeout(&ir->completion, TIMEOUT) == 0) {
|
|
+ usb_kill_urb(ir->urb_out);
|
|
return -ETIMEDOUT;
|
|
+ }
|
|
|
|
return rc;
|
|
}
|
|
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
|
|
index 4eb7dd4599b7e6..7caf5e90721a47 100644
|
|
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
|
|
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
|
|
@@ -322,13 +322,16 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
|
|
ret = -EOPNOTSUPP;
|
|
} else if ((msg[0].addr == state->af9033_i2c_addr[0]) ||
|
|
(msg[0].addr == state->af9033_i2c_addr[1])) {
|
|
+ /* demod access via firmware interface */
|
|
+ u32 reg;
|
|
+
|
|
if (msg[0].len < 3 || msg[1].len < 1) {
|
|
ret = -EOPNOTSUPP;
|
|
goto unlock;
|
|
}
|
|
- /* demod access via firmware interface */
|
|
- u32 reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 |
|
|
- msg[0].buf[2];
|
|
+
|
|
+ reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 |
|
|
+ msg[0].buf[2];
|
|
|
|
if (msg[0].addr == state->af9033_i2c_addr[1])
|
|
reg |= 0x100000;
|
|
@@ -385,13 +388,16 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
|
|
ret = -EOPNOTSUPP;
|
|
} else if ((msg[0].addr == state->af9033_i2c_addr[0]) ||
|
|
(msg[0].addr == state->af9033_i2c_addr[1])) {
|
|
+ /* demod access via firmware interface */
|
|
+ u32 reg;
|
|
+
|
|
if (msg[0].len < 3) {
|
|
ret = -EOPNOTSUPP;
|
|
goto unlock;
|
|
}
|
|
- /* demod access via firmware interface */
|
|
- u32 reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 |
|
|
- msg[0].buf[2];
|
|
+
|
|
+ reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 |
|
|
+ msg[0].buf[2];
|
|
|
|
if (msg[0].addr == state->af9033_i2c_addr[1])
|
|
reg |= 0x100000;
|
|
diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c
|
|
index 8a34e6c0d6a6d1..f0537b741d1352 100644
|
|
--- a/drivers/media/usb/dvb-usb-v2/lmedm04.c
|
|
+++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c
|
|
@@ -373,6 +373,7 @@ static int lme2510_int_read(struct dvb_usb_adapter *adap)
|
|
struct dvb_usb_device *d = adap_to_d(adap);
|
|
struct lme2510_state *lme_int = adap_to_priv(adap);
|
|
struct usb_host_endpoint *ep;
|
|
+ int ret;
|
|
|
|
lme_int->lme_urb = usb_alloc_urb(0, GFP_KERNEL);
|
|
|
|
@@ -390,11 +391,20 @@ static int lme2510_int_read(struct dvb_usb_adapter *adap)
|
|
|
|
/* Quirk of pipe reporting PIPE_BULK but behaves as interrupt */
|
|
ep = usb_pipe_endpoint(d->udev, lme_int->lme_urb->pipe);
|
|
+ if (!ep) {
|
|
+ usb_free_urb(lme_int->lme_urb);
|
|
+ return -ENODEV;
|
|
+ }
|
|
|
|
if (usb_endpoint_type(&ep->desc) == USB_ENDPOINT_XFER_BULK)
|
|
lme_int->lme_urb->pipe = usb_rcvbulkpipe(d->udev, 0xa);
|
|
|
|
- usb_submit_urb(lme_int->lme_urb, GFP_KERNEL);
|
|
+ ret = usb_submit_urb(lme_int->lme_urb, GFP_KERNEL);
|
|
+ if (ret) {
|
|
+ usb_free_urb(lme_int->lme_urb);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
info("INT Interrupt Service Started");
|
|
|
|
return 0;
|
|
diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c
|
|
index 16fa17bbd15eaa..83ed7821fa2a77 100644
|
|
--- a/drivers/media/usb/uvc/uvc_queue.c
|
|
+++ b/drivers/media/usb/uvc/uvc_queue.c
|
|
@@ -483,7 +483,8 @@ static void uvc_queue_buffer_complete(struct kref *ref)
|
|
|
|
buf->state = buf->error ? UVC_BUF_STATE_ERROR : UVC_BUF_STATE_DONE;
|
|
vb2_set_plane_payload(&buf->buf.vb2_buf, 0, buf->bytesused);
|
|
- vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE);
|
|
+ vb2_buffer_done(&buf->buf.vb2_buf, buf->error ? VB2_BUF_STATE_ERROR :
|
|
+ VB2_BUF_STATE_DONE);
|
|
}
|
|
|
|
/*
|
|
diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
|
|
index a78a88c710e24a..b5f6682ff38311 100644
|
|
--- a/drivers/media/usb/uvc/uvc_status.c
|
|
+++ b/drivers/media/usb/uvc/uvc_status.c
|
|
@@ -269,6 +269,7 @@ int uvc_status_init(struct uvc_device *dev)
|
|
dev->int_urb = usb_alloc_urb(0, GFP_KERNEL);
|
|
if (!dev->int_urb) {
|
|
kfree(dev->status);
|
|
+ dev->status = NULL;
|
|
return -ENOMEM;
|
|
}
|
|
|
|
diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c
|
|
index fd595c851a2786..eb2813b51d770b 100644
|
|
--- a/drivers/memory/tegra/tegra20-emc.c
|
|
+++ b/drivers/memory/tegra/tegra20-emc.c
|
|
@@ -477,14 +477,15 @@ tegra_emc_find_node_by_ram_code(struct tegra_emc *emc)
|
|
|
|
ram_code = tegra_read_ram_code();
|
|
|
|
- for (np = of_find_node_by_name(dev->of_node, "emc-tables"); np;
|
|
- np = of_find_node_by_name(np, "emc-tables")) {
|
|
+ for_each_child_of_node(dev->of_node, np) {
|
|
+ if (!of_node_name_eq(np, "emc-tables"))
|
|
+ continue;
|
|
err = of_property_read_u32(np, "nvidia,ram-code", &value);
|
|
if (err || value != ram_code) {
|
|
struct device_node *lpddr2_np;
|
|
bool cfg_mismatches = false;
|
|
|
|
- lpddr2_np = of_find_node_by_name(np, "lpddr2");
|
|
+ lpddr2_np = of_get_child_by_name(np, "lpddr2");
|
|
if (lpddr2_np) {
|
|
const struct lpddr2_info *info;
|
|
|
|
@@ -521,7 +522,6 @@ tegra_emc_find_node_by_ram_code(struct tegra_emc *emc)
|
|
}
|
|
|
|
if (cfg_mismatches) {
|
|
- of_node_put(np);
|
|
continue;
|
|
}
|
|
}
|
|
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
|
|
index 7d0e91164cbaa3..729e79e1be49fa 100644
|
|
--- a/drivers/mfd/syscon.c
|
|
+++ b/drivers/mfd/syscon.c
|
|
@@ -8,12 +8,14 @@
|
|
* Author: Dong Aisheng <dong.aisheng@linaro.org>
|
|
*/
|
|
|
|
+#include <linux/cleanup.h>
|
|
#include <linux/clk.h>
|
|
#include <linux/err.h>
|
|
#include <linux/hwspinlock.h>
|
|
#include <linux/io.h>
|
|
#include <linux/init.h>
|
|
#include <linux/list.h>
|
|
+#include <linux/mutex.h>
|
|
#include <linux/of.h>
|
|
#include <linux/of_address.h>
|
|
#include <linux/of_platform.h>
|
|
@@ -26,7 +28,7 @@
|
|
|
|
static struct platform_driver syscon_driver;
|
|
|
|
-static DEFINE_SPINLOCK(syscon_list_slock);
|
|
+static DEFINE_MUTEX(syscon_list_lock);
|
|
static LIST_HEAD(syscon_list);
|
|
|
|
struct syscon {
|
|
@@ -45,7 +47,6 @@ static const struct regmap_config syscon_regmap_config = {
|
|
static struct syscon *of_syscon_register(struct device_node *np, bool check_res)
|
|
{
|
|
struct clk *clk;
|
|
- struct syscon *syscon;
|
|
struct regmap *regmap;
|
|
void __iomem *base;
|
|
u32 reg_io_width;
|
|
@@ -54,20 +55,18 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)
|
|
struct resource res;
|
|
struct reset_control *reset;
|
|
|
|
- syscon = kzalloc(sizeof(*syscon), GFP_KERNEL);
|
|
+ WARN_ON(!mutex_is_locked(&syscon_list_lock));
|
|
+
|
|
+ struct syscon *syscon __free(kfree) = kzalloc(sizeof(*syscon), GFP_KERNEL);
|
|
if (!syscon)
|
|
return ERR_PTR(-ENOMEM);
|
|
|
|
- if (of_address_to_resource(np, 0, &res)) {
|
|
- ret = -ENOMEM;
|
|
- goto err_map;
|
|
- }
|
|
+ if (of_address_to_resource(np, 0, &res))
|
|
+ return ERR_PTR(-ENOMEM);
|
|
|
|
base = of_iomap(np, 0);
|
|
- if (!base) {
|
|
- ret = -ENOMEM;
|
|
- goto err_map;
|
|
- }
|
|
+ if (!base)
|
|
+ return ERR_PTR(-ENOMEM);
|
|
|
|
/* Parse the device's DT node for an endianness specification */
|
|
if (of_property_read_bool(np, "big-endian"))
|
|
@@ -148,11 +147,9 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)
|
|
syscon->regmap = regmap;
|
|
syscon->np = np;
|
|
|
|
- spin_lock(&syscon_list_slock);
|
|
list_add_tail(&syscon->list, &syscon_list);
|
|
- spin_unlock(&syscon_list_slock);
|
|
|
|
- return syscon;
|
|
+ return_ptr(syscon);
|
|
|
|
err_reset:
|
|
reset_control_put(reset);
|
|
@@ -163,8 +160,6 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)
|
|
regmap_exit(regmap);
|
|
err_regmap:
|
|
iounmap(base);
|
|
-err_map:
|
|
- kfree(syscon);
|
|
return ERR_PTR(ret);
|
|
}
|
|
|
|
@@ -173,7 +168,7 @@ static struct regmap *device_node_get_regmap(struct device_node *np,
|
|
{
|
|
struct syscon *entry, *syscon = NULL;
|
|
|
|
- spin_lock(&syscon_list_slock);
|
|
+ mutex_lock(&syscon_list_lock);
|
|
|
|
list_for_each_entry(entry, &syscon_list, list)
|
|
if (entry->np == np) {
|
|
@@ -181,17 +176,65 @@ static struct regmap *device_node_get_regmap(struct device_node *np,
|
|
break;
|
|
}
|
|
|
|
- spin_unlock(&syscon_list_slock);
|
|
-
|
|
if (!syscon)
|
|
syscon = of_syscon_register(np, check_res);
|
|
|
|
+ mutex_unlock(&syscon_list_lock);
|
|
+
|
|
if (IS_ERR(syscon))
|
|
return ERR_CAST(syscon);
|
|
|
|
return syscon->regmap;
|
|
}
|
|
|
|
+/**
|
|
+ * of_syscon_register_regmap() - Register regmap for specified device node
|
|
+ * @np: Device tree node
|
|
+ * @regmap: Pointer to regmap object
|
|
+ *
|
|
+ * Register an externally created regmap object with syscon for the specified
|
|
+ * device tree node. This regmap will then be returned to client drivers using
|
|
+ * the syscon_regmap_lookup_by_phandle() API.
|
|
+ *
|
|
+ * Return: 0 on success, negative error code on failure.
|
|
+ */
|
|
+int of_syscon_register_regmap(struct device_node *np, struct regmap *regmap)
|
|
+{
|
|
+ struct syscon *entry, *syscon = NULL;
|
|
+ int ret;
|
|
+
|
|
+ if (!np || !regmap)
|
|
+ return -EINVAL;
|
|
+
|
|
+ syscon = kzalloc(sizeof(*syscon), GFP_KERNEL);
|
|
+ if (!syscon)
|
|
+ return -ENOMEM;
|
|
+
|
|
+ /* check if syscon entry already exists */
|
|
+ mutex_lock(&syscon_list_lock);
|
|
+
|
|
+ list_for_each_entry(entry, &syscon_list, list)
|
|
+ if (entry->np == np) {
|
|
+ ret = -EEXIST;
|
|
+ goto err_unlock;
|
|
+ }
|
|
+
|
|
+ syscon->regmap = regmap;
|
|
+ syscon->np = np;
|
|
+
|
|
+ /* register the regmap in syscon list */
|
|
+ list_add_tail(&syscon->list, &syscon_list);
|
|
+ mutex_unlock(&syscon_list_lock);
|
|
+
|
|
+ return 0;
|
|
+
|
|
+err_unlock:
|
|
+ mutex_unlock(&syscon_list_lock);
|
|
+ kfree(syscon);
|
|
+ return ret;
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(of_syscon_register_regmap);
|
|
+
|
|
struct regmap *device_node_to_regmap(struct device_node *np)
|
|
{
|
|
return device_node_get_regmap(np, false);
|
|
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
|
|
index b88eb70c17b353..936a9f6c16f0e4 100644
|
|
--- a/drivers/mfd/ti_am335x_tscadc.c
|
|
+++ b/drivers/mfd/ti_am335x_tscadc.c
|
|
@@ -119,8 +119,6 @@ static int ti_tscadc_probe(struct platform_device *pdev)
|
|
struct clk *clk;
|
|
struct device_node *node;
|
|
struct mfd_cell *cell;
|
|
- struct property *prop;
|
|
- const __be32 *cur;
|
|
bool use_tsc = false, use_mag = false;
|
|
u32 val;
|
|
int err;
|
|
@@ -167,7 +165,7 @@ static int ti_tscadc_probe(struct platform_device *pdev)
|
|
}
|
|
|
|
node = of_get_child_by_name(pdev->dev.of_node, "adc");
|
|
- of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) {
|
|
+ of_property_for_each_u32(node, "ti,adc-channels", val) {
|
|
adc_channels++;
|
|
if (val > 7) {
|
|
dev_err(&pdev->dev, " PIN numbers are 0..7 (not %d)\n",
|
|
diff --git a/drivers/misc/cardreader/rtsx_usb.c b/drivers/misc/cardreader/rtsx_usb.c
|
|
index f150d8769f1986..285a748748d701 100644
|
|
--- a/drivers/misc/cardreader/rtsx_usb.c
|
|
+++ b/drivers/misc/cardreader/rtsx_usb.c
|
|
@@ -286,6 +286,7 @@ static int rtsx_usb_get_status_with_bulk(struct rtsx_ucr *ucr, u16 *status)
|
|
int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status)
|
|
{
|
|
int ret;
|
|
+ u8 interrupt_val = 0;
|
|
u16 *buf;
|
|
|
|
if (!status)
|
|
@@ -308,6 +309,20 @@ int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status)
|
|
ret = rtsx_usb_get_status_with_bulk(ucr, status);
|
|
}
|
|
|
|
+ rtsx_usb_read_register(ucr, CARD_INT_PEND, &interrupt_val);
|
|
+ /* Cross check presence with interrupts */
|
|
+ if (*status & XD_CD)
|
|
+ if (!(interrupt_val & XD_INT))
|
|
+ *status &= ~XD_CD;
|
|
+
|
|
+ if (*status & SD_CD)
|
|
+ if (!(interrupt_val & SD_INT))
|
|
+ *status &= ~SD_CD;
|
|
+
|
|
+ if (*status & MS_CD)
|
|
+ if (!(interrupt_val & MS_INT))
|
|
+ *status &= ~MS_CD;
|
|
+
|
|
/* usb_control_msg may return positive when success */
|
|
if (ret < 0)
|
|
return ret;
|
|
diff --git a/drivers/mtd/hyperbus/hbmc-am654.c b/drivers/mtd/hyperbus/hbmc-am654.c
|
|
index a6161ce340d4eb..4b6cbee23fe893 100644
|
|
--- a/drivers/mtd/hyperbus/hbmc-am654.c
|
|
+++ b/drivers/mtd/hyperbus/hbmc-am654.c
|
|
@@ -174,26 +174,30 @@ static int am654_hbmc_probe(struct platform_device *pdev)
|
|
priv->hbdev.np = of_get_next_child(np, NULL);
|
|
ret = of_address_to_resource(priv->hbdev.np, 0, &res);
|
|
if (ret)
|
|
- return ret;
|
|
+ goto put_node;
|
|
|
|
if (of_property_read_bool(dev->of_node, "mux-controls")) {
|
|
struct mux_control *control = devm_mux_control_get(dev, NULL);
|
|
|
|
- if (IS_ERR(control))
|
|
- return PTR_ERR(control);
|
|
+ if (IS_ERR(control)) {
|
|
+ ret = PTR_ERR(control);
|
|
+ goto put_node;
|
|
+ }
|
|
|
|
ret = mux_control_select(control, 1);
|
|
if (ret) {
|
|
dev_err(dev, "Failed to select HBMC mux\n");
|
|
- return ret;
|
|
+ goto put_node;
|
|
}
|
|
priv->mux_ctrl = control;
|
|
}
|
|
|
|
priv->hbdev.map.size = resource_size(&res);
|
|
priv->hbdev.map.virt = devm_ioremap_resource(dev, &res);
|
|
- if (IS_ERR(priv->hbdev.map.virt))
|
|
- return PTR_ERR(priv->hbdev.map.virt);
|
|
+ if (IS_ERR(priv->hbdev.map.virt)) {
|
|
+ ret = PTR_ERR(priv->hbdev.map.virt);
|
|
+ goto disable_mux;
|
|
+ }
|
|
|
|
priv->ctlr.dev = dev;
|
|
priv->ctlr.ops = &am654_hbmc_ops;
|
|
@@ -226,10 +230,12 @@ static int am654_hbmc_probe(struct platform_device *pdev)
|
|
disable_mux:
|
|
if (priv->mux_ctrl)
|
|
mux_control_deselect(priv->mux_ctrl);
|
|
+put_node:
|
|
+ of_node_put(priv->hbdev.np);
|
|
return ret;
|
|
}
|
|
|
|
-static int am654_hbmc_remove(struct platform_device *pdev)
|
|
+static void am654_hbmc_remove(struct platform_device *pdev)
|
|
{
|
|
struct am654_hbmc_priv *priv = platform_get_drvdata(pdev);
|
|
struct am654_hbmc_device_priv *dev_priv = priv->hbdev.priv;
|
|
@@ -241,8 +247,7 @@ static int am654_hbmc_remove(struct platform_device *pdev)
|
|
|
|
if (dev_priv->rx_chan)
|
|
dma_release_channel(dev_priv->rx_chan);
|
|
-
|
|
- return 0;
|
|
+ of_node_put(priv->hbdev.np);
|
|
}
|
|
|
|
static const struct of_device_id am654_hbmc_dt_ids[] = {
|
|
@@ -256,7 +261,7 @@ MODULE_DEVICE_TABLE(of, am654_hbmc_dt_ids);
|
|
|
|
static struct platform_driver am654_hbmc_platform_driver = {
|
|
.probe = am654_hbmc_probe,
|
|
- .remove = am654_hbmc_remove,
|
|
+ .remove_new = am654_hbmc_remove,
|
|
.driver = {
|
|
.name = "hbmc-am654",
|
|
.of_match_table = am654_hbmc_dt_ids,
|
|
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
|
|
index 440bef477930c2..085a16148a68d4 100644
|
|
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
|
|
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
|
|
@@ -2450,6 +2450,11 @@ static int brcmnand_write(struct mtd_info *mtd, struct nand_chip *chip,
|
|
brcmnand_send_cmd(host, CMD_PROGRAM_PAGE);
|
|
status = brcmnand_waitfunc(chip);
|
|
|
|
+ if (status < 0) {
|
|
+ ret = status;
|
|
+ goto out;
|
|
+ }
|
|
+
|
|
if (status & NAND_STATUS_FAIL) {
|
|
dev_info(ctrl->dev, "program failed at %llx\n",
|
|
(unsigned long long)addr);
|
|
diff --git a/drivers/net/ethernet/broadcom/bgmac.h b/drivers/net/ethernet/broadcom/bgmac.h
|
|
index d73ef262991d61..6fee9a41839c0b 100644
|
|
--- a/drivers/net/ethernet/broadcom/bgmac.h
|
|
+++ b/drivers/net/ethernet/broadcom/bgmac.h
|
|
@@ -328,8 +328,7 @@
|
|
#define BGMAC_RX_FRAME_OFFSET 30 /* There are 2 unused bytes between header and real data */
|
|
#define BGMAC_RX_BUF_OFFSET (NET_SKB_PAD + NET_IP_ALIGN - \
|
|
BGMAC_RX_FRAME_OFFSET)
|
|
-/* Jumbo frame size with FCS */
|
|
-#define BGMAC_RX_MAX_FRAME_SIZE 9724
|
|
+#define BGMAC_RX_MAX_FRAME_SIZE 1536
|
|
#define BGMAC_RX_BUF_SIZE (BGMAC_RX_FRAME_OFFSET + BGMAC_RX_MAX_FRAME_SIZE)
|
|
#define BGMAC_RX_ALLOC_SIZE (SKB_DATA_ALIGN(BGMAC_RX_BUF_SIZE + BGMAC_RX_BUF_OFFSET) + \
|
|
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
|
|
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
|
|
index 05a89ab6766c41..bd38f2f57c8abc 100644
|
|
--- a/drivers/net/ethernet/davicom/dm9000.c
|
|
+++ b/drivers/net/ethernet/davicom/dm9000.c
|
|
@@ -1778,10 +1778,11 @@ dm9000_drv_remove(struct platform_device *pdev)
|
|
|
|
unregister_netdev(ndev);
|
|
dm9000_release_board(pdev, dm);
|
|
- free_netdev(ndev); /* free device structure */
|
|
if (dm->power_supply)
|
|
regulator_disable(dm->power_supply);
|
|
|
|
+ free_netdev(ndev); /* free device structure */
|
|
+
|
|
dev_dbg(&pdev->dev, "released and freed device\n");
|
|
return 0;
|
|
}
|
|
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
|
|
index 8f5cc1f2331884..2d6b50903c923d 100644
|
|
--- a/drivers/net/ethernet/freescale/fec_main.c
|
|
+++ b/drivers/net/ethernet/freescale/fec_main.c
|
|
@@ -821,6 +821,8 @@ static int fec_enet_txq_submit_tso(struct fec_enet_priv_tx_q *txq,
|
|
struct fec_enet_private *fep = netdev_priv(ndev);
|
|
int hdr_len, total_len, data_left;
|
|
struct bufdesc *bdp = txq->bd.cur;
|
|
+ struct bufdesc *tmp_bdp;
|
|
+ struct bufdesc_ex *ebdp;
|
|
struct tso_t tso;
|
|
unsigned int index = 0;
|
|
int ret;
|
|
@@ -894,7 +896,34 @@ static int fec_enet_txq_submit_tso(struct fec_enet_priv_tx_q *txq,
|
|
return 0;
|
|
|
|
err_release:
|
|
- /* TODO: Release all used data descriptors for TSO */
|
|
+ /* Release all used data descriptors for TSO */
|
|
+ tmp_bdp = txq->bd.cur;
|
|
+
|
|
+ while (tmp_bdp != bdp) {
|
|
+ /* Unmap data buffers */
|
|
+ if (tmp_bdp->cbd_bufaddr &&
|
|
+ !IS_TSO_HEADER(txq, fec32_to_cpu(tmp_bdp->cbd_bufaddr)))
|
|
+ dma_unmap_single(&fep->pdev->dev,
|
|
+ fec32_to_cpu(tmp_bdp->cbd_bufaddr),
|
|
+ fec16_to_cpu(tmp_bdp->cbd_datlen),
|
|
+ DMA_TO_DEVICE);
|
|
+
|
|
+ /* Clear standard buffer descriptor fields */
|
|
+ tmp_bdp->cbd_sc = 0;
|
|
+ tmp_bdp->cbd_datlen = 0;
|
|
+ tmp_bdp->cbd_bufaddr = 0;
|
|
+
|
|
+ /* Handle extended descriptor if enabled */
|
|
+ if (fep->bufdesc_ex) {
|
|
+ ebdp = (struct bufdesc_ex *)tmp_bdp;
|
|
+ ebdp->cbd_esc = 0;
|
|
+ }
|
|
+
|
|
+ tmp_bdp = fec_enet_get_nextdesc(tmp_bdp, &txq->bd);
|
|
+ }
|
|
+
|
|
+ dev_kfree_skb_any(skb);
|
|
+
|
|
return ret;
|
|
}
|
|
|
|
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
|
|
index 9a63fbc6940831..b25fb400f4767e 100644
|
|
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c
|
|
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
|
|
@@ -40,6 +40,21 @@ EXPORT_SYMBOL(hnae3_unregister_ae_algo_prepare);
|
|
*/
|
|
static DEFINE_MUTEX(hnae3_common_lock);
|
|
|
|
+/* ensure the drivers being unloaded one by one */
|
|
+static DEFINE_MUTEX(hnae3_unload_lock);
|
|
+
|
|
+void hnae3_acquire_unload_lock(void)
|
|
+{
|
|
+ mutex_lock(&hnae3_unload_lock);
|
|
+}
|
|
+EXPORT_SYMBOL(hnae3_acquire_unload_lock);
|
|
+
|
|
+void hnae3_release_unload_lock(void)
|
|
+{
|
|
+ mutex_unlock(&hnae3_unload_lock);
|
|
+}
|
|
+EXPORT_SYMBOL(hnae3_release_unload_lock);
|
|
+
|
|
static bool hnae3_client_match(enum hnae3_client_type client_type)
|
|
{
|
|
if (client_type == HNAE3_CLIENT_KNIC ||
|
|
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
|
|
index 57787c380fa07f..7eb22b8ea3e707 100644
|
|
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
|
|
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
|
|
@@ -946,4 +946,6 @@ int hnae3_register_client(struct hnae3_client *client);
|
|
void hnae3_set_client_init_flag(struct hnae3_client *client,
|
|
struct hnae3_ae_dev *ae_dev,
|
|
unsigned int inited);
|
|
+void hnae3_acquire_unload_lock(void);
|
|
+void hnae3_release_unload_lock(void);
|
|
#endif
|
|
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
|
|
index 14d086b535a2dc..801801e8803e9f 100644
|
|
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
|
|
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
|
|
@@ -6008,9 +6008,11 @@ module_init(hns3_init_module);
|
|
*/
|
|
static void __exit hns3_exit_module(void)
|
|
{
|
|
+ hnae3_acquire_unload_lock();
|
|
pci_unregister_driver(&hns3_driver);
|
|
hnae3_unregister_client(&client);
|
|
hns3_dbg_unregister_debugfs();
|
|
+ hnae3_release_unload_lock();
|
|
}
|
|
module_exit(hns3_exit_module);
|
|
|
|
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
|
|
index 9650ce594e2fdd..4d318af748a0b7 100644
|
|
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
|
|
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
|
|
@@ -12814,9 +12814,11 @@ static int __init hclge_init(void)
|
|
|
|
static void __exit hclge_exit(void)
|
|
{
|
|
+ hnae3_acquire_unload_lock();
|
|
hnae3_unregister_ae_algo_prepare(&ae_algo);
|
|
hnae3_unregister_ae_algo(&ae_algo);
|
|
destroy_workqueue(hclge_wq);
|
|
+ hnae3_release_unload_lock();
|
|
}
|
|
module_init(hclge_init);
|
|
module_exit(hclge_exit);
|
|
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
|
|
index affdd9d70549ac..69bfcfb148def4 100644
|
|
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
|
|
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
|
|
@@ -3345,8 +3345,10 @@ static int __init hclgevf_init(void)
|
|
|
|
static void __exit hclgevf_exit(void)
|
|
{
|
|
+ hnae3_acquire_unload_lock();
|
|
hnae3_unregister_ae_algo(&ae_algovf);
|
|
destroy_workqueue(hclgevf_wq);
|
|
+ hnae3_release_unload_lock();
|
|
}
|
|
module_init(hclgevf_init);
|
|
module_exit(hclgevf_exit);
|
|
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
|
|
index ce0b9199952649..fde8d7b80ca662 100644
|
|
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
|
|
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
|
|
@@ -801,6 +801,11 @@ iavf_vlan_filter *iavf_add_vlan(struct iavf_adapter *adapter,
|
|
f->state = IAVF_VLAN_ADD;
|
|
adapter->num_vlan_filters++;
|
|
iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_VLAN_FILTER);
|
|
+ } else if (f->state == IAVF_VLAN_REMOVE) {
|
|
+ /* IAVF_VLAN_REMOVE means that VLAN wasn't yet removed.
|
|
+ * We can safely only change the state here.
|
|
+ */
|
|
+ f->state = IAVF_VLAN_ACTIVE;
|
|
}
|
|
|
|
clearout:
|
|
@@ -821,8 +826,18 @@ static void iavf_del_vlan(struct iavf_adapter *adapter, struct iavf_vlan vlan)
|
|
|
|
f = iavf_find_vlan(adapter, vlan);
|
|
if (f) {
|
|
- f->state = IAVF_VLAN_REMOVE;
|
|
- iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_DEL_VLAN_FILTER);
|
|
+ /* IAVF_ADD_VLAN means that VLAN wasn't even added yet.
|
|
+ * Remove it from the list.
|
|
+ */
|
|
+ if (f->state == IAVF_VLAN_ADD) {
|
|
+ list_del(&f->list);
|
|
+ kfree(f);
|
|
+ adapter->num_vlan_filters--;
|
|
+ } else {
|
|
+ f->state = IAVF_VLAN_REMOVE;
|
|
+ iavf_schedule_aq_request(adapter,
|
|
+ IAVF_FLAG_AQ_DEL_VLAN_FILTER);
|
|
+ }
|
|
}
|
|
|
|
spin_unlock_bh(&adapter->mac_vlan_list_lock);
|
|
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
|
|
index 2ee1374db4c06e..6f1fe7e283d4eb 100644
|
|
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
|
|
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
|
|
@@ -761,12 +761,6 @@ static void octep_get_stats64(struct net_device *netdev,
|
|
struct octep_device *oct = netdev_priv(netdev);
|
|
int q;
|
|
|
|
- if (netif_running(netdev))
|
|
- octep_ctrl_net_get_if_stats(oct,
|
|
- OCTEP_CTRL_NET_INVALID_VFID,
|
|
- &oct->iface_rx_stats,
|
|
- &oct->iface_tx_stats);
|
|
-
|
|
tx_packets = 0;
|
|
tx_bytes = 0;
|
|
rx_packets = 0;
|
|
@@ -784,10 +778,6 @@ static void octep_get_stats64(struct net_device *netdev,
|
|
stats->tx_bytes = tx_bytes;
|
|
stats->rx_packets = rx_packets;
|
|
stats->rx_bytes = rx_bytes;
|
|
- stats->multicast = oct->iface_rx_stats.mcast_pkts;
|
|
- stats->rx_errors = oct->iface_rx_stats.err_pkts;
|
|
- stats->collisions = oct->iface_tx_stats.xscol;
|
|
- stats->tx_fifo_errors = oct->iface_tx_stats.undflw;
|
|
}
|
|
|
|
/**
|
|
diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
|
|
index 46245e0b24623d..43c84900369a36 100644
|
|
--- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
|
|
+++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
|
|
@@ -14,7 +14,6 @@
|
|
#define MLXFW_FSM_STATE_WAIT_TIMEOUT_MS 30000
|
|
#define MLXFW_FSM_STATE_WAIT_ROUNDS \
|
|
(MLXFW_FSM_STATE_WAIT_TIMEOUT_MS / MLXFW_FSM_STATE_WAIT_CYCLE_MS)
|
|
-#define MLXFW_FSM_MAX_COMPONENT_SIZE (10 * (1 << 20))
|
|
|
|
static const int mlxfw_fsm_state_errno[] = {
|
|
[MLXFW_FSM_STATE_ERR_ERROR] = -EIO,
|
|
@@ -229,7 +228,6 @@ static int mlxfw_flash_component(struct mlxfw_dev *mlxfw_dev,
|
|
return err;
|
|
}
|
|
|
|
- comp_max_size = min_t(u32, comp_max_size, MLXFW_FSM_MAX_COMPONENT_SIZE);
|
|
if (comp->data_size > comp_max_size) {
|
|
MLXFW_ERR_MSG(mlxfw_dev, extack,
|
|
"Component size is bigger than limit", -EINVAL);
|
|
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c
|
|
index 69cd689dbc83e9..5afe6b155ef0d5 100644
|
|
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c
|
|
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c
|
|
@@ -1003,10 +1003,10 @@ static void mlxsw_sp_mr_route_stats_update(struct mlxsw_sp *mlxsw_sp,
|
|
mr->mr_ops->route_stats(mlxsw_sp, mr_route->route_priv, &packets,
|
|
&bytes);
|
|
|
|
- if (mr_route->mfc->mfc_un.res.pkt != packets)
|
|
- mr_route->mfc->mfc_un.res.lastuse = jiffies;
|
|
- mr_route->mfc->mfc_un.res.pkt = packets;
|
|
- mr_route->mfc->mfc_un.res.bytes = bytes;
|
|
+ if (atomic_long_read(&mr_route->mfc->mfc_un.res.pkt) != packets)
|
|
+ WRITE_ONCE(mr_route->mfc->mfc_un.res.lastuse, jiffies);
|
|
+ atomic_long_set(&mr_route->mfc->mfc_un.res.pkt, packets);
|
|
+ atomic_long_set(&mr_route->mfc->mfc_un.res.bytes, bytes);
|
|
}
|
|
|
|
static void mlxsw_sp_mr_stats_update(struct work_struct *work)
|
|
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
|
|
index 274ea16c0a1f71..0c0fd68ded423d 100644
|
|
--- a/drivers/net/ethernet/renesas/sh_eth.c
|
|
+++ b/drivers/net/ethernet/renesas/sh_eth.c
|
|
@@ -3496,10 +3496,12 @@ static int sh_eth_suspend(struct device *dev)
|
|
|
|
netif_device_detach(ndev);
|
|
|
|
+ rtnl_lock();
|
|
if (mdp->wol_enabled)
|
|
ret = sh_eth_wol_setup(ndev);
|
|
else
|
|
ret = sh_eth_close(ndev);
|
|
+ rtnl_unlock();
|
|
|
|
return ret;
|
|
}
|
|
@@ -3513,10 +3515,12 @@ static int sh_eth_resume(struct device *dev)
|
|
if (!netif_running(ndev))
|
|
return 0;
|
|
|
|
+ rtnl_lock();
|
|
if (mdp->wol_enabled)
|
|
ret = sh_eth_wol_restore(ndev);
|
|
else
|
|
ret = sh_eth_open(ndev);
|
|
+ rtnl_unlock();
|
|
|
|
if (ret < 0)
|
|
return ret;
|
|
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
|
index d6ee90fef2eca4..d3d5c01f6dcbaa 100644
|
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
|
@@ -7103,6 +7103,36 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
|
|
if (priv->dma_cap.tsoen)
|
|
dev_info(priv->device, "TSO supported\n");
|
|
|
|
+ if (priv->dma_cap.number_rx_queues &&
|
|
+ priv->plat->rx_queues_to_use > priv->dma_cap.number_rx_queues) {
|
|
+ dev_warn(priv->device,
|
|
+ "Number of Rx queues (%u) exceeds dma capability\n",
|
|
+ priv->plat->rx_queues_to_use);
|
|
+ priv->plat->rx_queues_to_use = priv->dma_cap.number_rx_queues;
|
|
+ }
|
|
+ if (priv->dma_cap.number_tx_queues &&
|
|
+ priv->plat->tx_queues_to_use > priv->dma_cap.number_tx_queues) {
|
|
+ dev_warn(priv->device,
|
|
+ "Number of Tx queues (%u) exceeds dma capability\n",
|
|
+ priv->plat->tx_queues_to_use);
|
|
+ priv->plat->tx_queues_to_use = priv->dma_cap.number_tx_queues;
|
|
+ }
|
|
+
|
|
+ if (priv->dma_cap.rx_fifo_size &&
|
|
+ priv->plat->rx_fifo_size > priv->dma_cap.rx_fifo_size) {
|
|
+ dev_warn(priv->device,
|
|
+ "Rx FIFO size (%u) exceeds dma capability\n",
|
|
+ priv->plat->rx_fifo_size);
|
|
+ priv->plat->rx_fifo_size = priv->dma_cap.rx_fifo_size;
|
|
+ }
|
|
+ if (priv->dma_cap.tx_fifo_size &&
|
|
+ priv->plat->tx_fifo_size > priv->dma_cap.tx_fifo_size) {
|
|
+ dev_warn(priv->device,
|
|
+ "Tx FIFO size (%u) exceeds dma capability\n",
|
|
+ priv->plat->tx_fifo_size);
|
|
+ priv->plat->tx_fifo_size = priv->dma_cap.tx_fifo_size;
|
|
+ }
|
|
+
|
|
priv->hw->vlan_fail_q_en =
|
|
(priv->plat->flags & STMMAC_FLAG_VLAN_FAIL_Q_EN);
|
|
priv->hw->vlan_fail_q = priv->plat->vlan_fail_q;
|
|
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
|
|
index d556e705ec000d..8ffc1fbb036f9f 100644
|
|
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
|
|
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
|
|
@@ -1651,7 +1651,7 @@ void am65_cpsw_nuss_remove_tx_chns(struct am65_cpsw_common *common)
|
|
for (i = 0; i < common->tx_ch_num; i++) {
|
|
struct am65_cpsw_tx_chn *tx_chn = &common->tx_chns[i];
|
|
|
|
- if (tx_chn->irq)
|
|
+ if (tx_chn->irq > 0)
|
|
devm_free_irq(dev, tx_chn->irq, tx_chn);
|
|
|
|
netif_napi_del(&tx_chn->napi_tx);
|
|
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
|
|
index 028c825b86db1e..dfc6e00b718e31 100644
|
|
--- a/drivers/net/netdevsim/netdevsim.h
|
|
+++ b/drivers/net/netdevsim/netdevsim.h
|
|
@@ -121,6 +121,7 @@ struct netdevsim {
|
|
u32 sleep;
|
|
u32 __ports[2][NSIM_UDP_TUNNEL_N_PORTS];
|
|
u32 (*ports)[NSIM_UDP_TUNNEL_N_PORTS];
|
|
+ struct dentry *ddir;
|
|
struct debugfs_u32_array dfs_ports[2];
|
|
} udp_ports;
|
|
|
|
diff --git a/drivers/net/netdevsim/udp_tunnels.c b/drivers/net/netdevsim/udp_tunnels.c
|
|
index 02dc3123eb6c16..640b4983a9a0d1 100644
|
|
--- a/drivers/net/netdevsim/udp_tunnels.c
|
|
+++ b/drivers/net/netdevsim/udp_tunnels.c
|
|
@@ -112,9 +112,11 @@ nsim_udp_tunnels_info_reset_write(struct file *file, const char __user *data,
|
|
struct net_device *dev = file->private_data;
|
|
struct netdevsim *ns = netdev_priv(dev);
|
|
|
|
- memset(ns->udp_ports.ports, 0, sizeof(ns->udp_ports.__ports));
|
|
rtnl_lock();
|
|
- udp_tunnel_nic_reset_ntf(dev);
|
|
+ if (dev->reg_state == NETREG_REGISTERED) {
|
|
+ memset(ns->udp_ports.ports, 0, sizeof(ns->udp_ports.__ports));
|
|
+ udp_tunnel_nic_reset_ntf(dev);
|
|
+ }
|
|
rtnl_unlock();
|
|
|
|
return count;
|
|
@@ -144,23 +146,23 @@ int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev,
|
|
else
|
|
ns->udp_ports.ports = nsim_dev->udp_ports.__ports;
|
|
|
|
- debugfs_create_u32("udp_ports_inject_error", 0600,
|
|
- ns->nsim_dev_port->ddir,
|
|
+ ns->udp_ports.ddir = debugfs_create_dir("udp_ports",
|
|
+ ns->nsim_dev_port->ddir);
|
|
+
|
|
+ debugfs_create_u32("inject_error", 0600, ns->udp_ports.ddir,
|
|
&ns->udp_ports.inject_error);
|
|
|
|
ns->udp_ports.dfs_ports[0].array = ns->udp_ports.ports[0];
|
|
ns->udp_ports.dfs_ports[0].n_elements = NSIM_UDP_TUNNEL_N_PORTS;
|
|
- debugfs_create_u32_array("udp_ports_table0", 0400,
|
|
- ns->nsim_dev_port->ddir,
|
|
+ debugfs_create_u32_array("table0", 0400, ns->udp_ports.ddir,
|
|
&ns->udp_ports.dfs_ports[0]);
|
|
|
|
ns->udp_ports.dfs_ports[1].array = ns->udp_ports.ports[1];
|
|
ns->udp_ports.dfs_ports[1].n_elements = NSIM_UDP_TUNNEL_N_PORTS;
|
|
- debugfs_create_u32_array("udp_ports_table1", 0400,
|
|
- ns->nsim_dev_port->ddir,
|
|
+ debugfs_create_u32_array("table1", 0400, ns->udp_ports.ddir,
|
|
&ns->udp_ports.dfs_ports[1]);
|
|
|
|
- debugfs_create_file("udp_ports_reset", 0200, ns->nsim_dev_port->ddir,
|
|
+ debugfs_create_file("reset", 0200, ns->udp_ports.ddir,
|
|
dev, &nsim_udp_tunnels_info_reset_fops);
|
|
|
|
/* Note: it's not normal to allocate the info struct like this!
|
|
@@ -196,6 +198,9 @@ int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev,
|
|
|
|
void nsim_udp_tunnels_info_destroy(struct net_device *dev)
|
|
{
|
|
+ struct netdevsim *ns = netdev_priv(dev);
|
|
+
|
|
+ debugfs_remove_recursive(ns->udp_ports.ddir);
|
|
kfree(dev->udp_tunnel_nic_info);
|
|
dev->udp_tunnel_nic_info = NULL;
|
|
}
|
|
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
|
|
index ae257fa43d87a3..46a7c9fb6300e3 100644
|
|
--- a/drivers/net/team/team.c
|
|
+++ b/drivers/net/team/team.c
|
|
@@ -1169,6 +1169,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
|
|
return -EBUSY;
|
|
}
|
|
|
|
+ if (netdev_has_upper_dev(port_dev, dev)) {
|
|
+ NL_SET_ERR_MSG(extack, "Device is already a lower device of the team interface");
|
|
+ netdev_err(dev, "Device %s is already a lower device of the team interface\n",
|
|
+ portname);
|
|
+ return -EBUSY;
|
|
+ }
|
|
+
|
|
if (port_dev->features & NETIF_F_VLAN_CHALLENGED &&
|
|
vlan_uses_dev(dev)) {
|
|
NL_SET_ERR_MSG(extack, "Device is VLAN challenged and team device has VLAN set up");
|
|
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
|
|
index 01a3b2417a5401..ddff6f19ff98eb 100644
|
|
--- a/drivers/net/usb/rtl8150.c
|
|
+++ b/drivers/net/usb/rtl8150.c
|
|
@@ -71,6 +71,14 @@
|
|
#define MSR_SPEED (1<<3)
|
|
#define MSR_LINK (1<<2)
|
|
|
|
+/* USB endpoints */
|
|
+enum rtl8150_usb_ep {
|
|
+ RTL8150_USB_EP_CONTROL = 0,
|
|
+ RTL8150_USB_EP_BULK_IN = 1,
|
|
+ RTL8150_USB_EP_BULK_OUT = 2,
|
|
+ RTL8150_USB_EP_INT_IN = 3,
|
|
+};
|
|
+
|
|
/* Interrupt pipe data */
|
|
#define INT_TSR 0x00
|
|
#define INT_RSR 0x01
|
|
@@ -867,6 +875,13 @@ static int rtl8150_probe(struct usb_interface *intf,
|
|
struct usb_device *udev = interface_to_usbdev(intf);
|
|
rtl8150_t *dev;
|
|
struct net_device *netdev;
|
|
+ static const u8 bulk_ep_addr[] = {
|
|
+ RTL8150_USB_EP_BULK_IN | USB_DIR_IN,
|
|
+ RTL8150_USB_EP_BULK_OUT | USB_DIR_OUT,
|
|
+ 0};
|
|
+ static const u8 int_ep_addr[] = {
|
|
+ RTL8150_USB_EP_INT_IN | USB_DIR_IN,
|
|
+ 0};
|
|
|
|
netdev = alloc_etherdev(sizeof(rtl8150_t));
|
|
if (!netdev)
|
|
@@ -880,6 +895,13 @@ static int rtl8150_probe(struct usb_interface *intf,
|
|
return -ENOMEM;
|
|
}
|
|
|
|
+ /* Verify that all required endpoints are present */
|
|
+ if (!usb_check_bulk_endpoints(intf, bulk_ep_addr) ||
|
|
+ !usb_check_int_endpoints(intf, int_ep_addr)) {
|
|
+ dev_err(&intf->dev, "couldn't find required endpoints\n");
|
|
+ goto out;
|
|
+ }
|
|
+
|
|
tasklet_setup(&dev->tl, rx_fixup);
|
|
spin_lock_init(&dev->rx_pool_lock);
|
|
|
|
diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c
|
|
index d2023e7131bd4f..6e6e9f05509ab0 100644
|
|
--- a/drivers/net/vxlan/vxlan_vnifilter.c
|
|
+++ b/drivers/net/vxlan/vxlan_vnifilter.c
|
|
@@ -411,6 +411,11 @@ static int vxlan_vnifilter_dump(struct sk_buff *skb, struct netlink_callback *cb
|
|
struct tunnel_msg *tmsg;
|
|
struct net_device *dev;
|
|
|
|
+ if (cb->nlh->nlmsg_len < nlmsg_msg_size(sizeof(struct tunnel_msg))) {
|
|
+ NL_SET_ERR_MSG(cb->extack, "Invalid msg length");
|
|
+ return -EINVAL;
|
|
+ }
|
|
+
|
|
tmsg = nlmsg_data(cb->nlh);
|
|
|
|
if (tmsg->flags & ~TUNNEL_MSG_VALID_USER_FLAGS) {
|
|
diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
|
index fb426195a3f016..4c70366ac56eb0 100644
|
|
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
|
@@ -3811,6 +3811,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,
|
|
ath11k_hal_rx_msdu_link_info_get(link_desc_va, &num_msdus, msdu_cookies,
|
|
&rbm);
|
|
if (rbm != HAL_RX_BUF_RBM_WBM_IDLE_DESC_LIST &&
|
|
+ rbm != HAL_RX_BUF_RBM_SW1_BM &&
|
|
rbm != HAL_RX_BUF_RBM_SW3_BM) {
|
|
ab->soc_stats.invalid_rbm++;
|
|
ath11k_warn(ab, "invalid return buffer manager %d\n", rbm);
|
|
diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.c b/drivers/net/wireless/ath/ath11k/hal_rx.c
|
|
index 363adac84a8700..2bc95026335e31 100644
|
|
--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
|
|
@@ -372,7 +372,8 @@ int ath11k_hal_wbm_desc_parse_err(struct ath11k_base *ab, void *desc,
|
|
|
|
ret_buf_mgr = FIELD_GET(BUFFER_ADDR_INFO1_RET_BUF_MGR,
|
|
wbm_desc->buf_addr_info.info1);
|
|
- if (ret_buf_mgr != HAL_RX_BUF_RBM_SW3_BM) {
|
|
+ if (ret_buf_mgr != HAL_RX_BUF_RBM_SW1_BM &&
|
|
+ ret_buf_mgr != HAL_RX_BUF_RBM_SW3_BM) {
|
|
ab->soc_stats.invalid_rbm++;
|
|
return -EINVAL;
|
|
}
|
|
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
|
|
index 713899735ccc5e..e1db6e69d22076 100644
|
|
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
|
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
|
@@ -5823,9 +5823,9 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif,
|
|
arg.mode = ath12k_phymodes[chandef->chan->band][chandef->width];
|
|
|
|
arg.min_power = 0;
|
|
- arg.max_power = chandef->chan->max_power * 2;
|
|
- arg.max_reg_power = chandef->chan->max_reg_power * 2;
|
|
- arg.max_antenna_gain = chandef->chan->max_antenna_gain * 2;
|
|
+ arg.max_power = chandef->chan->max_power;
|
|
+ arg.max_reg_power = chandef->chan->max_reg_power;
|
|
+ arg.max_antenna_gain = chandef->chan->max_antenna_gain;
|
|
|
|
arg.pref_tx_streams = ar->num_tx_chains;
|
|
arg.pref_rx_streams = ar->num_rx_chains;
|
|
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
|
|
index 2bd1163177f08f..9bbbc86fd2d93d 100644
|
|
--- a/drivers/net/wireless/ath/wcn36xx/main.c
|
|
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
|
|
@@ -1586,7 +1586,10 @@ static int wcn36xx_probe(struct platform_device *pdev)
|
|
}
|
|
|
|
n_channels = wcn_band_2ghz.n_channels + wcn_band_5ghz.n_channels;
|
|
- wcn->chan_survey = devm_kmalloc(wcn->dev, n_channels, GFP_KERNEL);
|
|
+ wcn->chan_survey = devm_kcalloc(wcn->dev,
|
|
+ n_channels,
|
|
+ sizeof(struct wcn36xx_chan_survey),
|
|
+ GFP_KERNEL);
|
|
if (!wcn->chan_survey) {
|
|
ret = -ENOMEM;
|
|
goto out_wq;
|
|
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h
|
|
index 31e080e4da6697..ab3d6cfcb02bde 100644
|
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h
|
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h
|
|
@@ -6,6 +6,8 @@
|
|
#ifndef _fwil_h_
|
|
#define _fwil_h_
|
|
|
|
+#include "debug.h"
|
|
+
|
|
/*******************************************************************************
|
|
* Dongle command codes that are interpreted by firmware
|
|
******************************************************************************/
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/init.c b/drivers/net/wireless/mediatek/mt76/mt7615/init.c
|
|
index f22a1aa8850521..129350186d5d5e 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7615/init.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/init.c
|
|
@@ -325,7 +325,7 @@ void mt7615_init_work(struct mt7615_dev *dev)
|
|
mt7615_mcu_set_eeprom(dev);
|
|
mt7615_mac_init(dev);
|
|
mt7615_phy_init(dev);
|
|
- mt7615_mcu_del_wtbl_all(dev);
|
|
+ mt76_connac_mcu_del_wtbl_all(&dev->mt76);
|
|
mt7615_check_offload_capability(dev);
|
|
}
|
|
EXPORT_SYMBOL_GPL(mt7615_init_work);
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
|
|
index 955974a82180fd..e92040616a1f35 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
|
|
@@ -1876,16 +1876,6 @@ int mt7615_mcu_set_dbdc(struct mt7615_dev *dev)
|
|
sizeof(req), true);
|
|
}
|
|
|
|
-int mt7615_mcu_del_wtbl_all(struct mt7615_dev *dev)
|
|
-{
|
|
- struct wtbl_req_hdr req = {
|
|
- .operation = WTBL_RESET_ALL,
|
|
- };
|
|
-
|
|
- return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(WTBL_UPDATE),
|
|
- &req, sizeof(req), true);
|
|
-}
|
|
-
|
|
int mt7615_mcu_set_fcc5_lpn(struct mt7615_dev *dev, int val)
|
|
{
|
|
struct {
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
|
|
index a20322aae96725..fa83b255e180c3 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
|
|
@@ -399,7 +399,6 @@ void mt7615_mac_set_rates(struct mt7615_phy *phy, struct mt7615_sta *sta,
|
|
struct ieee80211_tx_rate *rates);
|
|
void mt7615_pm_wake_work(struct work_struct *work);
|
|
void mt7615_pm_power_save_work(struct work_struct *work);
|
|
-int mt7615_mcu_del_wtbl_all(struct mt7615_dev *dev);
|
|
int mt7615_mcu_set_chan_info(struct mt7615_phy *phy, int cmd);
|
|
int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue,
|
|
const struct ieee80211_tx_queue_params *params);
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
|
|
index 998cfd73764a9c..7420d91bef0de7 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
|
|
@@ -2926,6 +2926,17 @@ int mt76_connac_mcu_restart(struct mt76_dev *dev)
|
|
}
|
|
EXPORT_SYMBOL_GPL(mt76_connac_mcu_restart);
|
|
|
|
+int mt76_connac_mcu_del_wtbl_all(struct mt76_dev *dev)
|
|
+{
|
|
+ struct wtbl_req_hdr req = {
|
|
+ .operation = WTBL_RESET_ALL,
|
|
+ };
|
|
+
|
|
+ return mt76_mcu_send_msg(dev, MCU_EXT_CMD(WTBL_UPDATE),
|
|
+ &req, sizeof(req), true);
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(mt76_connac_mcu_del_wtbl_all);
|
|
+
|
|
int mt76_connac_mcu_rdd_cmd(struct mt76_dev *dev, int cmd, u8 index,
|
|
u8 rx_sel, u8 val)
|
|
{
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
|
|
index 4543e5bf0482d2..27391ee3564a11 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
|
|
@@ -1914,6 +1914,7 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb,
|
|
void *sta_wtbl, void *wtbl_tlv);
|
|
int mt76_connac_mcu_set_pm(struct mt76_dev *dev, int band, int enter);
|
|
int mt76_connac_mcu_restart(struct mt76_dev *dev);
|
|
+int mt76_connac_mcu_del_wtbl_all(struct mt76_dev *dev);
|
|
int mt76_connac_mcu_rdd_cmd(struct mt76_dev *dev, int cmd, u8 index,
|
|
u8 rx_sel, u8 val);
|
|
int mt76_connac_mcu_sta_wed_update(struct mt76_dev *dev, struct sk_buff *skb);
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
|
|
index 5ff260319282c6..28f84220d50f02 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
|
|
@@ -82,7 +82,7 @@ static ssize_t mt7915_thermal_temp_store(struct device *dev,
|
|
return ret;
|
|
|
|
mutex_lock(&phy->dev->mt76.mutex);
|
|
- val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 60, 130);
|
|
+ val = DIV_ROUND_CLOSEST(clamp_val(val, 60 * 1000, 130 * 1000), 1000);
|
|
|
|
if ((i - 1 == MT7915_CRIT_TEMP_IDX &&
|
|
val > phy->throttle_temp[MT7915_MAX_TEMP_IDX]) ||
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
|
|
index 38d27f87217336..92d7dc8e3cc55e 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
|
|
@@ -1383,6 +1383,8 @@ mt7915_mac_restart(struct mt7915_dev *dev)
|
|
if (dev_is_pci(mdev->dev)) {
|
|
mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff);
|
|
if (dev->hif2) {
|
|
+ mt76_wr(dev, MT_PCIE_RECOG_ID,
|
|
+ dev->hif2->index | MT_PCIE_RECOG_ID_SEM);
|
|
if (is_mt7915(mdev))
|
|
mt76_wr(dev, MT_PCIE1_MAC_INT_ENABLE, 0xff);
|
|
else
|
|
@@ -1437,9 +1439,11 @@ static void
|
|
mt7915_mac_full_reset(struct mt7915_dev *dev)
|
|
{
|
|
struct mt76_phy *ext_phy;
|
|
+ struct mt7915_phy *phy2;
|
|
int i;
|
|
|
|
ext_phy = dev->mt76.phys[MT_BAND1];
|
|
+ phy2 = ext_phy ? ext_phy->priv : NULL;
|
|
|
|
dev->recovery.hw_full_reset = true;
|
|
|
|
@@ -1457,26 +1461,30 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
|
|
if (!mt7915_mac_restart(dev))
|
|
break;
|
|
}
|
|
- mutex_unlock(&dev->mt76.mutex);
|
|
|
|
if (i == 10)
|
|
dev_err(dev->mt76.dev, "chip full reset failed\n");
|
|
|
|
- ieee80211_restart_hw(mt76_hw(dev));
|
|
- if (ext_phy)
|
|
- ieee80211_restart_hw(ext_phy->hw);
|
|
+ spin_lock_bh(&dev->mt76.sta_poll_lock);
|
|
+ while (!list_empty(&dev->mt76.sta_poll_list))
|
|
+ list_del_init(dev->mt76.sta_poll_list.next);
|
|
+ spin_unlock_bh(&dev->mt76.sta_poll_lock);
|
|
|
|
- ieee80211_wake_queues(mt76_hw(dev));
|
|
- if (ext_phy)
|
|
- ieee80211_wake_queues(ext_phy->hw);
|
|
+ memset(dev->mt76.wcid_mask, 0, sizeof(dev->mt76.wcid_mask));
|
|
+ dev->mt76.vif_mask = 0;
|
|
+ dev->phy.omac_mask = 0;
|
|
+ if (phy2)
|
|
+ phy2->omac_mask = 0;
|
|
|
|
+ i = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
|
|
+ dev->mt76.global_wcid.idx = i;
|
|
dev->recovery.hw_full_reset = false;
|
|
- ieee80211_queue_delayed_work(mt76_hw(dev), &dev->mphy.mac_work,
|
|
- MT7915_WATCHDOG_TIME);
|
|
+
|
|
+ mutex_unlock(&dev->mt76.mutex);
|
|
+
|
|
+ ieee80211_restart_hw(mt76_hw(dev));
|
|
if (ext_phy)
|
|
- ieee80211_queue_delayed_work(ext_phy->hw,
|
|
- &ext_phy->mac_work,
|
|
- MT7915_WATCHDOG_TIME);
|
|
+ ieee80211_restart_hw(ext_phy->hw);
|
|
}
|
|
|
|
/* system error recovery */
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
|
|
index 4fd5fd555191a4..c312a0fa199aee 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
|
|
@@ -614,8 +614,9 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
|
|
if (changed & BSS_CHANGED_ASSOC)
|
|
set_bss_info = vif->cfg.assoc;
|
|
if (changed & BSS_CHANGED_BEACON_ENABLED &&
|
|
+ info->enable_beacon &&
|
|
vif->type != NL80211_IFTYPE_AP)
|
|
- set_bss_info = set_sta = info->enable_beacon;
|
|
+ set_bss_info = set_sta = 1;
|
|
|
|
if (set_bss_info == 1)
|
|
mt7915_mcu_add_bss_info(phy, vif, true);
|
|
@@ -1649,6 +1650,17 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
|
|
}
|
|
#endif
|
|
|
|
+static void
|
|
+mt7915_reconfig_complete(struct ieee80211_hw *hw,
|
|
+ enum ieee80211_reconfig_type reconfig_type)
|
|
+{
|
|
+ struct mt7915_phy *phy = mt7915_hw_phy(hw);
|
|
+
|
|
+ ieee80211_wake_queues(hw);
|
|
+ ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work,
|
|
+ MT7915_WATCHDOG_TIME);
|
|
+}
|
|
+
|
|
const struct ieee80211_ops mt7915_ops = {
|
|
.tx = mt7915_tx,
|
|
.start = mt7915_start,
|
|
@@ -1703,4 +1715,5 @@ const struct ieee80211_ops mt7915_ops = {
|
|
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
|
|
.net_fill_forward_path = mt7915_net_fill_forward_path,
|
|
#endif
|
|
+ .reconfig_complete = mt7915_reconfig_complete,
|
|
};
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
|
|
index 5fba103bfd65d5..f0226db2e57c7a 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
|
|
@@ -2351,6 +2351,8 @@ int mt7915_mcu_init_firmware(struct mt7915_dev *dev)
|
|
if (ret)
|
|
return ret;
|
|
|
|
+ mt76_connac_mcu_del_wtbl_all(&dev->mt76);
|
|
+
|
|
if ((mtk_wed_device_active(&dev->mt76.mmio.wed) &&
|
|
is_mt7915(&dev->mt76)) ||
|
|
!mtk_wed_get_rx_capa(&dev->mt76.mmio.wed))
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
|
|
index a306a42777d789..7db436d908a39b 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
|
|
@@ -484,7 +484,7 @@ static u32 __mt7915_reg_addr(struct mt7915_dev *dev, u32 addr)
|
|
continue;
|
|
|
|
ofs = addr - dev->reg.map[i].phys;
|
|
- if (ofs > dev->reg.map[i].size)
|
|
+ if (ofs >= dev->reg.map[i].size)
|
|
continue;
|
|
|
|
return dev->reg.map[i].maps + ofs;
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h b/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h
|
|
index e192211d4b23ee..14d4bbeae9d63f 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h
|
|
@@ -191,6 +191,7 @@ struct mt7915_hif {
|
|
struct device *dev;
|
|
void __iomem *regs;
|
|
int irq;
|
|
+ u32 index;
|
|
};
|
|
|
|
struct mt7915_phy {
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
|
|
index 39132894e8ea29..07b0a5766eab7d 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
|
|
@@ -42,6 +42,7 @@ static struct mt7915_hif *mt7915_pci_get_hif2(u32 idx)
|
|
continue;
|
|
|
|
get_device(hif->dev);
|
|
+ hif->index = idx;
|
|
goto out;
|
|
}
|
|
hif = NULL;
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
|
|
index 6dec54431312ad..31ef58e2a3d2a3 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
|
|
@@ -519,7 +519,13 @@ static int mt7921_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
|
} else {
|
|
if (idx == *wcid_keyidx)
|
|
*wcid_keyidx = -1;
|
|
- goto out;
|
|
+
|
|
+ /* For security issue we don't trigger the key deletion when
|
|
+ * reassociating. But we should trigger the deletion process
|
|
+ * to avoid using incorrect cipher after disconnection,
|
|
+ */
|
|
+ if (vif->type != NL80211_IFTYPE_STATION || vif->cfg.assoc)
|
|
+ goto out;
|
|
}
|
|
|
|
mt76_wcid_key_setup(&dev->mt76, wcid, key);
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/init.c b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
|
|
index aee531cab46f64..0a701dcb8a92c5 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
|
|
@@ -619,6 +619,9 @@ mt7996_init_he_caps(struct mt7996_phy *phy, enum nl80211_band band,
|
|
he_cap_elem->phy_cap_info[2] = IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ |
|
|
IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ;
|
|
|
|
+ he_cap_elem->phy_cap_info[7] =
|
|
+ IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI;
|
|
+
|
|
switch (iftype) {
|
|
case NL80211_IFTYPE_AP:
|
|
he_cap_elem->mac_cap_info[0] |= IEEE80211_HE_MAC_CAP0_TWT_RES;
|
|
@@ -658,8 +661,7 @@ mt7996_init_he_caps(struct mt7996_phy *phy, enum nl80211_band band,
|
|
IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE |
|
|
IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT;
|
|
he_cap_elem->phy_cap_info[7] |=
|
|
- IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP |
|
|
- IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI;
|
|
+ IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP;
|
|
he_cap_elem->phy_cap_info[8] |=
|
|
IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G |
|
|
IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU |
|
|
@@ -729,7 +731,9 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
|
|
|
|
eht_cap_elem->mac_cap_info[0] =
|
|
IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS |
|
|
- IEEE80211_EHT_MAC_CAP0_OM_CONTROL;
|
|
+ IEEE80211_EHT_MAC_CAP0_OM_CONTROL |
|
|
+ u8_encode_bits(IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454,
|
|
+ IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK);
|
|
|
|
eht_cap_elem->phy_cap_info[0] =
|
|
IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI |
|
|
@@ -771,21 +775,20 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
|
|
IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK;
|
|
|
|
eht_cap_elem->phy_cap_info[4] =
|
|
+ IEEE80211_EHT_PHY_CAP4_EHT_MU_PPDU_4_EHT_LTF_08_GI |
|
|
u8_encode_bits(min_t(int, sts - 1, 2),
|
|
IEEE80211_EHT_PHY_CAP4_MAX_NC_MASK);
|
|
|
|
eht_cap_elem->phy_cap_info[5] =
|
|
u8_encode_bits(IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_16US,
|
|
IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_MASK) |
|
|
- u8_encode_bits(u8_get_bits(0x11, GENMASK(1, 0)),
|
|
+ u8_encode_bits(u8_get_bits(1, GENMASK(1, 0)),
|
|
IEEE80211_EHT_PHY_CAP5_MAX_NUM_SUPP_EHT_LTF_MASK);
|
|
|
|
val = width == NL80211_CHAN_WIDTH_320 ? 0xf :
|
|
width == NL80211_CHAN_WIDTH_160 ? 0x7 :
|
|
width == NL80211_CHAN_WIDTH_80 ? 0x3 : 0x1;
|
|
eht_cap_elem->phy_cap_info[6] =
|
|
- u8_encode_bits(u8_get_bits(0x11, GENMASK(4, 2)),
|
|
- IEEE80211_EHT_PHY_CAP6_MAX_NUM_SUPP_EHT_LTF_MASK) |
|
|
u8_encode_bits(val, IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK);
|
|
|
|
val = u8_encode_bits(nss, IEEE80211_EHT_MCS_NSS_RX) |
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
|
|
index 0e69f0a508616b..c559212ea86a73 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
|
|
@@ -474,8 +474,7 @@ static void mt7996_configure_filter(struct ieee80211_hw *hw,
|
|
|
|
MT76_FILTER(CONTROL, MT_WF_RFCR_DROP_CTS |
|
|
MT_WF_RFCR_DROP_RTS |
|
|
- MT_WF_RFCR_DROP_CTL_RSV |
|
|
- MT_WF_RFCR_DROP_NDPA);
|
|
+ MT_WF_RFCR_DROP_CTL_RSV);
|
|
|
|
*total_flags = flags;
|
|
mt76_wr(dev, MT_WF_RFCR(phy->mt76->band_idx), phy->rxfilter);
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
|
|
index 302171e1035977..65a5f24e53136b 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
|
|
@@ -1723,7 +1723,7 @@ mt7996_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7996_dev *dev,
|
|
cap |= STA_CAP_VHT_TX_STBC;
|
|
if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
|
|
cap |= STA_CAP_VHT_RX_STBC;
|
|
- if (vif->bss_conf.vht_ldpc &&
|
|
+ if ((vif->type != NL80211_IFTYPE_AP || vif->bss_conf.vht_ldpc) &&
|
|
(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
|
|
cap |= STA_CAP_VHT_LDPC;
|
|
|
|
@@ -3189,6 +3189,13 @@ int mt7996_mcu_get_chip_config(struct mt7996_dev *dev, u32 *cap)
|
|
|
|
int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch)
|
|
{
|
|
+ enum {
|
|
+ IDX_TX_TIME,
|
|
+ IDX_RX_TIME,
|
|
+ IDX_OBSS_AIRTIME,
|
|
+ IDX_NON_WIFI_TIME,
|
|
+ IDX_NUM
|
|
+ };
|
|
struct {
|
|
struct {
|
|
u8 band;
|
|
@@ -3198,16 +3205,15 @@ int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch)
|
|
__le16 tag;
|
|
__le16 len;
|
|
__le32 offs;
|
|
- } data[4];
|
|
+ } data[IDX_NUM];
|
|
} __packed req = {
|
|
.hdr.band = phy->mt76->band_idx,
|
|
};
|
|
- /* strict order */
|
|
static const u32 offs[] = {
|
|
- UNI_MIB_TX_TIME,
|
|
- UNI_MIB_RX_TIME,
|
|
- UNI_MIB_OBSS_AIRTIME,
|
|
- UNI_MIB_NON_WIFI_TIME,
|
|
+ [IDX_TX_TIME] = UNI_MIB_TX_TIME,
|
|
+ [IDX_RX_TIME] = UNI_MIB_RX_TIME,
|
|
+ [IDX_OBSS_AIRTIME] = UNI_MIB_OBSS_AIRTIME,
|
|
+ [IDX_NON_WIFI_TIME] = UNI_MIB_NON_WIFI_TIME,
|
|
};
|
|
struct mt76_channel_state *state = phy->mt76->chan_state;
|
|
struct mt76_channel_state *state_ts = &phy->state_ts;
|
|
@@ -3216,7 +3222,7 @@ int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch)
|
|
struct sk_buff *skb;
|
|
int i, ret;
|
|
|
|
- for (i = 0; i < 4; i++) {
|
|
+ for (i = 0; i < IDX_NUM; i++) {
|
|
req.data[i].tag = cpu_to_le16(UNI_CMD_MIB_DATA);
|
|
req.data[i].len = cpu_to_le16(sizeof(req.data[i]));
|
|
req.data[i].offs = cpu_to_le32(offs[i]);
|
|
@@ -3235,17 +3241,24 @@ int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch)
|
|
goto out;
|
|
|
|
#define __res_u64(s) le64_to_cpu(res[s].data)
|
|
- state->cc_tx += __res_u64(1) - state_ts->cc_tx;
|
|
- state->cc_bss_rx += __res_u64(2) - state_ts->cc_bss_rx;
|
|
- state->cc_rx += __res_u64(2) + __res_u64(3) - state_ts->cc_rx;
|
|
- state->cc_busy += __res_u64(0) + __res_u64(1) + __res_u64(2) + __res_u64(3) -
|
|
+ state->cc_tx += __res_u64(IDX_TX_TIME) - state_ts->cc_tx;
|
|
+ state->cc_bss_rx += __res_u64(IDX_RX_TIME) - state_ts->cc_bss_rx;
|
|
+ state->cc_rx += __res_u64(IDX_RX_TIME) +
|
|
+ __res_u64(IDX_OBSS_AIRTIME) -
|
|
+ state_ts->cc_rx;
|
|
+ state->cc_busy += __res_u64(IDX_TX_TIME) +
|
|
+ __res_u64(IDX_RX_TIME) +
|
|
+ __res_u64(IDX_OBSS_AIRTIME) +
|
|
+ __res_u64(IDX_NON_WIFI_TIME) -
|
|
state_ts->cc_busy;
|
|
-
|
|
out:
|
|
- state_ts->cc_tx = __res_u64(1);
|
|
- state_ts->cc_bss_rx = __res_u64(2);
|
|
- state_ts->cc_rx = __res_u64(2) + __res_u64(3);
|
|
- state_ts->cc_busy = __res_u64(0) + __res_u64(1) + __res_u64(2) + __res_u64(3);
|
|
+ state_ts->cc_tx = __res_u64(IDX_TX_TIME);
|
|
+ state_ts->cc_bss_rx = __res_u64(IDX_RX_TIME);
|
|
+ state_ts->cc_rx = __res_u64(IDX_RX_TIME) + __res_u64(IDX_OBSS_AIRTIME);
|
|
+ state_ts->cc_busy = __res_u64(IDX_TX_TIME) +
|
|
+ __res_u64(IDX_RX_TIME) +
|
|
+ __res_u64(IDX_OBSS_AIRTIME) +
|
|
+ __res_u64(IDX_NON_WIFI_TIME);
|
|
#undef __res_u64
|
|
|
|
dev_kfree_skb(skb);
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
|
|
index e75becadc2e54d..f0fa0f513be907 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
|
|
@@ -119,7 +119,7 @@ static u32 __mt7996_reg_addr(struct mt7996_dev *dev, u32 addr)
|
|
continue;
|
|
|
|
ofs = addr - dev->reg.map[i].phys;
|
|
- if (ofs > dev->reg.map[i].size)
|
|
+ if (ofs >= dev->reg.map[i].size)
|
|
continue;
|
|
|
|
return dev->reg.map[i].mapped + ofs;
|
|
diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
|
|
index 1584665fe3cb68..a8f26583b51b22 100644
|
|
--- a/drivers/net/wireless/mediatek/mt76/usb.c
|
|
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
|
|
@@ -33,9 +33,9 @@ int __mt76u_vendor_request(struct mt76_dev *dev, u8 req, u8 req_type,
|
|
|
|
ret = usb_control_msg(udev, pipe, req, req_type, val,
|
|
offset, buf, len, MT_VEND_REQ_TOUT_MS);
|
|
- if (ret == -ENODEV)
|
|
+ if (ret == -ENODEV || ret == -EPROTO)
|
|
set_bit(MT76_REMOVED, &dev->phy.state);
|
|
- if (ret >= 0 || ret == -ENODEV)
|
|
+ if (ret >= 0 || ret == -ENODEV || ret == -EPROTO)
|
|
return ret;
|
|
usleep_range(5000, 10000);
|
|
}
|
|
diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
|
|
index 807a53a97325bf..c981739f707730 100644
|
|
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
|
|
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
|
|
@@ -575,9 +575,15 @@ static void rtl_free_entries_from_ack_queue(struct ieee80211_hw *hw,
|
|
|
|
void rtl_deinit_core(struct ieee80211_hw *hw)
|
|
{
|
|
+ struct rtl_priv *rtlpriv = rtl_priv(hw);
|
|
+
|
|
rtl_c2hcmd_launcher(hw, 0);
|
|
rtl_free_entries_from_scan_list(hw);
|
|
rtl_free_entries_from_ack_queue(hw, false);
|
|
+ if (rtlpriv->works.rtl_wq) {
|
|
+ destroy_workqueue(rtlpriv->works.rtl_wq);
|
|
+ rtlpriv->works.rtl_wq = NULL;
|
|
+ }
|
|
}
|
|
EXPORT_SYMBOL_GPL(rtl_deinit_core);
|
|
|
|
@@ -2710,9 +2716,6 @@ MODULE_AUTHOR("Larry Finger <Larry.FInger@lwfinger.net>");
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_DESCRIPTION("Realtek 802.11n PCI wireless core");
|
|
|
|
-struct rtl_global_var rtl_global_var = {};
|
|
-EXPORT_SYMBOL_GPL(rtl_global_var);
|
|
-
|
|
static int __init rtl_core_module_init(void)
|
|
{
|
|
BUILD_BUG_ON(TX_PWR_BY_RATE_NUM_RATE < TX_PWR_BY_RATE_NUM_SECTION);
|
|
@@ -2726,10 +2729,6 @@ static int __init rtl_core_module_init(void)
|
|
/* add debugfs */
|
|
rtl_debugfs_add_topdir();
|
|
|
|
- /* init some global vars */
|
|
- INIT_LIST_HEAD(&rtl_global_var.glb_priv_list);
|
|
- spin_lock_init(&rtl_global_var.glb_list_lock);
|
|
-
|
|
return 0;
|
|
}
|
|
|
|
diff --git a/drivers/net/wireless/realtek/rtlwifi/base.h b/drivers/net/wireless/realtek/rtlwifi/base.h
|
|
index f081a9a90563f5..f3a6a43a42eca8 100644
|
|
--- a/drivers/net/wireless/realtek/rtlwifi/base.h
|
|
+++ b/drivers/net/wireless/realtek/rtlwifi/base.h
|
|
@@ -124,7 +124,6 @@ int rtl_send_smps_action(struct ieee80211_hw *hw,
|
|
u8 *rtl_find_ie(u8 *data, unsigned int len, u8 ie);
|
|
void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len);
|
|
u8 rtl_tid_to_ac(u8 tid);
|
|
-extern struct rtl_global_var rtl_global_var;
|
|
void rtl_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation);
|
|
|
|
#endif
|
|
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
|
|
index b118df035243c5..3abd0c4c954bc1 100644
|
|
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
|
|
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
|
|
@@ -295,46 +295,6 @@ static bool rtl_pci_get_amd_l1_patch(struct ieee80211_hw *hw)
|
|
return status;
|
|
}
|
|
|
|
-static bool rtl_pci_check_buddy_priv(struct ieee80211_hw *hw,
|
|
- struct rtl_priv **buddy_priv)
|
|
-{
|
|
- struct rtl_priv *rtlpriv = rtl_priv(hw);
|
|
- struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
|
|
- struct rtl_priv *tpriv = NULL, *iter;
|
|
- struct rtl_pci_priv *tpcipriv = NULL;
|
|
-
|
|
- if (!list_empty(&rtlpriv->glb_var->glb_priv_list)) {
|
|
- list_for_each_entry(iter, &rtlpriv->glb_var->glb_priv_list,
|
|
- list) {
|
|
- tpcipriv = (struct rtl_pci_priv *)iter->priv;
|
|
- rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD,
|
|
- "pcipriv->ndis_adapter.funcnumber %x\n",
|
|
- pcipriv->ndis_adapter.funcnumber);
|
|
- rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD,
|
|
- "tpcipriv->ndis_adapter.funcnumber %x\n",
|
|
- tpcipriv->ndis_adapter.funcnumber);
|
|
-
|
|
- if (pcipriv->ndis_adapter.busnumber ==
|
|
- tpcipriv->ndis_adapter.busnumber &&
|
|
- pcipriv->ndis_adapter.devnumber ==
|
|
- tpcipriv->ndis_adapter.devnumber &&
|
|
- pcipriv->ndis_adapter.funcnumber !=
|
|
- tpcipriv->ndis_adapter.funcnumber) {
|
|
- tpriv = iter;
|
|
- break;
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD,
|
|
- "find_buddy_priv %d\n", tpriv != NULL);
|
|
-
|
|
- if (tpriv)
|
|
- *buddy_priv = tpriv;
|
|
-
|
|
- return tpriv != NULL;
|
|
-}
|
|
-
|
|
static void rtl_pci_parse_configuration(struct pci_dev *pdev,
|
|
struct ieee80211_hw *hw)
|
|
{
|
|
@@ -1697,8 +1657,6 @@ static void rtl_pci_deinit(struct ieee80211_hw *hw)
|
|
synchronize_irq(rtlpci->pdev->irq);
|
|
tasklet_kill(&rtlpriv->works.irq_tasklet);
|
|
cancel_work_sync(&rtlpriv->works.lps_change_work);
|
|
-
|
|
- destroy_workqueue(rtlpriv->works.rtl_wq);
|
|
}
|
|
|
|
static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
|
|
@@ -2013,7 +1971,6 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
|
|
pcipriv->ndis_adapter.amd_l1_patch);
|
|
|
|
rtl_pci_parse_configuration(pdev, hw);
|
|
- list_add_tail(&rtlpriv->list, &rtlpriv->glb_var->glb_priv_list);
|
|
|
|
return true;
|
|
}
|
|
@@ -2160,7 +2117,6 @@ int rtl_pci_probe(struct pci_dev *pdev,
|
|
rtlpriv->rtlhal.interface = INTF_PCI;
|
|
rtlpriv->cfg = (struct rtl_hal_cfg *)(id->driver_data);
|
|
rtlpriv->intf_ops = &rtl_pci_ops;
|
|
- rtlpriv->glb_var = &rtl_global_var;
|
|
rtl_efuse_ops_init(hw);
|
|
|
|
/* MEM map */
|
|
@@ -2211,7 +2167,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
|
|
if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
|
|
pr_err("Can't init_sw_vars\n");
|
|
err = -ENODEV;
|
|
- goto fail3;
|
|
+ goto fail2;
|
|
}
|
|
rtl_init_sw_leds(hw);
|
|
|
|
@@ -2229,14 +2185,14 @@ int rtl_pci_probe(struct pci_dev *pdev,
|
|
err = rtl_pci_init(hw, pdev);
|
|
if (err) {
|
|
pr_err("Failed to init PCI\n");
|
|
- goto fail3;
|
|
+ goto fail4;
|
|
}
|
|
|
|
err = ieee80211_register_hw(hw);
|
|
if (err) {
|
|
pr_err("Can't register mac80211 hw.\n");
|
|
err = -ENODEV;
|
|
- goto fail3;
|
|
+ goto fail5;
|
|
}
|
|
rtlpriv->mac80211.mac80211_registered = 1;
|
|
|
|
@@ -2259,16 +2215,19 @@ int rtl_pci_probe(struct pci_dev *pdev,
|
|
set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
|
|
return 0;
|
|
|
|
-fail3:
|
|
- pci_set_drvdata(pdev, NULL);
|
|
+fail5:
|
|
+ rtl_pci_deinit(hw);
|
|
+fail4:
|
|
rtl_deinit_core(hw);
|
|
+fail3:
|
|
+ wait_for_completion(&rtlpriv->firmware_loading_complete);
|
|
+ rtlpriv->cfg->ops->deinit_sw_vars(hw);
|
|
|
|
fail2:
|
|
if (rtlpriv->io.pci_mem_start != 0)
|
|
pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start);
|
|
|
|
pci_release_regions(pdev);
|
|
- complete(&rtlpriv->firmware_loading_complete);
|
|
|
|
fail1:
|
|
if (hw)
|
|
@@ -2319,7 +2278,6 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
|
|
if (rtlpci->using_msi)
|
|
pci_disable_msi(rtlpci->pdev);
|
|
|
|
- list_del(&rtlpriv->list);
|
|
if (rtlpriv->io.pci_mem_start != 0) {
|
|
pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start);
|
|
pci_release_regions(pdev);
|
|
@@ -2379,7 +2337,6 @@ const struct rtl_intf_ops rtl_pci_ops = {
|
|
.read_efuse_byte = read_efuse_byte,
|
|
.adapter_start = rtl_pci_start,
|
|
.adapter_stop = rtl_pci_stop,
|
|
- .check_buddy_priv = rtl_pci_check_buddy_priv,
|
|
.adapter_tx = rtl_pci_tx,
|
|
.flush = rtl_pci_flush,
|
|
.reset_trx_ring = rtl_pci_reset_trx_ring,
|
|
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
|
|
index 30bce381c3bb70..d7dae4488f69bb 100644
|
|
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
|
|
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
|
|
@@ -67,22 +67,23 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context)
|
|
|
|
rtl_dbg(rtlpriv, COMP_ERR, DBG_LOUD,
|
|
"Firmware callback routine entered!\n");
|
|
- complete(&rtlpriv->firmware_loading_complete);
|
|
if (!firmware) {
|
|
pr_err("Firmware %s not available\n", fw_name);
|
|
rtlpriv->max_fw_size = 0;
|
|
- return;
|
|
+ goto exit;
|
|
}
|
|
if (firmware->size > rtlpriv->max_fw_size) {
|
|
pr_err("Firmware is too big!\n");
|
|
rtlpriv->max_fw_size = 0;
|
|
release_firmware(firmware);
|
|
- return;
|
|
+ goto exit;
|
|
}
|
|
pfirmware = (struct rt_firmware *)rtlpriv->rtlhal.pfirmware;
|
|
memcpy(pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size);
|
|
pfirmware->sz_fw_tmpbufferlen = firmware->size;
|
|
release_firmware(firmware);
|
|
+exit:
|
|
+ complete(&rtlpriv->firmware_loading_complete);
|
|
}
|
|
|
|
static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
|
|
diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
|
|
index 30bf2775a335bc..e2e1e568bdb36b 100644
|
|
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
|
|
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
|
|
@@ -660,11 +660,6 @@ static void _rtl_usb_cleanup_rx(struct ieee80211_hw *hw)
|
|
tasklet_kill(&rtlusb->rx_work_tasklet);
|
|
cancel_work_sync(&rtlpriv->works.lps_change_work);
|
|
|
|
- if (rtlpriv->works.rtl_wq) {
|
|
- destroy_workqueue(rtlpriv->works.rtl_wq);
|
|
- rtlpriv->works.rtl_wq = NULL;
|
|
- }
|
|
-
|
|
skb_queue_purge(&rtlusb->rx_queue);
|
|
|
|
while ((urb = usb_get_from_anchor(&rtlusb->rx_cleanup_urbs))) {
|
|
@@ -1054,19 +1049,22 @@ int rtl_usb_probe(struct usb_interface *intf,
|
|
err = ieee80211_register_hw(hw);
|
|
if (err) {
|
|
pr_err("Can't register mac80211 hw.\n");
|
|
- goto error_out;
|
|
+ goto error_init_vars;
|
|
}
|
|
rtlpriv->mac80211.mac80211_registered = 1;
|
|
|
|
set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
|
|
return 0;
|
|
|
|
+error_init_vars:
|
|
+ wait_for_completion(&rtlpriv->firmware_loading_complete);
|
|
+ rtlpriv->cfg->ops->deinit_sw_vars(hw);
|
|
error_out:
|
|
+ rtl_usb_deinit(hw);
|
|
rtl_deinit_core(hw);
|
|
error_out2:
|
|
_rtl_usb_io_handler_release(hw);
|
|
usb_put_dev(udev);
|
|
- complete(&rtlpriv->firmware_loading_complete);
|
|
kfree(rtlpriv->usb_data);
|
|
ieee80211_free_hw(hw);
|
|
return -ENODEV;
|
|
diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h
|
|
index 8cbf3fb3885397..2106d7763badae 100644
|
|
--- a/drivers/net/wireless/realtek/rtlwifi/wifi.h
|
|
+++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h
|
|
@@ -2321,8 +2321,6 @@ struct rtl_intf_ops {
|
|
void (*read_efuse_byte)(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf);
|
|
int (*adapter_start)(struct ieee80211_hw *hw);
|
|
void (*adapter_stop)(struct ieee80211_hw *hw);
|
|
- bool (*check_buddy_priv)(struct ieee80211_hw *hw,
|
|
- struct rtl_priv **buddy_priv);
|
|
|
|
int (*adapter_tx)(struct ieee80211_hw *hw,
|
|
struct ieee80211_sta *sta,
|
|
@@ -2566,14 +2564,6 @@ struct dig_t {
|
|
u32 rssi_max;
|
|
};
|
|
|
|
-struct rtl_global_var {
|
|
- /* from this list we can get
|
|
- * other adapter's rtl_priv
|
|
- */
|
|
- struct list_head glb_priv_list;
|
|
- spinlock_t glb_list_lock;
|
|
-};
|
|
-
|
|
#define IN_4WAY_TIMEOUT_TIME (30 * MSEC_PER_SEC) /* 30 seconds */
|
|
|
|
struct rtl_btc_info {
|
|
@@ -2719,9 +2709,7 @@ struct rtl_scan_list {
|
|
struct rtl_priv {
|
|
struct ieee80211_hw *hw;
|
|
struct completion firmware_loading_complete;
|
|
- struct list_head list;
|
|
struct rtl_priv *buddy_priv;
|
|
- struct rtl_global_var *glb_var;
|
|
struct rtl_dmsp_ctl dmsp_ctl;
|
|
struct rtl_locks locks;
|
|
struct rtl_works works;
|
|
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
|
|
index bf21611872a3c1..9706240ddd416b 100644
|
|
--- a/drivers/net/wireless/ti/wlcore/main.c
|
|
+++ b/drivers/net/wireless/ti/wlcore/main.c
|
|
@@ -2533,24 +2533,24 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
|
|
if (test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags) ||
|
|
test_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags)) {
|
|
ret = -EBUSY;
|
|
- goto out;
|
|
+ goto out_unlock;
|
|
}
|
|
|
|
|
|
ret = wl12xx_init_vif_data(wl, vif);
|
|
if (ret < 0)
|
|
- goto out;
|
|
+ goto out_unlock;
|
|
|
|
wlvif->wl = wl;
|
|
role_type = wl12xx_get_role_type(wl, wlvif);
|
|
if (role_type == WL12XX_INVALID_ROLE_TYPE) {
|
|
ret = -EINVAL;
|
|
- goto out;
|
|
+ goto out_unlock;
|
|
}
|
|
|
|
ret = wlcore_allocate_hw_queue_base(wl, wlvif);
|
|
if (ret < 0)
|
|
- goto out;
|
|
+ goto out_unlock;
|
|
|
|
/*
|
|
* TODO: after the nvs issue will be solved, move this block
|
|
@@ -2565,7 +2565,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
|
|
|
|
ret = wl12xx_init_fw(wl);
|
|
if (ret < 0)
|
|
- goto out;
|
|
+ goto out_unlock;
|
|
}
|
|
|
|
/*
|
|
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
|
|
index 4aad16390d4790..26e3f1896dc397 100644
|
|
--- a/drivers/nvme/host/core.c
|
|
+++ b/drivers/nvme/host/core.c
|
|
@@ -2853,7 +2853,7 @@ int nvme_get_log(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, u8 lsp, u8 csi,
|
|
static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi,
|
|
struct nvme_effects_log **log)
|
|
{
|
|
- struct nvme_effects_log *cel = xa_load(&ctrl->cels, csi);
|
|
+ struct nvme_effects_log *old, *cel = xa_load(&ctrl->cels, csi);
|
|
int ret;
|
|
|
|
if (cel)
|
|
@@ -2870,7 +2870,11 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi,
|
|
return ret;
|
|
}
|
|
|
|
- xa_store(&ctrl->cels, csi, cel, GFP_KERNEL);
|
|
+ old = xa_store(&ctrl->cels, csi, cel, GFP_KERNEL);
|
|
+ if (xa_is_err(old)) {
|
|
+ kfree(cel);
|
|
+ return xa_err(old);
|
|
+ }
|
|
out:
|
|
*log = cel;
|
|
return 0;
|
|
@@ -2941,6 +2945,25 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
|
|
return ret;
|
|
}
|
|
|
|
+static int nvme_init_effects_log(struct nvme_ctrl *ctrl,
|
|
+ u8 csi, struct nvme_effects_log **log)
|
|
+{
|
|
+ struct nvme_effects_log *effects, *old;
|
|
+
|
|
+ effects = kzalloc(sizeof(*effects), GFP_KERNEL);
|
|
+ if (!effects)
|
|
+ return -ENOMEM;
|
|
+
|
|
+ old = xa_store(&ctrl->cels, csi, effects, GFP_KERNEL);
|
|
+ if (xa_is_err(old)) {
|
|
+ kfree(effects);
|
|
+ return xa_err(old);
|
|
+ }
|
|
+
|
|
+ *log = effects;
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static void nvme_init_known_nvm_effects(struct nvme_ctrl *ctrl)
|
|
{
|
|
struct nvme_effects_log *log = ctrl->effects;
|
|
@@ -2987,10 +3010,9 @@ static int nvme_init_effects(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
|
|
}
|
|
|
|
if (!ctrl->effects) {
|
|
- ctrl->effects = kzalloc(sizeof(*ctrl->effects), GFP_KERNEL);
|
|
- if (!ctrl->effects)
|
|
- return -ENOMEM;
|
|
- xa_store(&ctrl->cels, NVME_CSI_NVM, ctrl->effects, GFP_KERNEL);
|
|
+ ret = nvme_init_effects_log(ctrl, NVME_CSI_NVM, &ctrl->effects);
|
|
+ if (ret < 0)
|
|
+ return ret;
|
|
}
|
|
|
|
nvme_init_known_nvm_effects(ctrl);
|
|
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
|
|
index 7ec94cfcbddb18..959f1808c240fa 100644
|
|
--- a/drivers/of/of_reserved_mem.c
|
|
+++ b/drivers/of/of_reserved_mem.c
|
|
@@ -50,7 +50,8 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
|
|
memblock_phys_free(base, size);
|
|
}
|
|
|
|
- kmemleak_ignore_phys(base);
|
|
+ if (!err)
|
|
+ kmemleak_ignore_phys(base);
|
|
|
|
return err;
|
|
}
|
|
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
|
|
index bceb27b1baa18a..218cb2e7f36055 100644
|
|
--- a/drivers/opp/core.c
|
|
+++ b/drivers/opp/core.c
|
|
@@ -101,11 +101,30 @@ struct opp_table *_find_opp_table(struct device *dev)
|
|
* representation in the OPP table and manage the clock configuration themselves
|
|
* in an platform specific way.
|
|
*/
|
|
-static bool assert_single_clk(struct opp_table *opp_table)
|
|
+static bool assert_single_clk(struct opp_table *opp_table,
|
|
+ unsigned int __always_unused index)
|
|
{
|
|
return !WARN_ON(opp_table->clk_count > 1);
|
|
}
|
|
|
|
+/*
|
|
+ * Returns true if clock table is large enough to contain the clock index.
|
|
+ */
|
|
+static bool assert_clk_index(struct opp_table *opp_table,
|
|
+ unsigned int index)
|
|
+{
|
|
+ return opp_table->clk_count > index;
|
|
+}
|
|
+
|
|
+/*
|
|
+ * Returns true if bandwidth table is large enough to contain the bandwidth index.
|
|
+ */
|
|
+static bool assert_bandwidth_index(struct opp_table *opp_table,
|
|
+ unsigned int index)
|
|
+{
|
|
+ return opp_table->path_count > index;
|
|
+}
|
|
+
|
|
/**
|
|
* dev_pm_opp_get_voltage() - Gets the voltage corresponding to an opp
|
|
* @opp: opp for which voltage has to be returned for
|
|
@@ -499,12 +518,12 @@ static struct dev_pm_opp *_opp_table_find_key(struct opp_table *opp_table,
|
|
unsigned long (*read)(struct dev_pm_opp *opp, int index),
|
|
bool (*compare)(struct dev_pm_opp **opp, struct dev_pm_opp *temp_opp,
|
|
unsigned long opp_key, unsigned long key),
|
|
- bool (*assert)(struct opp_table *opp_table))
|
|
+ bool (*assert)(struct opp_table *opp_table, unsigned int index))
|
|
{
|
|
struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE);
|
|
|
|
/* Assert that the requirement is met */
|
|
- if (assert && !assert(opp_table))
|
|
+ if (assert && !assert(opp_table, index))
|
|
return ERR_PTR(-EINVAL);
|
|
|
|
mutex_lock(&opp_table->lock);
|
|
@@ -532,7 +551,7 @@ _find_key(struct device *dev, unsigned long *key, int index, bool available,
|
|
unsigned long (*read)(struct dev_pm_opp *opp, int index),
|
|
bool (*compare)(struct dev_pm_opp **opp, struct dev_pm_opp *temp_opp,
|
|
unsigned long opp_key, unsigned long key),
|
|
- bool (*assert)(struct opp_table *opp_table))
|
|
+ bool (*assert)(struct opp_table *opp_table, unsigned int index))
|
|
{
|
|
struct opp_table *opp_table;
|
|
struct dev_pm_opp *opp;
|
|
@@ -555,7 +574,7 @@ _find_key(struct device *dev, unsigned long *key, int index, bool available,
|
|
static struct dev_pm_opp *_find_key_exact(struct device *dev,
|
|
unsigned long key, int index, bool available,
|
|
unsigned long (*read)(struct dev_pm_opp *opp, int index),
|
|
- bool (*assert)(struct opp_table *opp_table))
|
|
+ bool (*assert)(struct opp_table *opp_table, unsigned int index))
|
|
{
|
|
/*
|
|
* The value of key will be updated here, but will be ignored as the
|
|
@@ -568,7 +587,7 @@ static struct dev_pm_opp *_find_key_exact(struct device *dev,
|
|
static struct dev_pm_opp *_opp_table_find_key_ceil(struct opp_table *opp_table,
|
|
unsigned long *key, int index, bool available,
|
|
unsigned long (*read)(struct dev_pm_opp *opp, int index),
|
|
- bool (*assert)(struct opp_table *opp_table))
|
|
+ bool (*assert)(struct opp_table *opp_table, unsigned int index))
|
|
{
|
|
return _opp_table_find_key(opp_table, key, index, available, read,
|
|
_compare_ceil, assert);
|
|
@@ -577,7 +596,7 @@ static struct dev_pm_opp *_opp_table_find_key_ceil(struct opp_table *opp_table,
|
|
static struct dev_pm_opp *_find_key_ceil(struct device *dev, unsigned long *key,
|
|
int index, bool available,
|
|
unsigned long (*read)(struct dev_pm_opp *opp, int index),
|
|
- bool (*assert)(struct opp_table *opp_table))
|
|
+ bool (*assert)(struct opp_table *opp_table, unsigned int index))
|
|
{
|
|
return _find_key(dev, key, index, available, read, _compare_ceil,
|
|
assert);
|
|
@@ -586,7 +605,7 @@ static struct dev_pm_opp *_find_key_ceil(struct device *dev, unsigned long *key,
|
|
static struct dev_pm_opp *_find_key_floor(struct device *dev,
|
|
unsigned long *key, int index, bool available,
|
|
unsigned long (*read)(struct dev_pm_opp *opp, int index),
|
|
- bool (*assert)(struct opp_table *opp_table))
|
|
+ bool (*assert)(struct opp_table *opp_table, unsigned int index))
|
|
{
|
|
return _find_key(dev, key, index, available, read, _compare_floor,
|
|
assert);
|
|
@@ -647,7 +666,8 @@ struct dev_pm_opp *
|
|
dev_pm_opp_find_freq_exact_indexed(struct device *dev, unsigned long freq,
|
|
u32 index, bool available)
|
|
{
|
|
- return _find_key_exact(dev, freq, index, available, _read_freq, NULL);
|
|
+ return _find_key_exact(dev, freq, index, available, _read_freq,
|
|
+ assert_clk_index);
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_exact_indexed);
|
|
|
|
@@ -707,7 +727,8 @@ struct dev_pm_opp *
|
|
dev_pm_opp_find_freq_ceil_indexed(struct device *dev, unsigned long *freq,
|
|
u32 index)
|
|
{
|
|
- return _find_key_ceil(dev, freq, index, true, _read_freq, NULL);
|
|
+ return _find_key_ceil(dev, freq, index, true, _read_freq,
|
|
+ assert_clk_index);
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_ceil_indexed);
|
|
|
|
@@ -760,7 +781,7 @@ struct dev_pm_opp *
|
|
dev_pm_opp_find_freq_floor_indexed(struct device *dev, unsigned long *freq,
|
|
u32 index)
|
|
{
|
|
- return _find_key_floor(dev, freq, index, true, _read_freq, NULL);
|
|
+ return _find_key_floor(dev, freq, index, true, _read_freq, assert_clk_index);
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor_indexed);
|
|
|
|
@@ -838,7 +859,8 @@ struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev, unsigned int *bw,
|
|
unsigned long temp = *bw;
|
|
struct dev_pm_opp *opp;
|
|
|
|
- opp = _find_key_ceil(dev, &temp, index, true, _read_bw, NULL);
|
|
+ opp = _find_key_ceil(dev, &temp, index, true, _read_bw,
|
|
+ assert_bandwidth_index);
|
|
*bw = temp;
|
|
return opp;
|
|
}
|
|
@@ -869,7 +891,8 @@ struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,
|
|
unsigned long temp = *bw;
|
|
struct dev_pm_opp *opp;
|
|
|
|
- opp = _find_key_floor(dev, &temp, index, true, _read_bw, NULL);
|
|
+ opp = _find_key_floor(dev, &temp, index, true, _read_bw,
|
|
+ assert_bandwidth_index);
|
|
*bw = temp;
|
|
return opp;
|
|
}
|
|
@@ -1676,7 +1699,7 @@ void dev_pm_opp_remove(struct device *dev, unsigned long freq)
|
|
if (IS_ERR(opp_table))
|
|
return;
|
|
|
|
- if (!assert_single_clk(opp_table))
|
|
+ if (!assert_single_clk(opp_table, 0))
|
|
goto put_table;
|
|
|
|
mutex_lock(&opp_table->lock);
|
|
@@ -2027,7 +2050,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev,
|
|
unsigned long tol;
|
|
int ret;
|
|
|
|
- if (!assert_single_clk(opp_table))
|
|
+ if (!assert_single_clk(opp_table, 0))
|
|
return -EINVAL;
|
|
|
|
new_opp = _opp_allocate(opp_table);
|
|
@@ -2889,7 +2912,7 @@ static int _opp_set_availability(struct device *dev, unsigned long freq,
|
|
return r;
|
|
}
|
|
|
|
- if (!assert_single_clk(opp_table)) {
|
|
+ if (!assert_single_clk(opp_table, 0)) {
|
|
r = -EINVAL;
|
|
goto put_table;
|
|
}
|
|
@@ -2965,7 +2988,7 @@ int dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq,
|
|
return r;
|
|
}
|
|
|
|
- if (!assert_single_clk(opp_table)) {
|
|
+ if (!assert_single_clk(opp_table, 0)) {
|
|
r = -EINVAL;
|
|
goto put_table;
|
|
}
|
|
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
|
|
index ada4963c7cfae5..657c08d0ad979a 100644
|
|
--- a/drivers/opp/of.c
|
|
+++ b/drivers/opp/of.c
|
|
@@ -932,7 +932,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
|
|
|
|
ret = _of_opp_alloc_required_opps(opp_table, new_opp);
|
|
if (ret)
|
|
- goto free_opp;
|
|
+ goto put_node;
|
|
|
|
if (!of_property_read_u32(np, "clock-latency-ns", &val))
|
|
new_opp->clock_latency_ns = val;
|
|
@@ -982,6 +982,8 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
|
|
|
|
free_required_opps:
|
|
_of_opp_free_required_opps(opp_table, new_opp);
|
|
+put_node:
|
|
+ of_node_put(np);
|
|
free_opp:
|
|
_opp_free(new_opp);
|
|
|
|
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
|
|
index 86b09b5d7f2493..822a750b064b27 100644
|
|
--- a/drivers/pci/controller/dwc/pci-imx6.c
|
|
+++ b/drivers/pci/controller/dwc/pci-imx6.c
|
|
@@ -61,12 +61,16 @@ enum imx6_pcie_variants {
|
|
#define IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE BIT(1)
|
|
#define IMX6_PCIE_FLAG_SUPPORTS_SUSPEND BIT(2)
|
|
|
|
+#define IMX6_PCIE_MAX_CLKS 6
|
|
+
|
|
struct imx6_pcie_drvdata {
|
|
enum imx6_pcie_variants variant;
|
|
enum dw_pcie_device_mode mode;
|
|
u32 flags;
|
|
int dbi_length;
|
|
const char *gpr;
|
|
+ const char * const *clk_names;
|
|
+ const u32 clks_cnt;
|
|
};
|
|
|
|
struct imx6_pcie {
|
|
@@ -74,11 +78,7 @@ struct imx6_pcie {
|
|
int reset_gpio;
|
|
bool gpio_active_high;
|
|
bool link_is_up;
|
|
- struct clk *pcie_bus;
|
|
- struct clk *pcie_phy;
|
|
- struct clk *pcie_inbound_axi;
|
|
- struct clk *pcie;
|
|
- struct clk *pcie_aux;
|
|
+ struct clk_bulk_data clks[IMX6_PCIE_MAX_CLKS];
|
|
struct regmap *iomuxc_gpr;
|
|
u16 msi_ctrl;
|
|
u32 controller_id;
|
|
@@ -407,13 +407,18 @@ static void imx7d_pcie_wait_for_phy_pll_lock(struct imx6_pcie *imx6_pcie)
|
|
|
|
static int imx6_setup_phy_mpll(struct imx6_pcie *imx6_pcie)
|
|
{
|
|
- unsigned long phy_rate = clk_get_rate(imx6_pcie->pcie_phy);
|
|
+ unsigned long phy_rate = 0;
|
|
int mult, div;
|
|
u16 val;
|
|
+ int i;
|
|
|
|
if (!(imx6_pcie->drvdata->flags & IMX6_PCIE_FLAG_IMX6_PHY))
|
|
return 0;
|
|
|
|
+ for (i = 0; i < imx6_pcie->drvdata->clks_cnt; i++)
|
|
+ if (strncmp(imx6_pcie->clks[i].id, "pcie_phy", 8) == 0)
|
|
+ phy_rate = clk_get_rate(imx6_pcie->clks[i].clk);
|
|
+
|
|
switch (phy_rate) {
|
|
case 125000000:
|
|
/*
|
|
@@ -550,19 +555,11 @@ static int imx6_pcie_attach_pd(struct device *dev)
|
|
|
|
static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
|
|
{
|
|
- struct dw_pcie *pci = imx6_pcie->pci;
|
|
- struct device *dev = pci->dev;
|
|
unsigned int offset;
|
|
int ret = 0;
|
|
|
|
switch (imx6_pcie->drvdata->variant) {
|
|
case IMX6SX:
|
|
- ret = clk_prepare_enable(imx6_pcie->pcie_inbound_axi);
|
|
- if (ret) {
|
|
- dev_err(dev, "unable to enable pcie_axi clock\n");
|
|
- break;
|
|
- }
|
|
-
|
|
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
|
|
IMX6SX_GPR12_PCIE_TEST_POWERDOWN, 0);
|
|
break;
|
|
@@ -589,12 +586,6 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
|
|
case IMX8MQ_EP:
|
|
case IMX8MP:
|
|
case IMX8MP_EP:
|
|
- ret = clk_prepare_enable(imx6_pcie->pcie_aux);
|
|
- if (ret) {
|
|
- dev_err(dev, "unable to enable pcie_aux clock\n");
|
|
- break;
|
|
- }
|
|
-
|
|
offset = imx6_pcie_grp_offset(imx6_pcie);
|
|
/*
|
|
* Set the over ride low and enabled
|
|
@@ -615,9 +606,6 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
|
|
static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie)
|
|
{
|
|
switch (imx6_pcie->drvdata->variant) {
|
|
- case IMX6SX:
|
|
- clk_disable_unprepare(imx6_pcie->pcie_inbound_axi);
|
|
- break;
|
|
case IMX6QP:
|
|
case IMX6Q:
|
|
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
|
|
@@ -631,14 +619,6 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie)
|
|
IMX7D_GPR12_PCIE_PHY_REFCLK_SEL,
|
|
IMX7D_GPR12_PCIE_PHY_REFCLK_SEL);
|
|
break;
|
|
- case IMX8MM:
|
|
- case IMX8MM_EP:
|
|
- case IMX8MQ:
|
|
- case IMX8MQ_EP:
|
|
- case IMX8MP:
|
|
- case IMX8MP_EP:
|
|
- clk_disable_unprepare(imx6_pcie->pcie_aux);
|
|
- break;
|
|
default:
|
|
break;
|
|
}
|
|
@@ -650,23 +630,9 @@ static int imx6_pcie_clk_enable(struct imx6_pcie *imx6_pcie)
|
|
struct device *dev = pci->dev;
|
|
int ret;
|
|
|
|
- ret = clk_prepare_enable(imx6_pcie->pcie_phy);
|
|
- if (ret) {
|
|
- dev_err(dev, "unable to enable pcie_phy clock\n");
|
|
+ ret = clk_bulk_prepare_enable(imx6_pcie->drvdata->clks_cnt, imx6_pcie->clks);
|
|
+ if (ret)
|
|
return ret;
|
|
- }
|
|
-
|
|
- ret = clk_prepare_enable(imx6_pcie->pcie_bus);
|
|
- if (ret) {
|
|
- dev_err(dev, "unable to enable pcie_bus clock\n");
|
|
- goto err_pcie_bus;
|
|
- }
|
|
-
|
|
- ret = clk_prepare_enable(imx6_pcie->pcie);
|
|
- if (ret) {
|
|
- dev_err(dev, "unable to enable pcie clock\n");
|
|
- goto err_pcie;
|
|
- }
|
|
|
|
ret = imx6_pcie_enable_ref_clk(imx6_pcie);
|
|
if (ret) {
|
|
@@ -679,11 +645,7 @@ static int imx6_pcie_clk_enable(struct imx6_pcie *imx6_pcie)
|
|
return 0;
|
|
|
|
err_ref_clk:
|
|
- clk_disable_unprepare(imx6_pcie->pcie);
|
|
-err_pcie:
|
|
- clk_disable_unprepare(imx6_pcie->pcie_bus);
|
|
-err_pcie_bus:
|
|
- clk_disable_unprepare(imx6_pcie->pcie_phy);
|
|
+ clk_bulk_disable_unprepare(imx6_pcie->drvdata->clks_cnt, imx6_pcie->clks);
|
|
|
|
return ret;
|
|
}
|
|
@@ -691,9 +653,7 @@ static int imx6_pcie_clk_enable(struct imx6_pcie *imx6_pcie)
|
|
static void imx6_pcie_clk_disable(struct imx6_pcie *imx6_pcie)
|
|
{
|
|
imx6_pcie_disable_ref_clk(imx6_pcie);
|
|
- clk_disable_unprepare(imx6_pcie->pcie);
|
|
- clk_disable_unprepare(imx6_pcie->pcie_bus);
|
|
- clk_disable_unprepare(imx6_pcie->pcie_phy);
|
|
+ clk_bulk_disable_unprepare(imx6_pcie->drvdata->clks_cnt, imx6_pcie->clks);
|
|
}
|
|
|
|
static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
|
|
@@ -1253,6 +1213,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)
|
|
struct device_node *node = dev->of_node;
|
|
int ret;
|
|
u16 val;
|
|
+ int i;
|
|
|
|
imx6_pcie = devm_kzalloc(dev, sizeof(*imx6_pcie), GFP_KERNEL);
|
|
if (!imx6_pcie)
|
|
@@ -1306,33 +1267,20 @@ static int imx6_pcie_probe(struct platform_device *pdev)
|
|
return imx6_pcie->reset_gpio;
|
|
}
|
|
|
|
- /* Fetch clocks */
|
|
- imx6_pcie->pcie_bus = devm_clk_get(dev, "pcie_bus");
|
|
- if (IS_ERR(imx6_pcie->pcie_bus))
|
|
- return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_bus),
|
|
- "pcie_bus clock source missing or invalid\n");
|
|
+ if (imx6_pcie->drvdata->clks_cnt >= IMX6_PCIE_MAX_CLKS)
|
|
+ return dev_err_probe(dev, -ENOMEM, "clks_cnt is too big\n");
|
|
+
|
|
+ for (i = 0; i < imx6_pcie->drvdata->clks_cnt; i++)
|
|
+ imx6_pcie->clks[i].id = imx6_pcie->drvdata->clk_names[i];
|
|
|
|
- imx6_pcie->pcie = devm_clk_get(dev, "pcie");
|
|
- if (IS_ERR(imx6_pcie->pcie))
|
|
- return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie),
|
|
- "pcie clock source missing or invalid\n");
|
|
+ /* Fetch clocks */
|
|
+ ret = devm_clk_bulk_get(dev, imx6_pcie->drvdata->clks_cnt, imx6_pcie->clks);
|
|
+ if (ret)
|
|
+ return ret;
|
|
|
|
switch (imx6_pcie->drvdata->variant) {
|
|
- case IMX6SX:
|
|
- imx6_pcie->pcie_inbound_axi = devm_clk_get(dev,
|
|
- "pcie_inbound_axi");
|
|
- if (IS_ERR(imx6_pcie->pcie_inbound_axi))
|
|
- return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_inbound_axi),
|
|
- "pcie_inbound_axi clock missing or invalid\n");
|
|
- break;
|
|
case IMX8MQ:
|
|
case IMX8MQ_EP:
|
|
- imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux");
|
|
- if (IS_ERR(imx6_pcie->pcie_aux))
|
|
- return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_aux),
|
|
- "pcie_aux clock source missing or invalid\n");
|
|
- fallthrough;
|
|
- case IMX7D:
|
|
if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR)
|
|
imx6_pcie->controller_id = 1;
|
|
|
|
@@ -1354,10 +1302,6 @@ static int imx6_pcie_probe(struct platform_device *pdev)
|
|
case IMX8MM_EP:
|
|
case IMX8MP:
|
|
case IMX8MP_EP:
|
|
- imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux");
|
|
- if (IS_ERR(imx6_pcie->pcie_aux))
|
|
- return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_aux),
|
|
- "pcie_aux clock source missing or invalid\n");
|
|
imx6_pcie->apps_reset = devm_reset_control_get_exclusive(dev,
|
|
"apps");
|
|
if (IS_ERR(imx6_pcie->apps_reset))
|
|
@@ -1373,14 +1317,6 @@ static int imx6_pcie_probe(struct platform_device *pdev)
|
|
default:
|
|
break;
|
|
}
|
|
- /* Don't fetch the pcie_phy clock, if it has abstract PHY driver */
|
|
- if (imx6_pcie->phy == NULL) {
|
|
- imx6_pcie->pcie_phy = devm_clk_get(dev, "pcie_phy");
|
|
- if (IS_ERR(imx6_pcie->pcie_phy))
|
|
- return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_phy),
|
|
- "pcie_phy clock source missing or invalid\n");
|
|
- }
|
|
-
|
|
|
|
/* Grab turnoff reset */
|
|
imx6_pcie->turnoff_reset = devm_reset_control_get_optional_exclusive(dev, "turnoff");
|
|
@@ -1471,6 +1407,11 @@ static void imx6_pcie_shutdown(struct platform_device *pdev)
|
|
imx6_pcie_assert_core_reset(imx6_pcie);
|
|
}
|
|
|
|
+static const char * const imx6q_clks[] = {"pcie_bus", "pcie", "pcie_phy"};
|
|
+static const char * const imx8mm_clks[] = {"pcie_bus", "pcie", "pcie_aux"};
|
|
+static const char * const imx8mq_clks[] = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"};
|
|
+static const char * const imx6sx_clks[] = {"pcie_bus", "pcie", "pcie_phy", "pcie_inbound_axi"};
|
|
+
|
|
static const struct imx6_pcie_drvdata drvdata[] = {
|
|
[IMX6Q] = {
|
|
.variant = IMX6Q,
|
|
@@ -1478,6 +1419,8 @@ static const struct imx6_pcie_drvdata drvdata[] = {
|
|
IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE,
|
|
.dbi_length = 0x200,
|
|
.gpr = "fsl,imx6q-iomuxc-gpr",
|
|
+ .clk_names = imx6q_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx6q_clks),
|
|
},
|
|
[IMX6SX] = {
|
|
.variant = IMX6SX,
|
|
@@ -1485,6 +1428,8 @@ static const struct imx6_pcie_drvdata drvdata[] = {
|
|
IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE |
|
|
IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
|
|
.gpr = "fsl,imx6q-iomuxc-gpr",
|
|
+ .clk_names = imx6sx_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx6sx_clks),
|
|
},
|
|
[IMX6QP] = {
|
|
.variant = IMX6QP,
|
|
@@ -1493,40 +1438,56 @@ static const struct imx6_pcie_drvdata drvdata[] = {
|
|
IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
|
|
.dbi_length = 0x200,
|
|
.gpr = "fsl,imx6q-iomuxc-gpr",
|
|
+ .clk_names = imx6q_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx6q_clks),
|
|
},
|
|
[IMX7D] = {
|
|
.variant = IMX7D,
|
|
.flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
|
|
.gpr = "fsl,imx7d-iomuxc-gpr",
|
|
+ .clk_names = imx6q_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx6q_clks),
|
|
},
|
|
[IMX8MQ] = {
|
|
.variant = IMX8MQ,
|
|
.gpr = "fsl,imx8mq-iomuxc-gpr",
|
|
+ .clk_names = imx8mq_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx8mq_clks),
|
|
},
|
|
[IMX8MM] = {
|
|
.variant = IMX8MM,
|
|
.flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
|
|
.gpr = "fsl,imx8mm-iomuxc-gpr",
|
|
+ .clk_names = imx8mm_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx8mm_clks),
|
|
},
|
|
[IMX8MP] = {
|
|
.variant = IMX8MP,
|
|
.flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
|
|
.gpr = "fsl,imx8mp-iomuxc-gpr",
|
|
+ .clk_names = imx8mm_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx8mm_clks),
|
|
},
|
|
[IMX8MQ_EP] = {
|
|
.variant = IMX8MQ_EP,
|
|
.mode = DW_PCIE_EP_TYPE,
|
|
.gpr = "fsl,imx8mq-iomuxc-gpr",
|
|
+ .clk_names = imx8mq_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx8mq_clks),
|
|
},
|
|
[IMX8MM_EP] = {
|
|
.variant = IMX8MM_EP,
|
|
.mode = DW_PCIE_EP_TYPE,
|
|
.gpr = "fsl,imx8mm-iomuxc-gpr",
|
|
+ .clk_names = imx8mm_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx8mm_clks),
|
|
},
|
|
[IMX8MP_EP] = {
|
|
.variant = IMX8MP_EP,
|
|
.mode = DW_PCIE_EP_TYPE,
|
|
.gpr = "fsl,imx8mp-iomuxc-gpr",
|
|
+ .clk_names = imx8mm_clks,
|
|
+ .clks_cnt = ARRAY_SIZE(imx8mm_clks),
|
|
},
|
|
};
|
|
|
|
diff --git a/drivers/pci/controller/pcie-rcar-ep.c b/drivers/pci/controller/pcie-rcar-ep.c
|
|
index f9682df1da6192..209719fb6ddcce 100644
|
|
--- a/drivers/pci/controller/pcie-rcar-ep.c
|
|
+++ b/drivers/pci/controller/pcie-rcar-ep.c
|
|
@@ -107,7 +107,7 @@ static int rcar_pcie_parse_outbound_ranges(struct rcar_pcie_endpoint *ep,
|
|
}
|
|
if (!devm_request_mem_region(&pdev->dev, res->start,
|
|
resource_size(res),
|
|
- outbound_name)) {
|
|
+ res->name)) {
|
|
dev_err(pcie->dev, "Cannot request memory region %s.\n",
|
|
outbound_name);
|
|
return -EIO;
|
|
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
|
|
index 1f0d2b84296a34..ac1dae113f2d9f 100644
|
|
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
|
|
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
|
|
@@ -251,7 +251,7 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test)
|
|
|
|
fail_back_rx:
|
|
dma_release_channel(epf_test->dma_chan_rx);
|
|
- epf_test->dma_chan_tx = NULL;
|
|
+ epf_test->dma_chan_rx = NULL;
|
|
|
|
fail_back_tx:
|
|
dma_cap_zero(mask);
|
|
@@ -361,8 +361,8 @@ static void pci_epf_test_copy(struct pci_epf_test *epf_test,
|
|
|
|
ktime_get_ts64(&start);
|
|
if (reg->flags & FLAG_USE_DMA) {
|
|
- if (epf_test->dma_private) {
|
|
- dev_err(dev, "Cannot transfer data using DMA\n");
|
|
+ if (!dma_has_cap(DMA_MEMCPY, epf_test->dma_chan_tx->device->cap_mask)) {
|
|
+ dev_err(dev, "DMA controller doesn't support MEMCPY\n");
|
|
ret = -EINVAL;
|
|
goto err_map_addr;
|
|
}
|
|
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
|
|
index d06623c751f84e..3a82c6a613a3c9 100644
|
|
--- a/drivers/pci/endpoint/pci-epc-core.c
|
|
+++ b/drivers/pci/endpoint/pci-epc-core.c
|
|
@@ -808,7 +808,7 @@ void devm_pci_epc_destroy(struct device *dev, struct pci_epc *epc)
|
|
{
|
|
int r;
|
|
|
|
- r = devres_destroy(dev, devm_pci_epc_release, devm_pci_epc_match,
|
|
+ r = devres_release(dev, devm_pci_epc_release, devm_pci_epc_match,
|
|
epc);
|
|
dev_WARN_ONCE(dev, r, "couldn't find PCI EPC resource\n");
|
|
}
|
|
diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c
|
|
index f0cad2c501f766..08d80fb935b3ad 100644
|
|
--- a/drivers/pinctrl/nxp/pinctrl-s32cc.c
|
|
+++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c
|
|
@@ -735,9 +735,7 @@ static int s32_pinctrl_parse_groups(struct device_node *np,
|
|
struct s32_pin_group *grp,
|
|
struct s32_pinctrl_soc_info *info)
|
|
{
|
|
- const __be32 *p;
|
|
struct device *dev;
|
|
- struct property *prop;
|
|
unsigned int *pins, *sss;
|
|
int i, npins;
|
|
u32 pinmux;
|
|
@@ -768,7 +766,7 @@ static int s32_pinctrl_parse_groups(struct device_node *np,
|
|
return -ENOMEM;
|
|
|
|
i = 0;
|
|
- of_property_for_each_u32(np, "pinmux", prop, p, pinmux) {
|
|
+ of_property_for_each_u32(np, "pinmux", pinmux) {
|
|
pins[i] = get_pin_no(pinmux);
|
|
sss[i] = get_pin_func(pinmux);
|
|
|
|
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
|
|
index 86034c457c0436..75bff325a42519 100644
|
|
--- a/drivers/pinctrl/pinctrl-amd.c
|
|
+++ b/drivers/pinctrl/pinctrl-amd.c
|
|
@@ -908,12 +908,13 @@ static bool amd_gpio_should_save(struct amd_gpio *gpio_dev, unsigned int pin)
|
|
return false;
|
|
}
|
|
|
|
-static int amd_gpio_suspend(struct device *dev)
|
|
+static int amd_gpio_suspend_hibernate_common(struct device *dev, bool is_suspend)
|
|
{
|
|
struct amd_gpio *gpio_dev = dev_get_drvdata(dev);
|
|
struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
|
|
unsigned long flags;
|
|
int i;
|
|
+ u32 wake_mask = is_suspend ? WAKE_SOURCE_SUSPEND : WAKE_SOURCE_HIBERNATE;
|
|
|
|
for (i = 0; i < desc->npins; i++) {
|
|
int pin = desc->pins[i].number;
|
|
@@ -925,11 +926,11 @@ static int amd_gpio_suspend(struct device *dev)
|
|
gpio_dev->saved_regs[i] = readl(gpio_dev->base + pin * 4) & ~PIN_IRQ_PENDING;
|
|
|
|
/* mask any interrupts not intended to be a wake source */
|
|
- if (!(gpio_dev->saved_regs[i] & WAKE_SOURCE)) {
|
|
+ if (!(gpio_dev->saved_regs[i] & wake_mask)) {
|
|
writel(gpio_dev->saved_regs[i] & ~BIT(INTERRUPT_MASK_OFF),
|
|
gpio_dev->base + pin * 4);
|
|
- pm_pr_dbg("Disabling GPIO #%d interrupt for suspend.\n",
|
|
- pin);
|
|
+ pm_pr_dbg("Disabling GPIO #%d interrupt for %s.\n",
|
|
+ pin, is_suspend ? "suspend" : "hibernate");
|
|
}
|
|
|
|
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
|
|
@@ -938,6 +939,16 @@ static int amd_gpio_suspend(struct device *dev)
|
|
return 0;
|
|
}
|
|
|
|
+static int amd_gpio_suspend(struct device *dev)
|
|
+{
|
|
+ return amd_gpio_suspend_hibernate_common(dev, true);
|
|
+}
|
|
+
|
|
+static int amd_gpio_hibernate(struct device *dev)
|
|
+{
|
|
+ return amd_gpio_suspend_hibernate_common(dev, false);
|
|
+}
|
|
+
|
|
static int amd_gpio_resume(struct device *dev)
|
|
{
|
|
struct amd_gpio *gpio_dev = dev_get_drvdata(dev);
|
|
@@ -961,8 +972,12 @@ static int amd_gpio_resume(struct device *dev)
|
|
}
|
|
|
|
static const struct dev_pm_ops amd_gpio_pm_ops = {
|
|
- SET_LATE_SYSTEM_SLEEP_PM_OPS(amd_gpio_suspend,
|
|
- amd_gpio_resume)
|
|
+ .suspend_late = amd_gpio_suspend,
|
|
+ .resume_early = amd_gpio_resume,
|
|
+ .freeze_late = amd_gpio_hibernate,
|
|
+ .thaw_early = amd_gpio_resume,
|
|
+ .poweroff_late = amd_gpio_hibernate,
|
|
+ .restore_early = amd_gpio_resume,
|
|
};
|
|
#endif
|
|
|
|
diff --git a/drivers/pinctrl/pinctrl-amd.h b/drivers/pinctrl/pinctrl-amd.h
|
|
index cf59089f277639..c9522c62d7910f 100644
|
|
--- a/drivers/pinctrl/pinctrl-amd.h
|
|
+++ b/drivers/pinctrl/pinctrl-amd.h
|
|
@@ -80,10 +80,9 @@
|
|
#define FUNCTION_MASK GENMASK(1, 0)
|
|
#define FUNCTION_INVALID GENMASK(7, 0)
|
|
|
|
-#define WAKE_SOURCE (BIT(WAKE_CNTRL_OFF_S0I3) | \
|
|
- BIT(WAKE_CNTRL_OFF_S3) | \
|
|
- BIT(WAKE_CNTRL_OFF_S4) | \
|
|
- BIT(WAKECNTRL_Z_OFF))
|
|
+#define WAKE_SOURCE_SUSPEND (BIT(WAKE_CNTRL_OFF_S0I3) | \
|
|
+ BIT(WAKE_CNTRL_OFF_S3))
|
|
+#define WAKE_SOURCE_HIBERNATE BIT(WAKE_CNTRL_OFF_S4)
|
|
|
|
struct amd_function {
|
|
const char *name;
|
|
diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c
|
|
index 7c05dbf533e7a3..558fc2ad976fc8 100644
|
|
--- a/drivers/pinctrl/pinctrl-k210.c
|
|
+++ b/drivers/pinctrl/pinctrl-k210.c
|
|
@@ -763,8 +763,6 @@ static int k210_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
|
|
unsigned int *reserved_maps,
|
|
unsigned int *num_maps)
|
|
{
|
|
- struct property *prop;
|
|
- const __be32 *p;
|
|
int ret, pinmux_groups;
|
|
u32 pinmux_group;
|
|
unsigned long *configs = NULL;
|
|
@@ -797,7 +795,7 @@ static int k210_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
|
|
if (ret < 0)
|
|
goto exit;
|
|
|
|
- of_property_for_each_u32(np, "pinmux", prop, p, pinmux_group) {
|
|
+ of_property_for_each_u32(np, "pinmux", pinmux_group) {
|
|
const char *group_name, *func_name;
|
|
u32 pin = FIELD_GET(K210_PG_PIN, pinmux_group);
|
|
u32 func = FIELD_GET(K210_PG_FUNC, pinmux_group);
|
|
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
|
|
index 5e91def6078474..84121b125d90ed 100644
|
|
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
|
|
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
|
|
@@ -86,7 +86,6 @@ struct stm32_pinctrl_group {
|
|
|
|
struct stm32_gpio_bank {
|
|
void __iomem *base;
|
|
- struct clk *clk;
|
|
struct reset_control *rstc;
|
|
spinlock_t lock;
|
|
struct gpio_chip gpio_chip;
|
|
@@ -108,6 +107,7 @@ struct stm32_pinctrl {
|
|
unsigned ngroups;
|
|
const char **grp_names;
|
|
struct stm32_gpio_bank *banks;
|
|
+ struct clk_bulk_data *clks;
|
|
unsigned nbanks;
|
|
const struct stm32_pinctrl_match_data *match_data;
|
|
struct irq_domain *domain;
|
|
@@ -1321,12 +1321,6 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, struct fwnode
|
|
if (IS_ERR(bank->base))
|
|
return PTR_ERR(bank->base);
|
|
|
|
- err = clk_prepare_enable(bank->clk);
|
|
- if (err) {
|
|
- dev_err(dev, "failed to prepare_enable clk (%d)\n", err);
|
|
- return err;
|
|
- }
|
|
-
|
|
bank->gpio_chip = stm32_gpio_template;
|
|
|
|
fwnode_property_read_string(fwnode, "st,bank-name", &bank->gpio_chip.label);
|
|
@@ -1373,26 +1367,20 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, struct fwnode
|
|
bank->fwnode, &stm32_gpio_domain_ops,
|
|
bank);
|
|
|
|
- if (!bank->domain) {
|
|
- err = -ENODEV;
|
|
- goto err_clk;
|
|
- }
|
|
+ if (!bank->domain)
|
|
+ return -ENODEV;
|
|
}
|
|
|
|
names = devm_kcalloc(dev, npins, sizeof(char *), GFP_KERNEL);
|
|
- if (!names) {
|
|
- err = -ENOMEM;
|
|
- goto err_clk;
|
|
- }
|
|
+ if (!names)
|
|
+ return -ENOMEM;
|
|
|
|
for (i = 0; i < npins; i++) {
|
|
stm32_pin = stm32_pctrl_get_desc_pin_from_gpio(pctl, bank, i);
|
|
if (stm32_pin && stm32_pin->pin.name) {
|
|
names[i] = devm_kasprintf(dev, GFP_KERNEL, "%s", stm32_pin->pin.name);
|
|
- if (!names[i]) {
|
|
- err = -ENOMEM;
|
|
- goto err_clk;
|
|
- }
|
|
+ if (!names[i])
|
|
+ return -ENOMEM;
|
|
} else {
|
|
names[i] = NULL;
|
|
}
|
|
@@ -1403,15 +1391,11 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, struct fwnode
|
|
err = gpiochip_add_data(&bank->gpio_chip, bank);
|
|
if (err) {
|
|
dev_err(dev, "Failed to add gpiochip(%d)!\n", bank_nr);
|
|
- goto err_clk;
|
|
+ return err;
|
|
}
|
|
|
|
dev_info(dev, "%s bank added\n", bank->gpio_chip.label);
|
|
return 0;
|
|
-
|
|
-err_clk:
|
|
- clk_disable_unprepare(bank->clk);
|
|
- return err;
|
|
}
|
|
|
|
static struct irq_domain *stm32_pctrl_get_irq_domain(struct platform_device *pdev)
|
|
@@ -1634,6 +1618,11 @@ int stm32_pctl_probe(struct platform_device *pdev)
|
|
if (!pctl->banks)
|
|
return -ENOMEM;
|
|
|
|
+ pctl->clks = devm_kcalloc(dev, banks, sizeof(*pctl->clks),
|
|
+ GFP_KERNEL);
|
|
+ if (!pctl->clks)
|
|
+ return -ENOMEM;
|
|
+
|
|
i = 0;
|
|
for_each_gpiochip_node(dev, child) {
|
|
struct stm32_gpio_bank *bank = &pctl->banks[i];
|
|
@@ -1645,24 +1634,27 @@ int stm32_pctl_probe(struct platform_device *pdev)
|
|
return -EPROBE_DEFER;
|
|
}
|
|
|
|
- bank->clk = of_clk_get_by_name(np, NULL);
|
|
- if (IS_ERR(bank->clk)) {
|
|
+ pctl->clks[i].clk = of_clk_get_by_name(np, NULL);
|
|
+ if (IS_ERR(pctl->clks[i].clk)) {
|
|
fwnode_handle_put(child);
|
|
- return dev_err_probe(dev, PTR_ERR(bank->clk),
|
|
+ return dev_err_probe(dev, PTR_ERR(pctl->clks[i].clk),
|
|
"failed to get clk\n");
|
|
}
|
|
+ pctl->clks[i].id = "pctl";
|
|
i++;
|
|
}
|
|
|
|
+ ret = clk_bulk_prepare_enable(banks, pctl->clks);
|
|
+ if (ret) {
|
|
+ dev_err(dev, "failed to prepare_enable clk (%d)\n", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
for_each_gpiochip_node(dev, child) {
|
|
ret = stm32_gpiolib_register_bank(pctl, child);
|
|
if (ret) {
|
|
fwnode_handle_put(child);
|
|
-
|
|
- for (i = 0; i < pctl->nbanks; i++)
|
|
- clk_disable_unprepare(pctl->banks[i].clk);
|
|
-
|
|
- return ret;
|
|
+ goto err_register;
|
|
}
|
|
|
|
pctl->nbanks++;
|
|
@@ -1671,6 +1663,15 @@ int stm32_pctl_probe(struct platform_device *pdev)
|
|
dev_info(dev, "Pinctrl STM32 initialized\n");
|
|
|
|
return 0;
|
|
+err_register:
|
|
+ for (i = 0; i < pctl->nbanks; i++) {
|
|
+ struct stm32_gpio_bank *bank = &pctl->banks[i];
|
|
+
|
|
+ gpiochip_remove(&bank->gpio_chip);
|
|
+ }
|
|
+
|
|
+ clk_bulk_disable_unprepare(banks, pctl->clks);
|
|
+ return ret;
|
|
}
|
|
|
|
static int __maybe_unused stm32_pinctrl_restore_gpio_regs(
|
|
@@ -1739,10 +1740,8 @@ static int __maybe_unused stm32_pinctrl_restore_gpio_regs(
|
|
int __maybe_unused stm32_pinctrl_suspend(struct device *dev)
|
|
{
|
|
struct stm32_pinctrl *pctl = dev_get_drvdata(dev);
|
|
- int i;
|
|
|
|
- for (i = 0; i < pctl->nbanks; i++)
|
|
- clk_disable(pctl->banks[i].clk);
|
|
+ clk_bulk_disable(pctl->nbanks, pctl->clks);
|
|
|
|
return 0;
|
|
}
|
|
@@ -1751,10 +1750,11 @@ int __maybe_unused stm32_pinctrl_resume(struct device *dev)
|
|
{
|
|
struct stm32_pinctrl *pctl = dev_get_drvdata(dev);
|
|
struct stm32_pinctrl_group *g = pctl->groups;
|
|
- int i;
|
|
+ int i, ret;
|
|
|
|
- for (i = 0; i < pctl->nbanks; i++)
|
|
- clk_enable(pctl->banks[i].clk);
|
|
+ ret = clk_bulk_enable(pctl->nbanks, pctl->clks);
|
|
+ if (ret)
|
|
+ return ret;
|
|
|
|
for (i = 0; i < pctl->ngroups; i++, g++)
|
|
stm32_pinctrl_restore_gpio_regs(pctl, g->pin);
|
|
diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
|
|
index 2f4b11b4dfcd91..bf3b6f1aa98425 100644
|
|
--- a/drivers/pps/clients/pps-gpio.c
|
|
+++ b/drivers/pps/clients/pps-gpio.c
|
|
@@ -214,8 +214,8 @@ static int pps_gpio_probe(struct platform_device *pdev)
|
|
return -EINVAL;
|
|
}
|
|
|
|
- dev_info(data->pps->dev, "Registered IRQ %d as PPS source\n",
|
|
- data->irq);
|
|
+ dev_dbg(&data->pps->dev, "Registered IRQ %d as PPS source\n",
|
|
+ data->irq);
|
|
|
|
return 0;
|
|
}
|
|
diff --git a/drivers/pps/clients/pps-ktimer.c b/drivers/pps/clients/pps-ktimer.c
|
|
index d33106bd7a290f..2f465549b843f7 100644
|
|
--- a/drivers/pps/clients/pps-ktimer.c
|
|
+++ b/drivers/pps/clients/pps-ktimer.c
|
|
@@ -56,7 +56,7 @@ static struct pps_source_info pps_ktimer_info = {
|
|
|
|
static void __exit pps_ktimer_exit(void)
|
|
{
|
|
- dev_info(pps->dev, "ktimer PPS source unregistered\n");
|
|
+ dev_dbg(&pps->dev, "ktimer PPS source unregistered\n");
|
|
|
|
del_timer_sync(&ktimer);
|
|
pps_unregister_source(pps);
|
|
@@ -74,7 +74,7 @@ static int __init pps_ktimer_init(void)
|
|
timer_setup(&ktimer, pps_ktimer_event, 0);
|
|
mod_timer(&ktimer, jiffies + HZ);
|
|
|
|
- dev_info(pps->dev, "ktimer PPS source registered\n");
|
|
+ dev_dbg(&pps->dev, "ktimer PPS source registered\n");
|
|
|
|
return 0;
|
|
}
|
|
diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c
|
|
index 443d6bae19d14d..fa5660f3c4b707 100644
|
|
--- a/drivers/pps/clients/pps-ldisc.c
|
|
+++ b/drivers/pps/clients/pps-ldisc.c
|
|
@@ -32,7 +32,7 @@ static void pps_tty_dcd_change(struct tty_struct *tty, bool active)
|
|
pps_event(pps, &ts, active ? PPS_CAPTUREASSERT :
|
|
PPS_CAPTURECLEAR, NULL);
|
|
|
|
- dev_dbg(pps->dev, "PPS %s at %lu\n",
|
|
+ dev_dbg(&pps->dev, "PPS %s at %lu\n",
|
|
active ? "assert" : "clear", jiffies);
|
|
}
|
|
|
|
@@ -69,7 +69,7 @@ static int pps_tty_open(struct tty_struct *tty)
|
|
goto err_unregister;
|
|
}
|
|
|
|
- dev_info(pps->dev, "source \"%s\" added\n", info.path);
|
|
+ dev_dbg(&pps->dev, "source \"%s\" added\n", info.path);
|
|
|
|
return 0;
|
|
|
|
@@ -89,7 +89,7 @@ static void pps_tty_close(struct tty_struct *tty)
|
|
if (WARN_ON(!pps))
|
|
return;
|
|
|
|
- dev_info(pps->dev, "removed\n");
|
|
+ dev_info(&pps->dev, "removed\n");
|
|
pps_unregister_source(pps);
|
|
}
|
|
|
|
diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c
|
|
index 53e9c304ae0a7a..c3f46efd64c324 100644
|
|
--- a/drivers/pps/clients/pps_parport.c
|
|
+++ b/drivers/pps/clients/pps_parport.c
|
|
@@ -81,7 +81,7 @@ static void parport_irq(void *handle)
|
|
/* check the signal (no signal means the pulse is lost this time) */
|
|
if (!signal_is_set(port)) {
|
|
local_irq_restore(flags);
|
|
- dev_err(dev->pps->dev, "lost the signal\n");
|
|
+ dev_err(&dev->pps->dev, "lost the signal\n");
|
|
goto out_assert;
|
|
}
|
|
|
|
@@ -98,7 +98,7 @@ static void parport_irq(void *handle)
|
|
/* timeout */
|
|
dev->cw_err++;
|
|
if (dev->cw_err >= CLEAR_WAIT_MAX_ERRORS) {
|
|
- dev_err(dev->pps->dev, "disabled clear edge capture after %d"
|
|
+ dev_err(&dev->pps->dev, "disabled clear edge capture after %d"
|
|
" timeouts\n", dev->cw_err);
|
|
dev->cw = 0;
|
|
dev->cw_err = 0;
|
|
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
|
|
index d9d566f70ed199..92d1b62ea239d7 100644
|
|
--- a/drivers/pps/kapi.c
|
|
+++ b/drivers/pps/kapi.c
|
|
@@ -41,7 +41,7 @@ static void pps_add_offset(struct pps_ktime *ts, struct pps_ktime *offset)
|
|
static void pps_echo_client_default(struct pps_device *pps, int event,
|
|
void *data)
|
|
{
|
|
- dev_info(pps->dev, "echo %s %s\n",
|
|
+ dev_info(&pps->dev, "echo %s %s\n",
|
|
event & PPS_CAPTUREASSERT ? "assert" : "",
|
|
event & PPS_CAPTURECLEAR ? "clear" : "");
|
|
}
|
|
@@ -112,7 +112,7 @@ struct pps_device *pps_register_source(struct pps_source_info *info,
|
|
goto kfree_pps;
|
|
}
|
|
|
|
- dev_info(pps->dev, "new PPS source %s\n", info->name);
|
|
+ dev_dbg(&pps->dev, "new PPS source %s\n", info->name);
|
|
|
|
return pps;
|
|
|
|
@@ -166,7 +166,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
|
|
/* check event type */
|
|
BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0);
|
|
|
|
- dev_dbg(pps->dev, "PPS event at %lld.%09ld\n",
|
|
+ dev_dbg(&pps->dev, "PPS event at %lld.%09ld\n",
|
|
(s64)ts->ts_real.tv_sec, ts->ts_real.tv_nsec);
|
|
|
|
timespec_to_pps_ktime(&ts_real, ts->ts_real);
|
|
@@ -188,7 +188,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
|
|
/* Save the time stamp */
|
|
pps->assert_tu = ts_real;
|
|
pps->assert_sequence++;
|
|
- dev_dbg(pps->dev, "capture assert seq #%u\n",
|
|
+ dev_dbg(&pps->dev, "capture assert seq #%u\n",
|
|
pps->assert_sequence);
|
|
|
|
captured = ~0;
|
|
@@ -202,7 +202,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
|
|
/* Save the time stamp */
|
|
pps->clear_tu = ts_real;
|
|
pps->clear_sequence++;
|
|
- dev_dbg(pps->dev, "capture clear seq #%u\n",
|
|
+ dev_dbg(&pps->dev, "capture clear seq #%u\n",
|
|
pps->clear_sequence);
|
|
|
|
captured = ~0;
|
|
diff --git a/drivers/pps/kc.c b/drivers/pps/kc.c
|
|
index 50dc59af45be24..fbd23295afd7d9 100644
|
|
--- a/drivers/pps/kc.c
|
|
+++ b/drivers/pps/kc.c
|
|
@@ -43,11 +43,11 @@ int pps_kc_bind(struct pps_device *pps, struct pps_bind_args *bind_args)
|
|
pps_kc_hardpps_mode = 0;
|
|
pps_kc_hardpps_dev = NULL;
|
|
spin_unlock_irq(&pps_kc_hardpps_lock);
|
|
- dev_info(pps->dev, "unbound kernel"
|
|
+ dev_info(&pps->dev, "unbound kernel"
|
|
" consumer\n");
|
|
} else {
|
|
spin_unlock_irq(&pps_kc_hardpps_lock);
|
|
- dev_err(pps->dev, "selected kernel consumer"
|
|
+ dev_err(&pps->dev, "selected kernel consumer"
|
|
" is not bound\n");
|
|
return -EINVAL;
|
|
}
|
|
@@ -57,11 +57,11 @@ int pps_kc_bind(struct pps_device *pps, struct pps_bind_args *bind_args)
|
|
pps_kc_hardpps_mode = bind_args->edge;
|
|
pps_kc_hardpps_dev = pps;
|
|
spin_unlock_irq(&pps_kc_hardpps_lock);
|
|
- dev_info(pps->dev, "bound kernel consumer: "
|
|
+ dev_info(&pps->dev, "bound kernel consumer: "
|
|
"edge=0x%x\n", bind_args->edge);
|
|
} else {
|
|
spin_unlock_irq(&pps_kc_hardpps_lock);
|
|
- dev_err(pps->dev, "another kernel consumer"
|
|
+ dev_err(&pps->dev, "another kernel consumer"
|
|
" is already bound\n");
|
|
return -EINVAL;
|
|
}
|
|
@@ -83,7 +83,7 @@ void pps_kc_remove(struct pps_device *pps)
|
|
pps_kc_hardpps_mode = 0;
|
|
pps_kc_hardpps_dev = NULL;
|
|
spin_unlock_irq(&pps_kc_hardpps_lock);
|
|
- dev_info(pps->dev, "unbound kernel consumer"
|
|
+ dev_info(&pps->dev, "unbound kernel consumer"
|
|
" on device removal\n");
|
|
} else
|
|
spin_unlock_irq(&pps_kc_hardpps_lock);
|
|
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
|
|
index 5d19baae6a380a..63f96357eb9fd8 100644
|
|
--- a/drivers/pps/pps.c
|
|
+++ b/drivers/pps/pps.c
|
|
@@ -25,7 +25,7 @@
|
|
* Local variables
|
|
*/
|
|
|
|
-static dev_t pps_devt;
|
|
+static int pps_major;
|
|
static struct class *pps_class;
|
|
|
|
static DEFINE_MUTEX(pps_idr_lock);
|
|
@@ -62,7 +62,7 @@ static int pps_cdev_pps_fetch(struct pps_device *pps, struct pps_fdata *fdata)
|
|
else {
|
|
unsigned long ticks;
|
|
|
|
- dev_dbg(pps->dev, "timeout %lld.%09d\n",
|
|
+ dev_dbg(&pps->dev, "timeout %lld.%09d\n",
|
|
(long long) fdata->timeout.sec,
|
|
fdata->timeout.nsec);
|
|
ticks = fdata->timeout.sec * HZ;
|
|
@@ -80,7 +80,7 @@ static int pps_cdev_pps_fetch(struct pps_device *pps, struct pps_fdata *fdata)
|
|
|
|
/* Check for pending signals */
|
|
if (err == -ERESTARTSYS) {
|
|
- dev_dbg(pps->dev, "pending signal caught\n");
|
|
+ dev_dbg(&pps->dev, "pending signal caught\n");
|
|
return -EINTR;
|
|
}
|
|
|
|
@@ -98,7 +98,7 @@ static long pps_cdev_ioctl(struct file *file,
|
|
|
|
switch (cmd) {
|
|
case PPS_GETPARAMS:
|
|
- dev_dbg(pps->dev, "PPS_GETPARAMS\n");
|
|
+ dev_dbg(&pps->dev, "PPS_GETPARAMS\n");
|
|
|
|
spin_lock_irq(&pps->lock);
|
|
|
|
@@ -114,7 +114,7 @@ static long pps_cdev_ioctl(struct file *file,
|
|
break;
|
|
|
|
case PPS_SETPARAMS:
|
|
- dev_dbg(pps->dev, "PPS_SETPARAMS\n");
|
|
+ dev_dbg(&pps->dev, "PPS_SETPARAMS\n");
|
|
|
|
/* Check the capabilities */
|
|
if (!capable(CAP_SYS_TIME))
|
|
@@ -124,14 +124,14 @@ static long pps_cdev_ioctl(struct file *file,
|
|
if (err)
|
|
return -EFAULT;
|
|
if (!(params.mode & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR))) {
|
|
- dev_dbg(pps->dev, "capture mode unspecified (%x)\n",
|
|
+ dev_dbg(&pps->dev, "capture mode unspecified (%x)\n",
|
|
params.mode);
|
|
return -EINVAL;
|
|
}
|
|
|
|
/* Check for supported capabilities */
|
|
if ((params.mode & ~pps->info.mode) != 0) {
|
|
- dev_dbg(pps->dev, "unsupported capabilities (%x)\n",
|
|
+ dev_dbg(&pps->dev, "unsupported capabilities (%x)\n",
|
|
params.mode);
|
|
return -EINVAL;
|
|
}
|
|
@@ -144,7 +144,7 @@ static long pps_cdev_ioctl(struct file *file,
|
|
/* Restore the read only parameters */
|
|
if ((params.mode & (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) == 0) {
|
|
/* section 3.3 of RFC 2783 interpreted */
|
|
- dev_dbg(pps->dev, "time format unspecified (%x)\n",
|
|
+ dev_dbg(&pps->dev, "time format unspecified (%x)\n",
|
|
params.mode);
|
|
pps->params.mode |= PPS_TSFMT_TSPEC;
|
|
}
|
|
@@ -165,7 +165,7 @@ static long pps_cdev_ioctl(struct file *file,
|
|
break;
|
|
|
|
case PPS_GETCAP:
|
|
- dev_dbg(pps->dev, "PPS_GETCAP\n");
|
|
+ dev_dbg(&pps->dev, "PPS_GETCAP\n");
|
|
|
|
err = put_user(pps->info.mode, iuarg);
|
|
if (err)
|
|
@@ -176,7 +176,7 @@ static long pps_cdev_ioctl(struct file *file,
|
|
case PPS_FETCH: {
|
|
struct pps_fdata fdata;
|
|
|
|
- dev_dbg(pps->dev, "PPS_FETCH\n");
|
|
+ dev_dbg(&pps->dev, "PPS_FETCH\n");
|
|
|
|
err = copy_from_user(&fdata, uarg, sizeof(struct pps_fdata));
|
|
if (err)
|
|
@@ -206,7 +206,7 @@ static long pps_cdev_ioctl(struct file *file,
|
|
case PPS_KC_BIND: {
|
|
struct pps_bind_args bind_args;
|
|
|
|
- dev_dbg(pps->dev, "PPS_KC_BIND\n");
|
|
+ dev_dbg(&pps->dev, "PPS_KC_BIND\n");
|
|
|
|
/* Check the capabilities */
|
|
if (!capable(CAP_SYS_TIME))
|
|
@@ -218,7 +218,7 @@ static long pps_cdev_ioctl(struct file *file,
|
|
|
|
/* Check for supported capabilities */
|
|
if ((bind_args.edge & ~pps->info.mode) != 0) {
|
|
- dev_err(pps->dev, "unsupported capabilities (%x)\n",
|
|
+ dev_err(&pps->dev, "unsupported capabilities (%x)\n",
|
|
bind_args.edge);
|
|
return -EINVAL;
|
|
}
|
|
@@ -227,7 +227,7 @@ static long pps_cdev_ioctl(struct file *file,
|
|
if (bind_args.tsformat != PPS_TSFMT_TSPEC ||
|
|
(bind_args.edge & ~PPS_CAPTUREBOTH) != 0 ||
|
|
bind_args.consumer != PPS_KC_HARDPPS) {
|
|
- dev_err(pps->dev, "invalid kernel consumer bind"
|
|
+ dev_err(&pps->dev, "invalid kernel consumer bind"
|
|
" parameters (%x)\n", bind_args.edge);
|
|
return -EINVAL;
|
|
}
|
|
@@ -259,7 +259,7 @@ static long pps_cdev_compat_ioctl(struct file *file,
|
|
struct pps_fdata fdata;
|
|
int err;
|
|
|
|
- dev_dbg(pps->dev, "PPS_FETCH\n");
|
|
+ dev_dbg(&pps->dev, "PPS_FETCH\n");
|
|
|
|
err = copy_from_user(&compat, uarg, sizeof(struct pps_fdata_compat));
|
|
if (err)
|
|
@@ -296,20 +296,36 @@ static long pps_cdev_compat_ioctl(struct file *file,
|
|
#define pps_cdev_compat_ioctl NULL
|
|
#endif
|
|
|
|
+static struct pps_device *pps_idr_get(unsigned long id)
|
|
+{
|
|
+ struct pps_device *pps;
|
|
+
|
|
+ mutex_lock(&pps_idr_lock);
|
|
+ pps = idr_find(&pps_idr, id);
|
|
+ if (pps)
|
|
+ get_device(&pps->dev);
|
|
+
|
|
+ mutex_unlock(&pps_idr_lock);
|
|
+ return pps;
|
|
+}
|
|
+
|
|
static int pps_cdev_open(struct inode *inode, struct file *file)
|
|
{
|
|
- struct pps_device *pps = container_of(inode->i_cdev,
|
|
- struct pps_device, cdev);
|
|
+ struct pps_device *pps = pps_idr_get(iminor(inode));
|
|
+
|
|
+ if (!pps)
|
|
+ return -ENODEV;
|
|
+
|
|
file->private_data = pps;
|
|
- kobject_get(&pps->dev->kobj);
|
|
return 0;
|
|
}
|
|
|
|
static int pps_cdev_release(struct inode *inode, struct file *file)
|
|
{
|
|
- struct pps_device *pps = container_of(inode->i_cdev,
|
|
- struct pps_device, cdev);
|
|
- kobject_put(&pps->dev->kobj);
|
|
+ struct pps_device *pps = file->private_data;
|
|
+
|
|
+ WARN_ON(pps->id != iminor(inode));
|
|
+ put_device(&pps->dev);
|
|
return 0;
|
|
}
|
|
|
|
@@ -332,22 +348,13 @@ static void pps_device_destruct(struct device *dev)
|
|
{
|
|
struct pps_device *pps = dev_get_drvdata(dev);
|
|
|
|
- cdev_del(&pps->cdev);
|
|
-
|
|
- /* Now we can release the ID for re-use */
|
|
pr_debug("deallocating pps%d\n", pps->id);
|
|
- mutex_lock(&pps_idr_lock);
|
|
- idr_remove(&pps_idr, pps->id);
|
|
- mutex_unlock(&pps_idr_lock);
|
|
-
|
|
- kfree(dev);
|
|
kfree(pps);
|
|
}
|
|
|
|
int pps_register_cdev(struct pps_device *pps)
|
|
{
|
|
int err;
|
|
- dev_t devt;
|
|
|
|
mutex_lock(&pps_idr_lock);
|
|
/*
|
|
@@ -364,40 +371,29 @@ int pps_register_cdev(struct pps_device *pps)
|
|
goto out_unlock;
|
|
}
|
|
pps->id = err;
|
|
- mutex_unlock(&pps_idr_lock);
|
|
-
|
|
- devt = MKDEV(MAJOR(pps_devt), pps->id);
|
|
-
|
|
- cdev_init(&pps->cdev, &pps_cdev_fops);
|
|
- pps->cdev.owner = pps->info.owner;
|
|
|
|
- err = cdev_add(&pps->cdev, devt, 1);
|
|
- if (err) {
|
|
- pr_err("%s: failed to add char device %d:%d\n",
|
|
- pps->info.name, MAJOR(pps_devt), pps->id);
|
|
+ pps->dev.class = pps_class;
|
|
+ pps->dev.parent = pps->info.dev;
|
|
+ pps->dev.devt = MKDEV(pps_major, pps->id);
|
|
+ dev_set_drvdata(&pps->dev, pps);
|
|
+ dev_set_name(&pps->dev, "pps%d", pps->id);
|
|
+ err = device_register(&pps->dev);
|
|
+ if (err)
|
|
goto free_idr;
|
|
- }
|
|
- pps->dev = device_create(pps_class, pps->info.dev, devt, pps,
|
|
- "pps%d", pps->id);
|
|
- if (IS_ERR(pps->dev)) {
|
|
- err = PTR_ERR(pps->dev);
|
|
- goto del_cdev;
|
|
- }
|
|
|
|
/* Override the release function with our own */
|
|
- pps->dev->release = pps_device_destruct;
|
|
+ pps->dev.release = pps_device_destruct;
|
|
|
|
- pr_debug("source %s got cdev (%d:%d)\n", pps->info.name,
|
|
- MAJOR(pps_devt), pps->id);
|
|
+ pr_debug("source %s got cdev (%d:%d)\n", pps->info.name, pps_major,
|
|
+ pps->id);
|
|
|
|
+ get_device(&pps->dev);
|
|
+ mutex_unlock(&pps_idr_lock);
|
|
return 0;
|
|
|
|
-del_cdev:
|
|
- cdev_del(&pps->cdev);
|
|
-
|
|
free_idr:
|
|
- mutex_lock(&pps_idr_lock);
|
|
idr_remove(&pps_idr, pps->id);
|
|
+ put_device(&pps->dev);
|
|
out_unlock:
|
|
mutex_unlock(&pps_idr_lock);
|
|
return err;
|
|
@@ -407,7 +403,13 @@ void pps_unregister_cdev(struct pps_device *pps)
|
|
{
|
|
pr_debug("unregistering pps%d\n", pps->id);
|
|
pps->lookup_cookie = NULL;
|
|
- device_destroy(pps_class, pps->dev->devt);
|
|
+ device_destroy(pps_class, pps->dev.devt);
|
|
+
|
|
+ /* Now we can release the ID for re-use */
|
|
+ mutex_lock(&pps_idr_lock);
|
|
+ idr_remove(&pps_idr, pps->id);
|
|
+ put_device(&pps->dev);
|
|
+ mutex_unlock(&pps_idr_lock);
|
|
}
|
|
|
|
/*
|
|
@@ -427,6 +429,11 @@ void pps_unregister_cdev(struct pps_device *pps)
|
|
* so that it will not be used again, even if the pps device cannot
|
|
* be removed from the idr due to pending references holding the minor
|
|
* number in use.
|
|
+ *
|
|
+ * Since pps_idr holds a reference to the device, the returned
|
|
+ * pps_device is guaranteed to be valid until pps_unregister_cdev() is
|
|
+ * called on it. But after calling pps_unregister_cdev(), it may be
|
|
+ * freed at any time.
|
|
*/
|
|
struct pps_device *pps_lookup_dev(void const *cookie)
|
|
{
|
|
@@ -449,13 +456,11 @@ EXPORT_SYMBOL(pps_lookup_dev);
|
|
static void __exit pps_exit(void)
|
|
{
|
|
class_destroy(pps_class);
|
|
- unregister_chrdev_region(pps_devt, PPS_MAX_SOURCES);
|
|
+ __unregister_chrdev(pps_major, 0, PPS_MAX_SOURCES, "pps");
|
|
}
|
|
|
|
static int __init pps_init(void)
|
|
{
|
|
- int err;
|
|
-
|
|
pps_class = class_create("pps");
|
|
if (IS_ERR(pps_class)) {
|
|
pr_err("failed to allocate class\n");
|
|
@@ -463,8 +468,9 @@ static int __init pps_init(void)
|
|
}
|
|
pps_class->dev_groups = pps_groups;
|
|
|
|
- err = alloc_chrdev_region(&pps_devt, 0, PPS_MAX_SOURCES, "pps");
|
|
- if (err < 0) {
|
|
+ pps_major = __register_chrdev(0, 0, PPS_MAX_SOURCES, "pps",
|
|
+ &pps_cdev_fops);
|
|
+ if (pps_major < 0) {
|
|
pr_err("failed to allocate char device region\n");
|
|
goto remove_class;
|
|
}
|
|
@@ -477,8 +483,7 @@ static int __init pps_init(void)
|
|
|
|
remove_class:
|
|
class_destroy(pps_class);
|
|
-
|
|
- return err;
|
|
+ return pps_major;
|
|
}
|
|
|
|
subsys_initcall(pps_init);
|
|
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
|
|
index 91cc6ffa0095e0..6f6019fb41c0c4 100644
|
|
--- a/drivers/ptp/ptp_chardev.c
|
|
+++ b/drivers/ptp/ptp_chardev.c
|
|
@@ -4,6 +4,7 @@
|
|
*
|
|
* Copyright (C) 2010 OMICRON electronics GmbH
|
|
*/
|
|
+#include <linux/compat.h>
|
|
#include <linux/module.h>
|
|
#include <linux/posix-clock.h>
|
|
#include <linux/poll.h>
|
|
@@ -124,6 +125,9 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
|
|
struct timespec64 ts;
|
|
int enable, err = 0;
|
|
|
|
+ if (in_compat_syscall() && cmd != PTP_ENABLE_PPS && cmd != PTP_ENABLE_PPS2)
|
|
+ arg = (unsigned long)compat_ptr(arg);
|
|
+
|
|
switch (cmd) {
|
|
|
|
case PTP_CLOCK_GETCAPS:
|
|
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
|
|
index a7a6947ab4bc59..13343c31987706 100644
|
|
--- a/drivers/ptp/ptp_ocp.c
|
|
+++ b/drivers/ptp/ptp_ocp.c
|
|
@@ -4055,7 +4055,7 @@ ptp_ocp_complete(struct ptp_ocp *bp)
|
|
|
|
pps = pps_lookup_dev(bp->ptp);
|
|
if (pps)
|
|
- ptp_ocp_symlink(bp, pps->dev, "pps");
|
|
+ ptp_ocp_symlink(bp, &pps->dev, "pps");
|
|
|
|
ptp_ocp_debugfs_add_device(bp);
|
|
|
|
diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c
|
|
index e8828f57ab1502..7d0966b07dffbf 100644
|
|
--- a/drivers/pwm/pwm-samsung.c
|
|
+++ b/drivers/pwm/pwm-samsung.c
|
|
@@ -521,8 +521,6 @@ static int pwm_samsung_parse_dt(struct samsung_pwm_chip *chip)
|
|
{
|
|
struct device_node *np = chip->chip.dev->of_node;
|
|
const struct of_device_id *match;
|
|
- struct property *prop;
|
|
- const __be32 *cur;
|
|
u32 val;
|
|
|
|
match = of_match_node(samsung_pwm_matches, np);
|
|
@@ -531,7 +529,7 @@ static int pwm_samsung_parse_dt(struct samsung_pwm_chip *chip)
|
|
|
|
memcpy(&chip->variant, match->data, sizeof(chip->variant));
|
|
|
|
- of_property_for_each_u32(np, "samsung,pwm-outputs", prop, cur, val) {
|
|
+ of_property_for_each_u32(np, "samsung,pwm-outputs", val) {
|
|
if (val >= SAMSUNG_PWM_NUM) {
|
|
dev_err(chip->chip.dev,
|
|
"%s: invalid channel index in samsung,pwm-outputs property\n",
|
|
diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c
|
|
index bb3a045a733430..7799258638dfa9 100644
|
|
--- a/drivers/pwm/pwm-stm32-lp.c
|
|
+++ b/drivers/pwm/pwm-stm32-lp.c
|
|
@@ -168,8 +168,12 @@ static int stm32_pwm_lp_get_state(struct pwm_chip *chip,
|
|
regmap_read(priv->regmap, STM32_LPTIM_CR, &val);
|
|
state->enabled = !!FIELD_GET(STM32_LPTIM_ENABLE, val);
|
|
/* Keep PWM counter clock refcount in sync with PWM initial state */
|
|
- if (state->enabled)
|
|
- clk_enable(priv->clk);
|
|
+ if (state->enabled) {
|
|
+ int ret = clk_enable(priv->clk);
|
|
+
|
|
+ if (ret)
|
|
+ return ret;
|
|
+ }
|
|
|
|
regmap_read(priv->regmap, STM32_LPTIM_CFGR, &val);
|
|
presc = FIELD_GET(STM32_LPTIM_PRESC, val);
|
|
diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
|
|
index b91a14c895bea8..67414b97ef4d27 100644
|
|
--- a/drivers/pwm/pwm-stm32.c
|
|
+++ b/drivers/pwm/pwm-stm32.c
|
|
@@ -635,8 +635,11 @@ static int stm32_pwm_probe(struct platform_device *pdev)
|
|
priv->chip.npwm = stm32_pwm_detect_channels(priv, &num_enabled);
|
|
|
|
/* Initialize clock refcount to number of enabled PWM channels. */
|
|
- for (i = 0; i < num_enabled; i++)
|
|
- clk_enable(priv->clk);
|
|
+ for (i = 0; i < num_enabled; i++) {
|
|
+ ret = clk_enable(priv->clk);
|
|
+ if (ret)
|
|
+ return ret;
|
|
+ }
|
|
|
|
ret = devm_pwmchip_add(dev, &priv->chip);
|
|
if (ret < 0)
|
|
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
|
|
index c96bf095695fd8..352131d2df4cad 100644
|
|
--- a/drivers/regulator/core.c
|
|
+++ b/drivers/regulator/core.c
|
|
@@ -4876,7 +4876,7 @@ int _regulator_bulk_get(struct device *dev, int num_consumers,
|
|
consumers[i].supply, get_type);
|
|
if (IS_ERR(consumers[i].consumer)) {
|
|
ret = dev_err_probe(dev, PTR_ERR(consumers[i].consumer),
|
|
- "Failed to get supply '%s'",
|
|
+ "Failed to get supply '%s'\n",
|
|
consumers[i].supply);
|
|
consumers[i].consumer = NULL;
|
|
goto err;
|
|
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
|
|
index 59e71fd0db4390..f23c12f4ffbfad 100644
|
|
--- a/drivers/regulator/of_regulator.c
|
|
+++ b/drivers/regulator/of_regulator.c
|
|
@@ -435,7 +435,7 @@ int of_regulator_match(struct device *dev, struct device_node *node,
|
|
"failed to parse DT for regulator %pOFn\n",
|
|
child);
|
|
of_node_put(child);
|
|
- return -EINVAL;
|
|
+ goto err_put;
|
|
}
|
|
match->of_node = of_node_get(child);
|
|
count++;
|
|
@@ -444,6 +444,18 @@ int of_regulator_match(struct device *dev, struct device_node *node,
|
|
}
|
|
|
|
return count;
|
|
+
|
|
+err_put:
|
|
+ for (i = 0; i < num_matches; i++) {
|
|
+ struct of_regulator_match *match = &matches[i];
|
|
+
|
|
+ match->init_data = NULL;
|
|
+ if (match->of_node) {
|
|
+ of_node_put(match->of_node);
|
|
+ match->of_node = NULL;
|
|
+ }
|
|
+ }
|
|
+ return -EINVAL;
|
|
}
|
|
EXPORT_SYMBOL_GPL(of_regulator_match);
|
|
|
|
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
|
|
index 695cce218e8c64..e230af51a99b9f 100644
|
|
--- a/drivers/remoteproc/remoteproc_core.c
|
|
+++ b/drivers/remoteproc/remoteproc_core.c
|
|
@@ -2465,6 +2465,13 @@ struct rproc *rproc_alloc(struct device *dev, const char *name,
|
|
rproc->dev.driver_data = rproc;
|
|
idr_init(&rproc->notifyids);
|
|
|
|
+ /* Assign a unique device index and name */
|
|
+ rproc->index = ida_alloc(&rproc_dev_index, GFP_KERNEL);
|
|
+ if (rproc->index < 0) {
|
|
+ dev_err(dev, "ida_alloc failed: %d\n", rproc->index);
|
|
+ goto put_device;
|
|
+ }
|
|
+
|
|
rproc->name = kstrdup_const(name, GFP_KERNEL);
|
|
if (!rproc->name)
|
|
goto put_device;
|
|
@@ -2475,13 +2482,6 @@ struct rproc *rproc_alloc(struct device *dev, const char *name,
|
|
if (rproc_alloc_ops(rproc, ops))
|
|
goto put_device;
|
|
|
|
- /* Assign a unique device index and name */
|
|
- rproc->index = ida_alloc(&rproc_dev_index, GFP_KERNEL);
|
|
- if (rproc->index < 0) {
|
|
- dev_err(dev, "ida_alloc failed: %d\n", rproc->index);
|
|
- goto put_device;
|
|
- }
|
|
-
|
|
dev_set_name(&rproc->dev, "remoteproc%d", rproc->index);
|
|
|
|
atomic_set(&rproc->power, 0);
|
|
diff --git a/drivers/rtc/rtc-loongson.c b/drivers/rtc/rtc-loongson.c
|
|
index e8ffc1ab90b02f..90e9d97a86b487 100644
|
|
--- a/drivers/rtc/rtc-loongson.c
|
|
+++ b/drivers/rtc/rtc-loongson.c
|
|
@@ -114,6 +114,13 @@ static irqreturn_t loongson_rtc_isr(int irq, void *id)
|
|
struct loongson_rtc_priv *priv = (struct loongson_rtc_priv *)id;
|
|
|
|
rtc_update_irq(priv->rtcdev, 1, RTC_AF | RTC_IRQF);
|
|
+
|
|
+ /*
|
|
+ * The TOY_MATCH0_REG should be cleared 0 here,
|
|
+ * otherwise the interrupt cannot be cleared.
|
|
+ */
|
|
+ regmap_write(priv->regmap, TOY_MATCH0_REG, 0);
|
|
+
|
|
return IRQ_HANDLED;
|
|
}
|
|
|
|
@@ -131,11 +138,7 @@ static u32 loongson_rtc_handler(void *id)
|
|
writel(RTC_STS, priv->pm_base + PM1_STS_REG);
|
|
spin_unlock(&priv->lock);
|
|
|
|
- /*
|
|
- * The TOY_MATCH0_REG should be cleared 0 here,
|
|
- * otherwise the interrupt cannot be cleared.
|
|
- */
|
|
- return regmap_write(priv->regmap, TOY_MATCH0_REG, 0);
|
|
+ return ACPI_INTERRUPT_HANDLED;
|
|
}
|
|
|
|
static int loongson_rtc_set_enabled(struct device *dev)
|
|
diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
|
|
index fdbc07f14036af..905986c616559b 100644
|
|
--- a/drivers/rtc/rtc-pcf85063.c
|
|
+++ b/drivers/rtc/rtc-pcf85063.c
|
|
@@ -322,7 +322,16 @@ static const struct rtc_class_ops pcf85063_rtc_ops = {
|
|
static int pcf85063_nvmem_read(void *priv, unsigned int offset,
|
|
void *val, size_t bytes)
|
|
{
|
|
- return regmap_read(priv, PCF85063_REG_RAM, val);
|
|
+ unsigned int tmp;
|
|
+ int ret;
|
|
+
|
|
+ ret = regmap_read(priv, PCF85063_REG_RAM, &tmp);
|
|
+ if (ret < 0)
|
|
+ return ret;
|
|
+
|
|
+ *(u8 *)val = tmp;
|
|
+
|
|
+ return 0;
|
|
}
|
|
|
|
static int pcf85063_nvmem_write(void *priv, unsigned int offset,
|
|
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
|
|
index a5d12b95fbd09f..cd00f196703551 100644
|
|
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
|
|
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
|
|
@@ -5638,8 +5638,7 @@ _base_static_config_pages(struct MPT3SAS_ADAPTER *ioc)
|
|
if (!ioc->is_gen35_ioc && ioc->manu_pg11.EEDPTagMode == 0) {
|
|
pr_err("%s: overriding NVDATA EEDPTagMode setting\n",
|
|
ioc->name);
|
|
- ioc->manu_pg11.EEDPTagMode &= ~0x3;
|
|
- ioc->manu_pg11.EEDPTagMode |= 0x1;
|
|
+ ioc->manu_pg11.EEDPTagMode = 0x1;
|
|
mpt3sas_config_set_manufacturing_pg11(ioc, &mpi_reply,
|
|
&ioc->manu_pg11);
|
|
}
|
|
diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c
|
|
index cc9a3e107479ab..c892c7083ecc9c 100644
|
|
--- a/drivers/soc/atmel/soc.c
|
|
+++ b/drivers/soc/atmel/soc.c
|
|
@@ -376,7 +376,7 @@ static const struct of_device_id at91_soc_allowed_list[] __initconst = {
|
|
|
|
static int __init atmel_soc_device_init(void)
|
|
{
|
|
- struct device_node *np = of_find_node_by_path("/");
|
|
+ struct device_node *np __free(device_node) = of_find_node_by_path("/");
|
|
|
|
if (!of_match_node(at91_soc_allowed_list, np))
|
|
return 0;
|
|
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
|
|
index 3cfd262c1abc25..35ca8fda45aae3 100644
|
|
--- a/drivers/spi/spi-omap2-mcspi.c
|
|
+++ b/drivers/spi/spi-omap2-mcspi.c
|
|
@@ -1521,10 +1521,15 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
|
|
}
|
|
|
|
mcspi->ref_clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
|
|
- if (IS_ERR(mcspi->ref_clk))
|
|
- mcspi->ref_clk_hz = OMAP2_MCSPI_MAX_FREQ;
|
|
- else
|
|
+ if (IS_ERR(mcspi->ref_clk)) {
|
|
+ status = PTR_ERR(mcspi->ref_clk);
|
|
+ dev_err_probe(&pdev->dev, status, "Failed to get ref_clk");
|
|
+ goto free_ctlr;
|
|
+ }
|
|
+ if (mcspi->ref_clk)
|
|
mcspi->ref_clk_hz = clk_get_rate(mcspi->ref_clk);
|
|
+ else
|
|
+ mcspi->ref_clk_hz = OMAP2_MCSPI_MAX_FREQ;
|
|
ctlr->max_speed_hz = mcspi->ref_clk_hz;
|
|
ctlr->min_speed_hz = mcspi->ref_clk_hz >> 15;
|
|
|
|
diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
|
|
index 0db69a2a72ffcb..9358c75a30f440 100644
|
|
--- a/drivers/spi/spi-zynq-qspi.c
|
|
+++ b/drivers/spi/spi-zynq-qspi.c
|
|
@@ -379,12 +379,21 @@ static int zynq_qspi_setup_op(struct spi_device *spi)
|
|
{
|
|
struct spi_controller *ctlr = spi->master;
|
|
struct zynq_qspi *qspi = spi_controller_get_devdata(ctlr);
|
|
+ int ret;
|
|
|
|
if (ctlr->busy)
|
|
return -EBUSY;
|
|
|
|
- clk_enable(qspi->refclk);
|
|
- clk_enable(qspi->pclk);
|
|
+ ret = clk_enable(qspi->refclk);
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ ret = clk_enable(qspi->pclk);
|
|
+ if (ret) {
|
|
+ clk_disable(qspi->refclk);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
zynq_qspi_write(qspi, ZYNQ_QSPI_ENABLE_OFFSET,
|
|
ZYNQ_QSPI_ENABLE_ENABLE_MASK);
|
|
|
|
diff --git a/drivers/staging/media/imx/imx-media-of.c b/drivers/staging/media/imx/imx-media-of.c
|
|
index 118bff988bc7e6..bb28daa4d71334 100644
|
|
--- a/drivers/staging/media/imx/imx-media-of.c
|
|
+++ b/drivers/staging/media/imx/imx-media-of.c
|
|
@@ -54,22 +54,18 @@ int imx_media_add_of_subdevs(struct imx_media_dev *imxmd,
|
|
break;
|
|
|
|
ret = imx_media_of_add_csi(imxmd, csi_np);
|
|
+ of_node_put(csi_np);
|
|
if (ret) {
|
|
/* unavailable or already added is not an error */
|
|
if (ret == -ENODEV || ret == -EEXIST) {
|
|
- of_node_put(csi_np);
|
|
continue;
|
|
}
|
|
|
|
/* other error, can't continue */
|
|
- goto err_out;
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
-
|
|
-err_out:
|
|
- of_node_put(csi_np);
|
|
- return ret;
|
|
}
|
|
EXPORT_SYMBOL_GPL(imx_media_add_of_subdevs);
|
|
diff --git a/drivers/staging/media/max96712/max96712.c b/drivers/staging/media/max96712/max96712.c
|
|
index c44145284aa18f..edaa311d2009e1 100644
|
|
--- a/drivers/staging/media/max96712/max96712.c
|
|
+++ b/drivers/staging/media/max96712/max96712.c
|
|
@@ -402,7 +402,6 @@ static int max96712_probe(struct i2c_client *client)
|
|
return -ENOMEM;
|
|
|
|
priv->client = client;
|
|
- i2c_set_clientdata(client, priv);
|
|
|
|
priv->regmap = devm_regmap_init_i2c(client, &max96712_i2c_regmap);
|
|
if (IS_ERR(priv->regmap))
|
|
@@ -435,7 +434,8 @@ static int max96712_probe(struct i2c_client *client)
|
|
|
|
static void max96712_remove(struct i2c_client *client)
|
|
{
|
|
- struct max96712_priv *priv = i2c_get_clientdata(client);
|
|
+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
|
|
+ struct max96712_priv *priv = container_of(sd, struct max96712_priv, sd);
|
|
|
|
v4l2_async_unregister_subdev(&priv->sd);
|
|
|
|
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
|
|
index a17803da83f8cd..2b1b2928ef7b7c 100644
|
|
--- a/drivers/tty/serial/8250/8250_port.c
|
|
+++ b/drivers/tty/serial/8250/8250_port.c
|
|
@@ -2074,7 +2074,8 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state)
|
|
serial8250_rpm_put(up);
|
|
}
|
|
|
|
-static void wait_for_lsr(struct uart_8250_port *up, int bits)
|
|
+/* Returns true if @bits were set, false on timeout */
|
|
+static bool wait_for_lsr(struct uart_8250_port *up, int bits)
|
|
{
|
|
unsigned int status, tmout = 10000;
|
|
|
|
@@ -2089,11 +2090,11 @@ static void wait_for_lsr(struct uart_8250_port *up, int bits)
|
|
udelay(1);
|
|
touch_nmi_watchdog();
|
|
}
|
|
+
|
|
+ return (tmout != 0);
|
|
}
|
|
|
|
-/*
|
|
- * Wait for transmitter & holding register to empty
|
|
- */
|
|
+/* Wait for transmitter and holding register to empty with timeout */
|
|
static void wait_for_xmitr(struct uart_8250_port *up, int bits)
|
|
{
|
|
unsigned int tmout;
|
|
@@ -3350,6 +3351,16 @@ static void serial8250_console_restore(struct uart_8250_port *up)
|
|
serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS);
|
|
}
|
|
|
|
+static void fifo_wait_for_lsr(struct uart_8250_port *up, unsigned int count)
|
|
+{
|
|
+ unsigned int i;
|
|
+
|
|
+ for (i = 0; i < count; i++) {
|
|
+ if (wait_for_lsr(up, UART_LSR_THRE))
|
|
+ return;
|
|
+ }
|
|
+}
|
|
+
|
|
/*
|
|
* Print a string to the serial port using the device FIFO
|
|
*
|
|
@@ -3359,13 +3370,15 @@ static void serial8250_console_restore(struct uart_8250_port *up)
|
|
static void serial8250_console_fifo_write(struct uart_8250_port *up,
|
|
const char *s, unsigned int count)
|
|
{
|
|
- int i;
|
|
const char *end = s + count;
|
|
unsigned int fifosize = up->tx_loadsz;
|
|
+ unsigned int tx_count = 0;
|
|
bool cr_sent = false;
|
|
+ unsigned int i;
|
|
|
|
while (s != end) {
|
|
- wait_for_lsr(up, UART_LSR_THRE);
|
|
+ /* Allow timeout for each byte of a possibly full FIFO */
|
|
+ fifo_wait_for_lsr(up, fifosize);
|
|
|
|
for (i = 0; i < fifosize && s != end; ++i) {
|
|
if (*s == '\n' && !cr_sent) {
|
|
@@ -3376,7 +3389,14 @@ static void serial8250_console_fifo_write(struct uart_8250_port *up,
|
|
cr_sent = false;
|
|
}
|
|
}
|
|
+ tx_count = i;
|
|
}
|
|
+
|
|
+ /*
|
|
+ * Allow timeout for each byte written since the caller will only wait
|
|
+ * for UART_LSR_BOTH_EMPTY using the timeout of a single character
|
|
+ */
|
|
+ fifo_wait_for_lsr(up, tx_count);
|
|
}
|
|
|
|
/*
|
|
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
|
|
index f290fbe21d633e..8a2ce2ca6b394a 100644
|
|
--- a/drivers/tty/serial/sc16is7xx.c
|
|
+++ b/drivers/tty/serial/sc16is7xx.c
|
|
@@ -1410,6 +1410,29 @@ static int sc16is7xx_setup_gpio_chip(struct sc16is7xx_port *s)
|
|
}
|
|
#endif
|
|
|
|
+static void sc16is7xx_setup_irda_ports(struct sc16is7xx_port *s)
|
|
+{
|
|
+ int i;
|
|
+ int ret;
|
|
+ int count;
|
|
+ u32 irda_port[2];
|
|
+ struct device *dev = s->p[0].port.dev;
|
|
+
|
|
+ count = device_property_count_u32(dev, "irda-mode-ports");
|
|
+ if (count < 0 || count > ARRAY_SIZE(irda_port))
|
|
+ return;
|
|
+
|
|
+ ret = device_property_read_u32_array(dev, "irda-mode-ports",
|
|
+ irda_port, count);
|
|
+ if (ret)
|
|
+ return;
|
|
+
|
|
+ for (i = 0; i < count; i++) {
|
|
+ if (irda_port[i] < s->devtype->nr_uart)
|
|
+ s->p[irda_port[i]].irda_mode = true;
|
|
+ }
|
|
+}
|
|
+
|
|
/*
|
|
* Configure ports designated to operate as modem control lines.
|
|
*/
|
|
@@ -1603,16 +1626,7 @@ static int sc16is7xx_probe(struct device *dev,
|
|
sc16is7xx_power(&s->p[i].port, 0);
|
|
}
|
|
|
|
- if (dev->of_node) {
|
|
- struct property *prop;
|
|
- const __be32 *p;
|
|
- u32 u;
|
|
-
|
|
- of_property_for_each_u32(dev->of_node, "irda-mode-ports",
|
|
- prop, p, u)
|
|
- if (u < devtype->nr_uart)
|
|
- s->p[u].irda_mode = true;
|
|
- }
|
|
+ sc16is7xx_setup_irda_ports(s);
|
|
|
|
ret = sc16is7xx_setup_mctrl_ports(s, regmaps[0]);
|
|
if (ret)
|
|
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
|
|
index 6b4a28bcf2f5f5..5a314f5d7630a8 100644
|
|
--- a/drivers/tty/sysrq.c
|
|
+++ b/drivers/tty/sysrq.c
|
|
@@ -759,8 +759,6 @@ static void sysrq_of_get_keyreset_config(void)
|
|
{
|
|
u32 key;
|
|
struct device_node *np;
|
|
- struct property *prop;
|
|
- const __be32 *p;
|
|
|
|
np = of_find_node_by_path("/chosen/linux,sysrq-reset-seq");
|
|
if (!np) {
|
|
@@ -771,7 +769,7 @@ static void sysrq_of_get_keyreset_config(void)
|
|
/* Reset in case a __weak definition was present */
|
|
sysrq_reset_seq_len = 0;
|
|
|
|
- of_property_for_each_u32(np, "keyset", prop, p, key) {
|
|
+ of_property_for_each_u32(np, "keyset", key) {
|
|
if (key == KEY_RESERVED || key > KEY_MAX ||
|
|
sysrq_reset_seq_len == SYSRQ_KEY_RESET_MAX)
|
|
break;
|
|
diff --git a/drivers/ufs/core/ufs_bsg.c b/drivers/ufs/core/ufs_bsg.c
|
|
index fec5993c66c39a..f21423a7a6d7db 100644
|
|
--- a/drivers/ufs/core/ufs_bsg.c
|
|
+++ b/drivers/ufs/core/ufs_bsg.c
|
|
@@ -256,6 +256,7 @@ int ufs_bsg_probe(struct ufs_hba *hba)
|
|
q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), ufs_bsg_request, NULL, 0);
|
|
if (IS_ERR(q)) {
|
|
ret = PTR_ERR(q);
|
|
+ device_del(bsg_dev);
|
|
goto out;
|
|
}
|
|
|
|
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
|
|
index fcb509059d7c49..318ae24a41f482 100644
|
|
--- a/drivers/usb/dwc3/core.c
|
|
+++ b/drivers/usb/dwc3/core.c
|
|
@@ -1505,8 +1505,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
|
|
u8 tx_thr_num_pkt_prd = 0;
|
|
u8 tx_max_burst_prd = 0;
|
|
u8 tx_fifo_resize_max_num;
|
|
- const char *usb_psy_name;
|
|
- int ret;
|
|
|
|
/* default to highest possible threshold */
|
|
lpm_nyet_threshold = 0xf;
|
|
@@ -1541,13 +1539,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
|
|
|
|
dwc->sys_wakeup = device_may_wakeup(dwc->sysdev);
|
|
|
|
- ret = device_property_read_string(dev, "usb-psy-name", &usb_psy_name);
|
|
- if (ret >= 0) {
|
|
- dwc->usb_psy = power_supply_get_by_name(usb_psy_name);
|
|
- if (!dwc->usb_psy)
|
|
- dev_err(dev, "couldn't get usb power supply\n");
|
|
- }
|
|
-
|
|
dwc->has_lpm_erratum = device_property_read_bool(dev,
|
|
"snps,has-lpm-erratum");
|
|
device_property_read_u8(dev, "snps,lpm-nyet-threshold",
|
|
@@ -1887,6 +1878,23 @@ static int dwc3_get_clocks(struct dwc3 *dwc)
|
|
return 0;
|
|
}
|
|
|
|
+static struct power_supply *dwc3_get_usb_power_supply(struct dwc3 *dwc)
|
|
+{
|
|
+ struct power_supply *usb_psy;
|
|
+ const char *usb_psy_name;
|
|
+ int ret;
|
|
+
|
|
+ ret = device_property_read_string(dwc->dev, "usb-psy-name", &usb_psy_name);
|
|
+ if (ret < 0)
|
|
+ return NULL;
|
|
+
|
|
+ usb_psy = power_supply_get_by_name(usb_psy_name);
|
|
+ if (!usb_psy)
|
|
+ return ERR_PTR(-EPROBE_DEFER);
|
|
+
|
|
+ return usb_psy;
|
|
+}
|
|
+
|
|
static int dwc3_probe(struct platform_device *pdev)
|
|
{
|
|
struct device *dev = &pdev->dev;
|
|
@@ -1940,6 +1948,10 @@ static int dwc3_probe(struct platform_device *pdev)
|
|
|
|
dwc3_get_properties(dwc);
|
|
|
|
+ dwc->usb_psy = dwc3_get_usb_power_supply(dwc);
|
|
+ if (IS_ERR(dwc->usb_psy))
|
|
+ return dev_err_probe(dev, PTR_ERR(dwc->usb_psy), "couldn't get usb power supply\n");
|
|
+
|
|
dwc->reset = devm_reset_control_array_get_optional_shared(dev);
|
|
if (IS_ERR(dwc->reset)) {
|
|
ret = PTR_ERR(dwc->reset);
|
|
diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
|
|
index 056ab7246a3a2c..47d9f56333fe8d 100644
|
|
--- a/drivers/usb/dwc3/dwc3-am62.c
|
|
+++ b/drivers/usb/dwc3/dwc3-am62.c
|
|
@@ -160,6 +160,7 @@ static int phy_syscon_pll_refclk(struct dwc3_am62 *am62)
|
|
if (ret)
|
|
return ret;
|
|
|
|
+ of_node_put(args.np);
|
|
am62->offset = args.args[0];
|
|
|
|
ret = regmap_update_bits(am62->syscon, am62->offset, PHY_PLL_REFCLK_MASK, am62->rate_code);
|
|
diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c
|
|
index 79ed2e6e576aab..8ac50b9155ac40 100644
|
|
--- a/drivers/usb/gadget/function/f_tcm.c
|
|
+++ b/drivers/usb/gadget/function/f_tcm.c
|
|
@@ -1066,7 +1066,6 @@ static void usbg_cmd_work(struct work_struct *work)
|
|
out:
|
|
transport_send_check_condition_and_sense(se_cmd,
|
|
TCM_UNSUPPORTED_SCSI_OPCODE, 1);
|
|
- transport_generic_free_cmd(&cmd->se_cmd, 0);
|
|
}
|
|
|
|
static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu,
|
|
@@ -1195,7 +1194,6 @@ static void bot_cmd_work(struct work_struct *work)
|
|
out:
|
|
transport_send_check_condition_and_sense(se_cmd,
|
|
TCM_UNSUPPORTED_SCSI_OPCODE, 1);
|
|
- transport_generic_free_cmd(&cmd->se_cmd, 0);
|
|
}
|
|
|
|
static int bot_submit_command(struct f_uas *fu,
|
|
@@ -2048,9 +2046,14 @@ static void tcm_delayed_set_alt(struct work_struct *wq)
|
|
|
|
static int tcm_get_alt(struct usb_function *f, unsigned intf)
|
|
{
|
|
- if (intf == bot_intf_desc.bInterfaceNumber)
|
|
+ struct f_uas *fu = to_f_uas(f);
|
|
+
|
|
+ if (fu->iface != intf)
|
|
+ return -EOPNOTSUPP;
|
|
+
|
|
+ if (fu->flags & USBG_IS_BOT)
|
|
return USB_G_ALT_INT_BBB;
|
|
- if (intf == uasp_intf_desc.bInterfaceNumber)
|
|
+ else if (fu->flags & USBG_IS_UAS)
|
|
return USB_G_ALT_INT_UAS;
|
|
|
|
return -EOPNOTSUPP;
|
|
@@ -2060,6 +2063,9 @@ static int tcm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
|
{
|
|
struct f_uas *fu = to_f_uas(f);
|
|
|
|
+ if (fu->iface != intf)
|
|
+ return -EOPNOTSUPP;
|
|
+
|
|
if ((alt == USB_G_ALT_INT_BBB) || (alt == USB_G_ALT_INT_UAS)) {
|
|
struct guas_setup_wq *work;
|
|
|
|
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
|
|
index 0d628af5c3ba50..4a081685a1953e 100644
|
|
--- a/drivers/usb/host/xhci-ring.c
|
|
+++ b/drivers/usb/host/xhci-ring.c
|
|
@@ -420,7 +420,8 @@ static void xhci_handle_stopped_cmd_ring(struct xhci_hcd *xhci,
|
|
if ((xhci->cmd_ring->dequeue != xhci->cmd_ring->enqueue) &&
|
|
!(xhci->xhc_state & XHCI_STATE_DYING)) {
|
|
xhci->current_cmd = cur_cmd;
|
|
- xhci_mod_cmd_timer(xhci);
|
|
+ if (cur_cmd)
|
|
+ xhci_mod_cmd_timer(xhci);
|
|
xhci_ring_cmd_db(xhci);
|
|
}
|
|
}
|
|
diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
|
|
index 7da404f55a6d90..3970bf9ca818af 100644
|
|
--- a/drivers/usb/misc/usb251xb.c
|
|
+++ b/drivers/usb/misc/usb251xb.c
|
|
@@ -382,11 +382,9 @@ static void usb251xb_get_ports_field(struct usb251xb *hub,
|
|
bool ds_only, u8 *fld)
|
|
{
|
|
struct device *dev = hub->dev;
|
|
- struct property *prop;
|
|
- const __be32 *p;
|
|
u32 port;
|
|
|
|
- of_property_for_each_u32(dev->of_node, prop_name, prop, p, port) {
|
|
+ of_property_for_each_u32(dev->of_node, prop_name, port) {
|
|
if ((port >= ds_only ? 1 : 0) && (port <= port_cnt))
|
|
*fld |= BIT(port);
|
|
else
|
|
diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
|
|
index 7118551827f6a2..31ce2071224562 100644
|
|
--- a/drivers/usb/typec/tcpm/tcpci.c
|
|
+++ b/drivers/usb/typec/tcpm/tcpci.c
|
|
@@ -26,6 +26,7 @@
|
|
#define VPPS_NEW_MIN_PERCENT 95
|
|
#define VPPS_VALID_MIN_MV 100
|
|
#define VSINKDISCONNECT_PD_MIN_PERCENT 90
|
|
+#define VPPS_SHUTDOWN_MIN_PERCENT 85
|
|
|
|
struct tcpci {
|
|
struct device *dev;
|
|
@@ -337,7 +338,8 @@ static int tcpci_enable_auto_vbus_discharge(struct tcpc_dev *dev, bool enable)
|
|
}
|
|
|
|
static int tcpci_set_auto_vbus_discharge_threshold(struct tcpc_dev *dev, enum typec_pwr_opmode mode,
|
|
- bool pps_active, u32 requested_vbus_voltage_mv)
|
|
+ bool pps_active, u32 requested_vbus_voltage_mv,
|
|
+ u32 apdo_min_voltage_mv)
|
|
{
|
|
struct tcpci *tcpci = tcpc_to_tcpci(dev);
|
|
unsigned int pwr_ctrl, threshold = 0;
|
|
@@ -359,9 +361,12 @@ static int tcpci_set_auto_vbus_discharge_threshold(struct tcpc_dev *dev, enum ty
|
|
threshold = AUTO_DISCHARGE_DEFAULT_THRESHOLD_MV;
|
|
} else if (mode == TYPEC_PWR_MODE_PD) {
|
|
if (pps_active)
|
|
- threshold = ((VPPS_NEW_MIN_PERCENT * requested_vbus_voltage_mv / 100) -
|
|
- VSINKPD_MIN_IR_DROP_MV - VPPS_VALID_MIN_MV) *
|
|
- VSINKDISCONNECT_PD_MIN_PERCENT / 100;
|
|
+ /*
|
|
+ * To prevent disconnect when the source is in Current Limit Mode.
|
|
+ * Set the threshold to the lowest possible voltage vPpsShutdown (min)
|
|
+ */
|
|
+ threshold = VPPS_SHUTDOWN_MIN_PERCENT * apdo_min_voltage_mv / 100 -
|
|
+ VSINKPD_MIN_IR_DROP_MV;
|
|
else
|
|
threshold = ((VSRC_NEW_MIN_PERCENT * requested_vbus_voltage_mv / 100) -
|
|
VSINKPD_MIN_IR_DROP_MV - VSRC_VALID_MIN_MV) *
|
|
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
|
|
index e053b6e99b9e46..790aadab72a31b 100644
|
|
--- a/drivers/usb/typec/tcpm/tcpm.c
|
|
+++ b/drivers/usb/typec/tcpm/tcpm.c
|
|
@@ -2326,10 +2326,12 @@ static int tcpm_set_auto_vbus_discharge_threshold(struct tcpm_port *port,
|
|
return 0;
|
|
|
|
ret = port->tcpc->set_auto_vbus_discharge_threshold(port->tcpc, mode, pps_active,
|
|
- requested_vbus_voltage);
|
|
+ requested_vbus_voltage,
|
|
+ port->pps_data.min_volt);
|
|
tcpm_log_force(port,
|
|
- "set_auto_vbus_discharge_threshold mode:%d pps_active:%c vbus:%u ret:%d",
|
|
- mode, pps_active ? 'y' : 'n', requested_vbus_voltage, ret);
|
|
+ "set_auto_vbus_discharge_threshold mode:%d pps_active:%c vbus:%u pps_apdo_min_volt:%u ret:%d",
|
|
+ mode, pps_active ? 'y' : 'n', requested_vbus_voltage,
|
|
+ port->pps_data.min_volt, ret);
|
|
|
|
return ret;
|
|
}
|
|
@@ -4065,7 +4067,7 @@ static void run_state_machine(struct tcpm_port *port)
|
|
port->caps_count = 0;
|
|
port->pd_capable = true;
|
|
tcpm_set_state_cond(port, SRC_SEND_CAPABILITIES_TIMEOUT,
|
|
- PD_T_SEND_SOURCE_CAP);
|
|
+ PD_T_SENDER_RESPONSE);
|
|
}
|
|
break;
|
|
case SRC_SEND_CAPABILITIES_TIMEOUT:
|
|
diff --git a/drivers/vfio/iova_bitmap.c b/drivers/vfio/iova_bitmap.c
|
|
index 7af5b204990bb5..38b51613ecca90 100644
|
|
--- a/drivers/vfio/iova_bitmap.c
|
|
+++ b/drivers/vfio/iova_bitmap.c
|
|
@@ -127,7 +127,7 @@ struct iova_bitmap {
|
|
static unsigned long iova_bitmap_offset_to_index(struct iova_bitmap *bitmap,
|
|
unsigned long iova)
|
|
{
|
|
- unsigned long pgsize = 1 << bitmap->mapped.pgshift;
|
|
+ unsigned long pgsize = 1UL << bitmap->mapped.pgshift;
|
|
|
|
return iova / (BITS_PER_TYPE(*bitmap->bitmap) * pgsize);
|
|
}
|
|
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
|
|
index 0282d4eef139d4..3b16c3342cb77e 100644
|
|
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
|
|
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
|
|
@@ -102,6 +102,7 @@ struct device_node *dss_of_port_get_parent_device(struct device_node *port)
|
|
np = of_get_next_parent(np);
|
|
}
|
|
|
|
+ of_node_put(np);
|
|
return NULL;
|
|
}
|
|
|
|
diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
|
|
index 563d842014dfba..cc239251e19383 100644
|
|
--- a/drivers/watchdog/rti_wdt.c
|
|
+++ b/drivers/watchdog/rti_wdt.c
|
|
@@ -301,6 +301,7 @@ static int rti_wdt_probe(struct platform_device *pdev)
|
|
node = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
|
|
if (node) {
|
|
ret = of_address_to_resource(node, 0, &res);
|
|
+ of_node_put(node);
|
|
if (ret) {
|
|
dev_err(dev, "No memory address assigned to the region.\n");
|
|
goto err_iomap;
|
|
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
|
|
index 897569e1d3a909..cdd2abdc8975d8 100644
|
|
--- a/fs/afs/dir.c
|
|
+++ b/fs/afs/dir.c
|
|
@@ -1458,7 +1458,12 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry)
|
|
op->file[1].vnode = vnode;
|
|
}
|
|
|
|
- return afs_do_sync_operation(op);
|
|
+ ret = afs_do_sync_operation(op);
|
|
+
|
|
+ /* Not all systems that can host afs servers have ENOTEMPTY. */
|
|
+ if (ret == -EEXIST)
|
|
+ ret = -ENOTEMPTY;
|
|
+ return ret;
|
|
|
|
error:
|
|
return afs_put_operation(op);
|
|
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
|
|
index 8dcc09cf0adbeb..2f135d19545b19 100644
|
|
--- a/fs/afs/internal.h
|
|
+++ b/fs/afs/internal.h
|
|
@@ -1286,6 +1286,15 @@ extern void afs_send_simple_reply(struct afs_call *, const void *, size_t);
|
|
extern int afs_extract_data(struct afs_call *, bool);
|
|
extern int afs_protocol_error(struct afs_call *, enum afs_eproto_cause);
|
|
|
|
+static inline void afs_see_call(struct afs_call *call, enum afs_call_trace why)
|
|
+{
|
|
+ int r = refcount_read(&call->ref);
|
|
+
|
|
+ trace_afs_call(call->debug_id, why, r,
|
|
+ atomic_read(&call->net->nr_outstanding_calls),
|
|
+ __builtin_return_address(0));
|
|
+}
|
|
+
|
|
static inline void afs_make_op_call(struct afs_operation *op, struct afs_call *call,
|
|
gfp_t gfp)
|
|
{
|
|
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
|
|
index d642d06a453be7..43154c70366ae1 100644
|
|
--- a/fs/afs/rxrpc.c
|
|
+++ b/fs/afs/rxrpc.c
|
|
@@ -396,11 +396,16 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp)
|
|
return;
|
|
|
|
error_do_abort:
|
|
- if (ret != -ECONNABORTED) {
|
|
+ if (ret != -ECONNABORTED)
|
|
rxrpc_kernel_abort_call(call->net->socket, rxcall,
|
|
RX_USER_ABORT, ret,
|
|
afs_abort_send_data_error);
|
|
- } else {
|
|
+ if (call->async) {
|
|
+ afs_see_call(call, afs_call_trace_async_abort);
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ if (ret == -ECONNABORTED) {
|
|
len = 0;
|
|
iov_iter_kvec(&msg.msg_iter, ITER_DEST, NULL, 0, 0);
|
|
rxrpc_kernel_recv_data(call->net->socket, rxcall,
|
|
@@ -412,6 +417,8 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp)
|
|
call->error = ret;
|
|
trace_afs_call_done(call);
|
|
error_kill_call:
|
|
+ if (call->async)
|
|
+ afs_see_call(call, afs_call_trace_async_kill);
|
|
if (call->type->done)
|
|
call->type->done(call);
|
|
|
|
@@ -566,7 +573,6 @@ static void afs_deliver_to_call(struct afs_call *call)
|
|
abort_code = 0;
|
|
call_complete:
|
|
afs_set_call_complete(call, ret, remote_abort);
|
|
- state = AFS_CALL_COMPLETE;
|
|
goto done;
|
|
}
|
|
|
|
diff --git a/fs/afs/xdr_fs.h b/fs/afs/xdr_fs.h
|
|
index 8ca8681645077d..cc5f143d21a347 100644
|
|
--- a/fs/afs/xdr_fs.h
|
|
+++ b/fs/afs/xdr_fs.h
|
|
@@ -88,7 +88,7 @@ union afs_xdr_dir_block {
|
|
|
|
struct {
|
|
struct afs_xdr_dir_hdr hdr;
|
|
- u8 alloc_ctrs[AFS_DIR_MAX_BLOCKS];
|
|
+ u8 alloc_ctrs[AFS_DIR_BLOCKS_WITH_CTR];
|
|
__be16 hashtable[AFS_DIR_HASHTBL_SIZE];
|
|
} meta;
|
|
|
|
diff --git a/fs/afs/yfsclient.c b/fs/afs/yfsclient.c
|
|
index 11571cca86c19a..01f333e691d644 100644
|
|
--- a/fs/afs/yfsclient.c
|
|
+++ b/fs/afs/yfsclient.c
|
|
@@ -655,8 +655,9 @@ static int yfs_deliver_fs_remove_file2(struct afs_call *call)
|
|
static void yfs_done_fs_remove_file2(struct afs_call *call)
|
|
{
|
|
if (call->error == -ECONNABORTED &&
|
|
- call->abort_code == RX_INVALID_OPERATION) {
|
|
- set_bit(AFS_SERVER_FL_NO_RM2, &call->server->flags);
|
|
+ (call->abort_code == RX_INVALID_OPERATION ||
|
|
+ call->abort_code == RXGEN_OPCODE)) {
|
|
+ set_bit(AFS_SERVER_FL_NO_RM2, &call->op->server->flags);
|
|
call->op->flags |= AFS_OPERATION_DOWNGRADE;
|
|
}
|
|
}
|
|
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
|
|
index e33587a814098a..fb4992570c2b59 100644
|
|
--- a/fs/btrfs/super.c
|
|
+++ b/fs/btrfs/super.c
|
|
@@ -1162,7 +1162,7 @@ static int btrfs_fill_super(struct super_block *sb,
|
|
|
|
err = open_ctree(sb, fs_devices, (char *)data);
|
|
if (err) {
|
|
- btrfs_err(fs_info, "open_ctree failed");
|
|
+ btrfs_err(fs_info, "open_ctree failed: %d", err);
|
|
return err;
|
|
}
|
|
|
|
diff --git a/fs/buffer.c b/fs/buffer.c
|
|
index ecd8b47507ff80..4b86e971efd8a1 100644
|
|
--- a/fs/buffer.c
|
|
+++ b/fs/buffer.c
|
|
@@ -1640,8 +1640,8 @@ EXPORT_SYMBOL(block_invalidate_folio);
|
|
* block_dirty_folio() via private_lock. try_to_free_buffers
|
|
* is already excluded via the folio lock.
|
|
*/
|
|
-void folio_create_empty_buffers(struct folio *folio, unsigned long blocksize,
|
|
- unsigned long b_state)
|
|
+struct buffer_head *folio_create_empty_buffers(struct folio *folio,
|
|
+ unsigned long blocksize, unsigned long b_state)
|
|
{
|
|
struct buffer_head *bh, *head, *tail;
|
|
|
|
@@ -1667,6 +1667,8 @@ void folio_create_empty_buffers(struct folio *folio, unsigned long blocksize,
|
|
}
|
|
folio_attach_private(folio, head);
|
|
spin_unlock(&folio->mapping->private_lock);
|
|
+
|
|
+ return head;
|
|
}
|
|
EXPORT_SYMBOL(folio_create_empty_buffers);
|
|
|
|
@@ -1768,13 +1770,15 @@ static struct buffer_head *folio_create_buffers(struct folio *folio,
|
|
struct inode *inode,
|
|
unsigned int b_state)
|
|
{
|
|
+ struct buffer_head *bh;
|
|
+
|
|
BUG_ON(!folio_test_locked(folio));
|
|
|
|
- if (!folio_buffers(folio))
|
|
- folio_create_empty_buffers(folio,
|
|
- 1 << READ_ONCE(inode->i_blkbits),
|
|
- b_state);
|
|
- return folio_buffers(folio);
|
|
+ bh = folio_buffers(folio);
|
|
+ if (!bh)
|
|
+ bh = folio_create_empty_buffers(folio,
|
|
+ 1 << READ_ONCE(inode->i_blkbits), b_state);
|
|
+ return bh;
|
|
}
|
|
|
|
/*
|
|
@@ -2678,10 +2682,8 @@ int block_truncate_page(struct address_space *mapping,
|
|
return PTR_ERR(folio);
|
|
|
|
bh = folio_buffers(folio);
|
|
- if (!bh) {
|
|
- folio_create_empty_buffers(folio, blocksize, 0);
|
|
- bh = folio_buffers(folio);
|
|
- }
|
|
+ if (!bh)
|
|
+ bh = folio_create_empty_buffers(folio, blocksize, 0);
|
|
|
|
/* Find the buffer that contains "offset" */
|
|
offset = offset_in_folio(folio, from);
|
|
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
|
|
index 32dbd1a828d010..0618af36f5506b 100644
|
|
--- a/fs/dlm/lowcomms.c
|
|
+++ b/fs/dlm/lowcomms.c
|
|
@@ -460,7 +460,8 @@ static bool dlm_lowcomms_con_has_addr(const struct connection *con,
|
|
int dlm_lowcomms_addr(int nodeid, struct sockaddr_storage *addr, int len)
|
|
{
|
|
struct connection *con;
|
|
- bool ret, idx;
|
|
+ bool ret;
|
|
+ int idx;
|
|
|
|
idx = srcu_read_lock(&connections_srcu);
|
|
con = nodeid2con(nodeid, GFP_NOFS);
|
|
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
|
|
index 166ec8942595e1..13268d1f8c75a6 100644
|
|
--- a/fs/f2fs/dir.c
|
|
+++ b/fs/f2fs/dir.c
|
|
@@ -166,7 +166,8 @@ static unsigned long dir_block_index(unsigned int level,
|
|
static struct f2fs_dir_entry *find_in_block(struct inode *dir,
|
|
struct page *dentry_page,
|
|
const struct f2fs_filename *fname,
|
|
- int *max_slots)
|
|
+ int *max_slots,
|
|
+ bool use_hash)
|
|
{
|
|
struct f2fs_dentry_block *dentry_blk;
|
|
struct f2fs_dentry_ptr d;
|
|
@@ -174,7 +175,7 @@ static struct f2fs_dir_entry *find_in_block(struct inode *dir,
|
|
dentry_blk = (struct f2fs_dentry_block *)page_address(dentry_page);
|
|
|
|
make_dentry_ptr_block(dir, &d, dentry_blk);
|
|
- return f2fs_find_target_dentry(&d, fname, max_slots);
|
|
+ return f2fs_find_target_dentry(&d, fname, max_slots, use_hash);
|
|
}
|
|
|
|
#if IS_ENABLED(CONFIG_UNICODE)
|
|
@@ -251,7 +252,8 @@ static inline int f2fs_match_name(const struct inode *dir,
|
|
}
|
|
|
|
struct f2fs_dir_entry *f2fs_find_target_dentry(const struct f2fs_dentry_ptr *d,
|
|
- const struct f2fs_filename *fname, int *max_slots)
|
|
+ const struct f2fs_filename *fname, int *max_slots,
|
|
+ bool use_hash)
|
|
{
|
|
struct f2fs_dir_entry *de;
|
|
unsigned long bit_pos = 0;
|
|
@@ -274,7 +276,7 @@ struct f2fs_dir_entry *f2fs_find_target_dentry(const struct f2fs_dentry_ptr *d,
|
|
continue;
|
|
}
|
|
|
|
- if (de->hash_code == fname->hash) {
|
|
+ if (!use_hash || de->hash_code == fname->hash) {
|
|
res = f2fs_match_name(d->inode, fname,
|
|
d->filename[bit_pos],
|
|
le16_to_cpu(de->name_len));
|
|
@@ -301,11 +303,12 @@ struct f2fs_dir_entry *f2fs_find_target_dentry(const struct f2fs_dentry_ptr *d,
|
|
static struct f2fs_dir_entry *find_in_level(struct inode *dir,
|
|
unsigned int level,
|
|
const struct f2fs_filename *fname,
|
|
- struct page **res_page)
|
|
+ struct page **res_page,
|
|
+ bool use_hash)
|
|
{
|
|
int s = GET_DENTRY_SLOTS(fname->disk_name.len);
|
|
unsigned int nbucket, nblock;
|
|
- unsigned int bidx, end_block;
|
|
+ unsigned int bidx, end_block, bucket_no;
|
|
struct page *dentry_page;
|
|
struct f2fs_dir_entry *de = NULL;
|
|
pgoff_t next_pgofs;
|
|
@@ -315,8 +318,11 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir,
|
|
nbucket = dir_buckets(level, F2FS_I(dir)->i_dir_level);
|
|
nblock = bucket_blocks(level);
|
|
|
|
+ bucket_no = use_hash ? le32_to_cpu(fname->hash) % nbucket : 0;
|
|
+
|
|
+start_find_bucket:
|
|
bidx = dir_block_index(level, F2FS_I(dir)->i_dir_level,
|
|
- le32_to_cpu(fname->hash) % nbucket);
|
|
+ bucket_no);
|
|
end_block = bidx + nblock;
|
|
|
|
while (bidx < end_block) {
|
|
@@ -333,7 +339,7 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir,
|
|
}
|
|
}
|
|
|
|
- de = find_in_block(dir, dentry_page, fname, &max_slots);
|
|
+ de = find_in_block(dir, dentry_page, fname, &max_slots, use_hash);
|
|
if (IS_ERR(de)) {
|
|
*res_page = ERR_CAST(de);
|
|
de = NULL;
|
|
@@ -350,12 +356,18 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir,
|
|
bidx++;
|
|
}
|
|
|
|
- if (!de && room && F2FS_I(dir)->chash != fname->hash) {
|
|
- F2FS_I(dir)->chash = fname->hash;
|
|
- F2FS_I(dir)->clevel = level;
|
|
- }
|
|
+ if (de)
|
|
+ return de;
|
|
|
|
- return de;
|
|
+ if (likely(use_hash)) {
|
|
+ if (room && F2FS_I(dir)->chash != fname->hash) {
|
|
+ F2FS_I(dir)->chash = fname->hash;
|
|
+ F2FS_I(dir)->clevel = level;
|
|
+ }
|
|
+ } else if (++bucket_no < nbucket) {
|
|
+ goto start_find_bucket;
|
|
+ }
|
|
+ return NULL;
|
|
}
|
|
|
|
struct f2fs_dir_entry *__f2fs_find_entry(struct inode *dir,
|
|
@@ -366,11 +378,15 @@ struct f2fs_dir_entry *__f2fs_find_entry(struct inode *dir,
|
|
struct f2fs_dir_entry *de = NULL;
|
|
unsigned int max_depth;
|
|
unsigned int level;
|
|
+ bool use_hash = true;
|
|
|
|
*res_page = NULL;
|
|
|
|
+#if IS_ENABLED(CONFIG_UNICODE)
|
|
+start_find_entry:
|
|
+#endif
|
|
if (f2fs_has_inline_dentry(dir)) {
|
|
- de = f2fs_find_in_inline_dir(dir, fname, res_page);
|
|
+ de = f2fs_find_in_inline_dir(dir, fname, res_page, use_hash);
|
|
goto out;
|
|
}
|
|
|
|
@@ -386,11 +402,18 @@ struct f2fs_dir_entry *__f2fs_find_entry(struct inode *dir,
|
|
}
|
|
|
|
for (level = 0; level < max_depth; level++) {
|
|
- de = find_in_level(dir, level, fname, res_page);
|
|
+ de = find_in_level(dir, level, fname, res_page, use_hash);
|
|
if (de || IS_ERR(*res_page))
|
|
break;
|
|
}
|
|
+
|
|
out:
|
|
+#if IS_ENABLED(CONFIG_UNICODE)
|
|
+ if (IS_CASEFOLDED(dir) && !de && use_hash) {
|
|
+ use_hash = false;
|
|
+ goto start_find_entry;
|
|
+ }
|
|
+#endif
|
|
/* This is to increase the speed of f2fs_create */
|
|
if (!de)
|
|
F2FS_I(dir)->task = current;
|
|
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
|
|
index 33620642ae5ec8..d28e3df61cc4fd 100644
|
|
--- a/fs/f2fs/f2fs.h
|
|
+++ b/fs/f2fs/f2fs.h
|
|
@@ -3531,7 +3531,8 @@ int f2fs_prepare_lookup(struct inode *dir, struct dentry *dentry,
|
|
struct f2fs_filename *fname);
|
|
void f2fs_free_filename(struct f2fs_filename *fname);
|
|
struct f2fs_dir_entry *f2fs_find_target_dentry(const struct f2fs_dentry_ptr *d,
|
|
- const struct f2fs_filename *fname, int *max_slots);
|
|
+ const struct f2fs_filename *fname, int *max_slots,
|
|
+ bool use_hash);
|
|
int f2fs_fill_dentries(struct dir_context *ctx, struct f2fs_dentry_ptr *d,
|
|
unsigned int start_pos, struct fscrypt_str *fstr);
|
|
void f2fs_do_make_empty_dir(struct inode *inode, struct inode *parent,
|
|
@@ -4148,7 +4149,8 @@ int f2fs_write_inline_data(struct inode *inode, struct page *page);
|
|
int f2fs_recover_inline_data(struct inode *inode, struct page *npage);
|
|
struct f2fs_dir_entry *f2fs_find_in_inline_dir(struct inode *dir,
|
|
const struct f2fs_filename *fname,
|
|
- struct page **res_page);
|
|
+ struct page **res_page,
|
|
+ bool use_hash);
|
|
int f2fs_make_empty_inline_dir(struct inode *inode, struct inode *parent,
|
|
struct page *ipage);
|
|
int f2fs_add_inline_entry(struct inode *dir, const struct f2fs_filename *fname,
|
|
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
|
|
index a3f8b4ed495efb..d5e8f3e40cc93b 100644
|
|
--- a/fs/f2fs/inline.c
|
|
+++ b/fs/f2fs/inline.c
|
|
@@ -353,7 +353,8 @@ int f2fs_recover_inline_data(struct inode *inode, struct page *npage)
|
|
|
|
struct f2fs_dir_entry *f2fs_find_in_inline_dir(struct inode *dir,
|
|
const struct f2fs_filename *fname,
|
|
- struct page **res_page)
|
|
+ struct page **res_page,
|
|
+ bool use_hash)
|
|
{
|
|
struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
|
|
struct f2fs_dir_entry *de;
|
|
@@ -370,7 +371,7 @@ struct f2fs_dir_entry *f2fs_find_in_inline_dir(struct inode *dir,
|
|
inline_dentry = inline_data_addr(dir, ipage);
|
|
|
|
make_dentry_ptr_inline(dir, &d, inline_dentry);
|
|
- de = f2fs_find_target_dentry(&d, fname, NULL);
|
|
+ de = f2fs_find_target_dentry(&d, fname, NULL, use_hash);
|
|
unlock_page(ipage);
|
|
if (IS_ERR(de)) {
|
|
*res_page = ERR_CAST(de);
|
|
diff --git a/fs/file_table.c b/fs/file_table.c
|
|
index ee21b3da9d0812..234284ef72a9a5 100644
|
|
--- a/fs/file_table.c
|
|
+++ b/fs/file_table.c
|
|
@@ -133,7 +133,7 @@ static struct ctl_table fs_stat_sysctls[] = {
|
|
.data = &sysctl_nr_open,
|
|
.maxlen = sizeof(unsigned int),
|
|
.mode = 0644,
|
|
- .proc_handler = proc_dointvec_minmax,
|
|
+ .proc_handler = proc_douintvec_minmax,
|
|
.extra1 = &sysctl_nr_open_min,
|
|
.extra2 = &sysctl_nr_open_max,
|
|
},
|
|
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
|
|
index ff201753fd1814..9cddd78b11d416 100644
|
|
--- a/fs/hostfs/hostfs_kern.c
|
|
+++ b/fs/hostfs/hostfs_kern.c
|
|
@@ -16,11 +16,17 @@
|
|
#include <linux/seq_file.h>
|
|
#include <linux/writeback.h>
|
|
#include <linux/mount.h>
|
|
+#include <linux/fs_context.h>
|
|
+#include <linux/fs_parser.h>
|
|
#include <linux/namei.h>
|
|
#include "hostfs.h"
|
|
#include <init.h>
|
|
#include <kern.h>
|
|
|
|
+struct hostfs_fs_info {
|
|
+ char *host_root_path;
|
|
+};
|
|
+
|
|
struct hostfs_inode_info {
|
|
int fd;
|
|
fmode_t mode;
|
|
@@ -88,30 +94,17 @@ __uml_setup("hostfs=", hostfs_args,
|
|
static char *__dentry_name(struct dentry *dentry, char *name)
|
|
{
|
|
char *p = dentry_path_raw(dentry, name, PATH_MAX);
|
|
- char *root;
|
|
- size_t len;
|
|
-
|
|
- root = dentry->d_sb->s_fs_info;
|
|
- len = strlen(root);
|
|
- if (IS_ERR(p)) {
|
|
- __putname(name);
|
|
- return NULL;
|
|
- }
|
|
+ struct hostfs_fs_info *fsi = dentry->d_sb->s_fs_info;
|
|
+ char *root = fsi->host_root_path;
|
|
+ size_t len = strlen(root);
|
|
|
|
- /*
|
|
- * This function relies on the fact that dentry_path_raw() will place
|
|
- * the path name at the end of the provided buffer.
|
|
- */
|
|
- BUG_ON(p + strlen(p) + 1 != name + PATH_MAX);
|
|
-
|
|
- strscpy(name, root, PATH_MAX);
|
|
- if (len > p - name) {
|
|
+ if (IS_ERR(p) || len > p - name) {
|
|
__putname(name);
|
|
return NULL;
|
|
}
|
|
|
|
- if (p > name + len)
|
|
- strcpy(name + len, p);
|
|
+ memcpy(name, root, len);
|
|
+ memmove(name + len, p, name + PATH_MAX - p);
|
|
|
|
return name;
|
|
}
|
|
@@ -196,8 +189,10 @@ static int hostfs_statfs(struct dentry *dentry, struct kstatfs *sf)
|
|
long long f_bavail;
|
|
long long f_files;
|
|
long long f_ffree;
|
|
+ struct hostfs_fs_info *fsi;
|
|
|
|
- err = do_statfs(dentry->d_sb->s_fs_info,
|
|
+ fsi = dentry->d_sb->s_fs_info;
|
|
+ err = do_statfs(fsi->host_root_path,
|
|
&sf->f_bsize, &f_blocks, &f_bfree, &f_bavail, &f_files,
|
|
&f_ffree, &sf->f_fsid, sizeof(sf->f_fsid),
|
|
&sf->f_namelen);
|
|
@@ -245,7 +240,11 @@ static void hostfs_free_inode(struct inode *inode)
|
|
|
|
static int hostfs_show_options(struct seq_file *seq, struct dentry *root)
|
|
{
|
|
- const char *root_path = root->d_sb->s_fs_info;
|
|
+ struct hostfs_fs_info *fsi;
|
|
+ const char *root_path;
|
|
+
|
|
+ fsi = root->d_sb->s_fs_info;
|
|
+ root_path = fsi->host_root_path;
|
|
size_t offset = strlen(root_ino) + 1;
|
|
|
|
if (strlen(root_path) > offset)
|
|
@@ -924,10 +923,10 @@ static const struct inode_operations hostfs_link_iops = {
|
|
.get_link = hostfs_get_link,
|
|
};
|
|
|
|
-static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
|
|
+static int hostfs_fill_super(struct super_block *sb, struct fs_context *fc)
|
|
{
|
|
+ struct hostfs_fs_info *fsi = sb->s_fs_info;
|
|
struct inode *root_inode;
|
|
- char *host_root_path, *req_root = d;
|
|
int err;
|
|
|
|
sb->s_blocksize = 1024;
|
|
@@ -940,16 +939,7 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
|
|
if (err)
|
|
return err;
|
|
|
|
- /* NULL is printed as '(null)' by printf(): avoid that. */
|
|
- if (req_root == NULL)
|
|
- req_root = "";
|
|
-
|
|
- sb->s_fs_info = host_root_path =
|
|
- kasprintf(GFP_KERNEL, "%s/%s", root_ino, req_root);
|
|
- if (host_root_path == NULL)
|
|
- return -ENOMEM;
|
|
-
|
|
- root_inode = hostfs_iget(sb, host_root_path);
|
|
+ root_inode = hostfs_iget(sb, fsi->host_root_path);
|
|
if (IS_ERR(root_inode))
|
|
return PTR_ERR(root_inode);
|
|
|
|
@@ -957,7 +947,7 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
|
|
char *name;
|
|
|
|
iput(root_inode);
|
|
- name = follow_link(host_root_path);
|
|
+ name = follow_link(fsi->host_root_path);
|
|
if (IS_ERR(name))
|
|
return PTR_ERR(name);
|
|
|
|
@@ -974,11 +964,92 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
|
|
return 0;
|
|
}
|
|
|
|
-static struct dentry *hostfs_read_sb(struct file_system_type *type,
|
|
- int flags, const char *dev_name,
|
|
- void *data)
|
|
+enum hostfs_parma {
|
|
+ Opt_hostfs,
|
|
+};
|
|
+
|
|
+static const struct fs_parameter_spec hostfs_param_specs[] = {
|
|
+ fsparam_string_empty("hostfs", Opt_hostfs),
|
|
+ {}
|
|
+};
|
|
+
|
|
+static int hostfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
|
|
+{
|
|
+ struct hostfs_fs_info *fsi = fc->s_fs_info;
|
|
+ struct fs_parse_result result;
|
|
+ char *host_root;
|
|
+ int opt;
|
|
+
|
|
+ opt = fs_parse(fc, hostfs_param_specs, param, &result);
|
|
+ if (opt < 0)
|
|
+ return opt;
|
|
+
|
|
+ switch (opt) {
|
|
+ case Opt_hostfs:
|
|
+ host_root = param->string;
|
|
+ if (!*host_root)
|
|
+ host_root = "";
|
|
+ fsi->host_root_path =
|
|
+ kasprintf(GFP_KERNEL, "%s/%s", root_ino, host_root);
|
|
+ if (fsi->host_root_path == NULL)
|
|
+ return -ENOMEM;
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int hostfs_parse_monolithic(struct fs_context *fc, void *data)
|
|
+{
|
|
+ struct hostfs_fs_info *fsi = fc->s_fs_info;
|
|
+ char *host_root = (char *)data;
|
|
+
|
|
+ /* NULL is printed as '(null)' by printf(): avoid that. */
|
|
+ if (host_root == NULL)
|
|
+ host_root = "";
|
|
+
|
|
+ fsi->host_root_path =
|
|
+ kasprintf(GFP_KERNEL, "%s/%s", root_ino, host_root);
|
|
+ if (fsi->host_root_path == NULL)
|
|
+ return -ENOMEM;
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int hostfs_fc_get_tree(struct fs_context *fc)
|
|
+{
|
|
+ return get_tree_nodev(fc, hostfs_fill_super);
|
|
+}
|
|
+
|
|
+static void hostfs_fc_free(struct fs_context *fc)
|
|
+{
|
|
+ struct hostfs_fs_info *fsi = fc->s_fs_info;
|
|
+
|
|
+ if (!fsi)
|
|
+ return;
|
|
+
|
|
+ kfree(fsi->host_root_path);
|
|
+ kfree(fsi);
|
|
+}
|
|
+
|
|
+static const struct fs_context_operations hostfs_context_ops = {
|
|
+ .parse_monolithic = hostfs_parse_monolithic,
|
|
+ .parse_param = hostfs_parse_param,
|
|
+ .get_tree = hostfs_fc_get_tree,
|
|
+ .free = hostfs_fc_free,
|
|
+};
|
|
+
|
|
+static int hostfs_init_fs_context(struct fs_context *fc)
|
|
{
|
|
- return mount_nodev(type, flags, data, hostfs_fill_sb_common);
|
|
+ struct hostfs_fs_info *fsi;
|
|
+
|
|
+ fsi = kzalloc(sizeof(*fsi), GFP_KERNEL);
|
|
+ if (!fsi)
|
|
+ return -ENOMEM;
|
|
+
|
|
+ fc->s_fs_info = fsi;
|
|
+ fc->ops = &hostfs_context_ops;
|
|
+ return 0;
|
|
}
|
|
|
|
static void hostfs_kill_sb(struct super_block *s)
|
|
@@ -988,11 +1059,11 @@ static void hostfs_kill_sb(struct super_block *s)
|
|
}
|
|
|
|
static struct file_system_type hostfs_type = {
|
|
- .owner = THIS_MODULE,
|
|
- .name = "hostfs",
|
|
- .mount = hostfs_read_sb,
|
|
- .kill_sb = hostfs_kill_sb,
|
|
- .fs_flags = 0,
|
|
+ .owner = THIS_MODULE,
|
|
+ .name = "hostfs",
|
|
+ .init_fs_context = hostfs_init_fs_context,
|
|
+ .kill_sb = hostfs_kill_sb,
|
|
+ .fs_flags = 0,
|
|
};
|
|
MODULE_ALIAS_FS("hostfs");
|
|
|
|
diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
|
|
index 531c9c20ef1d1b..9f0d69e6526443 100644
|
|
--- a/fs/nfs/nfs42proc.c
|
|
+++ b/fs/nfs/nfs42proc.c
|
|
@@ -552,7 +552,7 @@ static int nfs42_do_offload_cancel_async(struct file *dst,
|
|
.rpc_message = &msg,
|
|
.callback_ops = &nfs42_offload_cancel_ops,
|
|
.workqueue = nfsiod_workqueue,
|
|
- .flags = RPC_TASK_ASYNC,
|
|
+ .flags = RPC_TASK_ASYNC | RPC_TASK_MOVEABLE,
|
|
};
|
|
int status;
|
|
|
|
diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c
|
|
index 9e3ae53e220583..becc3149aa9e5c 100644
|
|
--- a/fs/nfs/nfs42xdr.c
|
|
+++ b/fs/nfs/nfs42xdr.c
|
|
@@ -144,9 +144,11 @@
|
|
decode_putfh_maxsz + \
|
|
decode_offload_cancel_maxsz)
|
|
#define NFS4_enc_copy_notify_sz (compound_encode_hdr_maxsz + \
|
|
+ encode_sequence_maxsz + \
|
|
encode_putfh_maxsz + \
|
|
encode_copy_notify_maxsz)
|
|
#define NFS4_dec_copy_notify_sz (compound_decode_hdr_maxsz + \
|
|
+ decode_sequence_maxsz + \
|
|
decode_putfh_maxsz + \
|
|
decode_copy_notify_maxsz)
|
|
#define NFS4_enc_deallocate_sz (compound_encode_hdr_maxsz + \
|
|
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
|
|
index 54ffadf02e034f..875ea311ca3c20 100644
|
|
--- a/fs/nfsd/nfs4callback.c
|
|
+++ b/fs/nfsd/nfs4callback.c
|
|
@@ -1202,6 +1202,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback
|
|
ret = false;
|
|
break;
|
|
case -NFS4ERR_DELAY:
|
|
+ cb->cb_seq_status = 1;
|
|
if (!rpc_restart_call(task))
|
|
goto out;
|
|
|
|
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
|
|
index 0610cb12c11ca0..d4a98ac72b8eaa 100644
|
|
--- a/fs/nilfs2/segment.c
|
|
+++ b/fs/nilfs2/segment.c
|
|
@@ -731,11 +731,9 @@ static size_t nilfs_lookup_dirty_data_buffers(struct inode *inode,
|
|
continue;
|
|
}
|
|
head = folio_buffers(folio);
|
|
- if (!head) {
|
|
- create_empty_buffers(&folio->page, i_blocksize(inode), 0);
|
|
- head = folio_buffers(folio);
|
|
- }
|
|
- folio_unlock(folio);
|
|
+ if (!head)
|
|
+ head = folio_create_empty_buffers(folio,
|
|
+ i_blocksize(inode), 0);
|
|
|
|
bh = head;
|
|
do {
|
|
@@ -745,11 +743,14 @@ static size_t nilfs_lookup_dirty_data_buffers(struct inode *inode,
|
|
list_add_tail(&bh->b_assoc_buffers, listp);
|
|
ndirties++;
|
|
if (unlikely(ndirties >= nlimit)) {
|
|
+ folio_unlock(folio);
|
|
folio_batch_release(&fbatch);
|
|
cond_resched();
|
|
return ndirties;
|
|
}
|
|
} while (bh = bh->b_this_page, bh != head);
|
|
+
|
|
+ folio_unlock(folio);
|
|
}
|
|
folio_batch_release(&fbatch);
|
|
cond_resched();
|
|
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
|
|
index 0dffd6a44d39dc..24b031dc44ee1e 100644
|
|
--- a/fs/ocfs2/quota_global.c
|
|
+++ b/fs/ocfs2/quota_global.c
|
|
@@ -749,6 +749,11 @@ static int ocfs2_release_dquot(struct dquot *dquot)
|
|
handle = ocfs2_start_trans(osb,
|
|
ocfs2_calc_qdel_credits(dquot->dq_sb, dquot->dq_id.type));
|
|
if (IS_ERR(handle)) {
|
|
+ /*
|
|
+ * Mark dquot as inactive to avoid endless cycle in
|
|
+ * quota_release_workfn().
|
|
+ */
|
|
+ clear_bit(DQ_ACTIVE_B, &dquot->dq_flags);
|
|
status = PTR_ERR(handle);
|
|
mlog_errno(status);
|
|
goto out_ilock;
|
|
diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c
|
|
index de8cf5d75f34d5..85668cb31c3d2f 100644
|
|
--- a/fs/pstore/blk.c
|
|
+++ b/fs/pstore/blk.c
|
|
@@ -89,7 +89,7 @@ static struct pstore_device_info *pstore_device_info;
|
|
_##name_ = check_size(name, alignsize); \
|
|
else \
|
|
_##name_ = 0; \
|
|
- /* Synchronize module parameters with resuls. */ \
|
|
+ /* Synchronize module parameters with results. */ \
|
|
name = _##name_ / 1024; \
|
|
dev->zone.name = _##name_; \
|
|
}
|
|
@@ -121,7 +121,7 @@ static int __register_pstore_device(struct pstore_device_info *dev)
|
|
if (pstore_device_info)
|
|
return -EBUSY;
|
|
|
|
- /* zero means not limit on which backends to attempt to store. */
|
|
+ /* zero means no limit on which backends attempt to store. */
|
|
if (!dev->flags)
|
|
dev->flags = UINT_MAX;
|
|
|
|
diff --git a/fs/select.c b/fs/select.c
|
|
index d4d881d439dcdf..3f730b8581f65d 100644
|
|
--- a/fs/select.c
|
|
+++ b/fs/select.c
|
|
@@ -788,7 +788,7 @@ static inline int get_sigset_argpack(struct sigset_argpack *to,
|
|
}
|
|
return 0;
|
|
Efault:
|
|
- user_access_end();
|
|
+ user_read_access_end();
|
|
return -EFAULT;
|
|
}
|
|
|
|
@@ -1361,7 +1361,7 @@ static inline int get_compat_sigset_argpack(struct compat_sigset_argpack *to,
|
|
}
|
|
return 0;
|
|
Efault:
|
|
- user_access_end();
|
|
+ user_read_access_end();
|
|
return -EFAULT;
|
|
}
|
|
|
|
diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c
|
|
index bff8d0dd74fe7d..1fc1683b15bd84 100644
|
|
--- a/fs/smb/client/cifsacl.c
|
|
+++ b/fs/smb/client/cifsacl.c
|
|
@@ -1395,7 +1395,7 @@ static int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *pnntsd,
|
|
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
|
|
struct smb_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
|
|
const struct cifs_fid *cifsfid, u32 *pacllen,
|
|
- u32 __maybe_unused unused)
|
|
+ u32 info)
|
|
{
|
|
struct smb_ntsd *pntsd = NULL;
|
|
unsigned int xid;
|
|
@@ -1407,7 +1407,7 @@ struct smb_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
|
|
|
|
xid = get_xid();
|
|
rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), cifsfid->netfid, &pntsd,
|
|
- pacllen);
|
|
+ pacllen, info);
|
|
free_xid(xid);
|
|
|
|
cifs_put_tlink(tlink);
|
|
@@ -1419,7 +1419,7 @@ struct smb_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
|
|
}
|
|
|
|
static struct smb_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
|
|
- const char *path, u32 *pacllen)
|
|
+ const char *path, u32 *pacllen, u32 info)
|
|
{
|
|
struct smb_ntsd *pntsd = NULL;
|
|
int oplock = 0;
|
|
@@ -1446,9 +1446,12 @@ static struct smb_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
|
|
.fid = &fid,
|
|
};
|
|
|
|
+ if (info & SACL_SECINFO)
|
|
+ oparms.desired_access |= SYSTEM_SECURITY;
|
|
+
|
|
rc = CIFS_open(xid, &oparms, &oplock, NULL);
|
|
if (!rc) {
|
|
- rc = CIFSSMBGetCIFSACL(xid, tcon, fid.netfid, &pntsd, pacllen);
|
|
+ rc = CIFSSMBGetCIFSACL(xid, tcon, fid.netfid, &pntsd, pacllen, info);
|
|
CIFSSMBClose(xid, tcon, fid.netfid);
|
|
}
|
|
|
|
@@ -1472,7 +1475,7 @@ struct smb_ntsd *get_cifs_acl(struct cifs_sb_info *cifs_sb,
|
|
if (inode)
|
|
open_file = find_readable_file(CIFS_I(inode), true);
|
|
if (!open_file)
|
|
- return get_cifs_acl_by_path(cifs_sb, path, pacllen);
|
|
+ return get_cifs_acl_by_path(cifs_sb, path, pacllen, info);
|
|
|
|
pntsd = get_cifs_acl_by_fid(cifs_sb, &open_file->fid, pacllen, info);
|
|
cifsFileInfo_put(open_file);
|
|
@@ -1485,7 +1488,7 @@ int set_cifs_acl(struct smb_ntsd *pnntsd, __u32 acllen,
|
|
{
|
|
int oplock = 0;
|
|
unsigned int xid;
|
|
- int rc, access_flags;
|
|
+ int rc, access_flags = 0;
|
|
struct cifs_tcon *tcon;
|
|
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
|
|
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
|
|
@@ -1498,10 +1501,12 @@ int set_cifs_acl(struct smb_ntsd *pnntsd, __u32 acllen,
|
|
tcon = tlink_tcon(tlink);
|
|
xid = get_xid();
|
|
|
|
- if (aclflag == CIFS_ACL_OWNER || aclflag == CIFS_ACL_GROUP)
|
|
- access_flags = WRITE_OWNER;
|
|
- else
|
|
- access_flags = WRITE_DAC;
|
|
+ if (aclflag & CIFS_ACL_OWNER || aclflag & CIFS_ACL_GROUP)
|
|
+ access_flags |= WRITE_OWNER;
|
|
+ if (aclflag & CIFS_ACL_SACL)
|
|
+ access_flags |= SYSTEM_SECURITY;
|
|
+ if (aclflag & CIFS_ACL_DACL)
|
|
+ access_flags |= WRITE_DAC;
|
|
|
|
oparms = (struct cifs_open_parms) {
|
|
.tcon = tcon,
|
|
diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h
|
|
index a151ffffc6f38e..85b0a30493a638 100644
|
|
--- a/fs/smb/client/cifsproto.h
|
|
+++ b/fs/smb/client/cifsproto.h
|
|
@@ -570,7 +570,7 @@ extern int CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
|
|
const struct nls_table *nls_codepage,
|
|
struct cifs_sb_info *cifs_sb);
|
|
extern int CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon,
|
|
- __u16 fid, struct smb_ntsd **acl_inf, __u32 *buflen);
|
|
+ __u16 fid, struct smb_ntsd **acl_inf, __u32 *buflen, __u32 info);
|
|
extern int CIFSSMBSetCIFSACL(const unsigned int, struct cifs_tcon *, __u16,
|
|
struct smb_ntsd *pntsd, __u32 len, int aclflag);
|
|
extern int cifs_do_get_acl(const unsigned int xid, struct cifs_tcon *tcon,
|
|
diff --git a/fs/smb/client/cifssmb.c b/fs/smb/client/cifssmb.c
|
|
index 2f8745736dbb02..769950adb7763b 100644
|
|
--- a/fs/smb/client/cifssmb.c
|
|
+++ b/fs/smb/client/cifssmb.c
|
|
@@ -3385,7 +3385,7 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
|
|
/* Get Security Descriptor (by handle) from remote server for a file or dir */
|
|
int
|
|
CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
|
|
- struct smb_ntsd **acl_inf, __u32 *pbuflen)
|
|
+ struct smb_ntsd **acl_inf, __u32 *pbuflen, __u32 info)
|
|
{
|
|
int rc = 0;
|
|
int buf_type = 0;
|
|
@@ -3408,7 +3408,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
|
|
pSMB->MaxSetupCount = 0;
|
|
pSMB->Fid = fid; /* file handle always le */
|
|
pSMB->AclFlags = cpu_to_le32(CIFS_ACL_OWNER | CIFS_ACL_GROUP |
|
|
- CIFS_ACL_DACL);
|
|
+ CIFS_ACL_DACL | info);
|
|
pSMB->ByteCount = cpu_to_le16(11); /* 3 bytes pad + 8 bytes parm */
|
|
inc_rfc1001_len(pSMB, 11);
|
|
iov[0].iov_base = (char *)pSMB;
|
|
diff --git a/fs/smb/client/readdir.c b/fs/smb/client/readdir.c
|
|
index 3cffdf3975a213..75929a0a56f969 100644
|
|
--- a/fs/smb/client/readdir.c
|
|
+++ b/fs/smb/client/readdir.c
|
|
@@ -413,7 +413,7 @@ _initiate_cifs_search(const unsigned int xid, struct file *file,
|
|
cifsFile->invalidHandle = false;
|
|
} else if ((rc == -EOPNOTSUPP) &&
|
|
(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) {
|
|
- cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM;
|
|
+ cifs_autodisable_serverino(cifs_sb);
|
|
goto ffirst_retry;
|
|
}
|
|
error_exit:
|
|
diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c
|
|
index d3abb99cc99094..e56a8df23fec9a 100644
|
|
--- a/fs/smb/client/reparse.c
|
|
+++ b/fs/smb/client/reparse.c
|
|
@@ -674,11 +674,12 @@ int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb,
|
|
return parse_reparse_point(buf, plen, cifs_sb, full_path, true, data);
|
|
}
|
|
|
|
-static void wsl_to_fattr(struct cifs_open_info_data *data,
|
|
+static bool wsl_to_fattr(struct cifs_open_info_data *data,
|
|
struct cifs_sb_info *cifs_sb,
|
|
u32 tag, struct cifs_fattr *fattr)
|
|
{
|
|
struct smb2_file_full_ea_info *ea;
|
|
+ bool have_xattr_dev = false;
|
|
u32 next = 0;
|
|
|
|
switch (tag) {
|
|
@@ -721,13 +722,24 @@ static void wsl_to_fattr(struct cifs_open_info_data *data,
|
|
fattr->cf_uid = wsl_make_kuid(cifs_sb, v);
|
|
else if (!strncmp(name, SMB2_WSL_XATTR_GID, nlen))
|
|
fattr->cf_gid = wsl_make_kgid(cifs_sb, v);
|
|
- else if (!strncmp(name, SMB2_WSL_XATTR_MODE, nlen))
|
|
+ else if (!strncmp(name, SMB2_WSL_XATTR_MODE, nlen)) {
|
|
+ /* File type in reparse point tag and in xattr mode must match. */
|
|
+ if (S_DT(fattr->cf_mode) != S_DT(le32_to_cpu(*(__le32 *)v)))
|
|
+ return false;
|
|
fattr->cf_mode = (umode_t)le32_to_cpu(*(__le32 *)v);
|
|
- else if (!strncmp(name, SMB2_WSL_XATTR_DEV, nlen))
|
|
+ } else if (!strncmp(name, SMB2_WSL_XATTR_DEV, nlen)) {
|
|
fattr->cf_rdev = reparse_mkdev(v);
|
|
+ have_xattr_dev = true;
|
|
+ }
|
|
} while (next);
|
|
out:
|
|
+
|
|
+ /* Major and minor numbers for char and block devices are mandatory. */
|
|
+ if (!have_xattr_dev && (tag == IO_REPARSE_TAG_LX_CHR || tag == IO_REPARSE_TAG_LX_BLK))
|
|
+ return false;
|
|
+
|
|
fattr->cf_dtype = S_DT(fattr->cf_mode);
|
|
+ return true;
|
|
}
|
|
|
|
static bool posix_reparse_to_fattr(struct cifs_sb_info *cifs_sb,
|
|
@@ -801,7 +813,9 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
|
|
case IO_REPARSE_TAG_AF_UNIX:
|
|
case IO_REPARSE_TAG_LX_CHR:
|
|
case IO_REPARSE_TAG_LX_BLK:
|
|
- wsl_to_fattr(data, cifs_sb, tag, fattr);
|
|
+ ok = wsl_to_fattr(data, cifs_sb, tag, fattr);
|
|
+ if (!ok)
|
|
+ return false;
|
|
break;
|
|
case IO_REPARSE_TAG_NFS:
|
|
ok = posix_reparse_to_fattr(cifs_sb, fattr, data);
|
|
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
|
|
index fc6d00344c50ea..d4be915bcb70c7 100644
|
|
--- a/fs/smb/client/smb2ops.c
|
|
+++ b/fs/smb/client/smb2ops.c
|
|
@@ -622,7 +622,8 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
|
|
|
|
while (bytes_left >= (ssize_t)sizeof(*p)) {
|
|
memset(&tmp_iface, 0, sizeof(tmp_iface));
|
|
- tmp_iface.speed = le64_to_cpu(p->LinkSpeed);
|
|
+ /* default to 1Gbps when link speed is unset */
|
|
+ tmp_iface.speed = le64_to_cpu(p->LinkSpeed) ?: 1000000000;
|
|
tmp_iface.rdma_capable = le32_to_cpu(p->Capability & RDMA_CAPABLE) ? 1 : 0;
|
|
tmp_iface.rss_capable = le32_to_cpu(p->Capability & RSS_CAPABLE) ? 1 : 0;
|
|
|
|
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
|
|
index eef9e527d9ff94..ff9e574c07a87d 100644
|
|
--- a/fs/ubifs/debug.c
|
|
+++ b/fs/ubifs/debug.c
|
|
@@ -946,16 +946,20 @@ void ubifs_dump_tnc(struct ubifs_info *c)
|
|
|
|
pr_err("\n");
|
|
pr_err("(pid %d) start dumping TNC tree\n", current->pid);
|
|
- znode = ubifs_tnc_levelorder_next(c, c->zroot.znode, NULL);
|
|
- level = znode->level;
|
|
- pr_err("== Level %d ==\n", level);
|
|
- while (znode) {
|
|
- if (level != znode->level) {
|
|
- level = znode->level;
|
|
- pr_err("== Level %d ==\n", level);
|
|
+ if (c->zroot.znode) {
|
|
+ znode = ubifs_tnc_levelorder_next(c, c->zroot.znode, NULL);
|
|
+ level = znode->level;
|
|
+ pr_err("== Level %d ==\n", level);
|
|
+ while (znode) {
|
|
+ if (level != znode->level) {
|
|
+ level = znode->level;
|
|
+ pr_err("== Level %d ==\n", level);
|
|
+ }
|
|
+ ubifs_dump_znode(c, znode);
|
|
+ znode = ubifs_tnc_levelorder_next(c, c->zroot.znode, znode);
|
|
}
|
|
- ubifs_dump_znode(c, znode);
|
|
- znode = ubifs_tnc_levelorder_next(c, c->zroot.znode, znode);
|
|
+ } else {
|
|
+ pr_err("empty TNC tree in memory\n");
|
|
}
|
|
pr_err("(pid %d) finish dumping TNC tree\n", current->pid);
|
|
}
|
|
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
|
|
index a3c9dd4a1ac33c..7e9e7e76904369 100644
|
|
--- a/include/acpi/acpixf.h
|
|
+++ b/include/acpi/acpixf.h
|
|
@@ -763,6 +763,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
|
*event_status))
|
|
ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number))
|
|
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_hw_disable_all_gpes(void))
|
|
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_hw_enable_all_wakeup_gpes(void))
|
|
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
|
|
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
|
|
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void))
|
|
diff --git a/include/dt-bindings/clock/sun50i-a64-ccu.h b/include/dt-bindings/clock/sun50i-a64-ccu.h
|
|
index 175892189e9dcb..4f220ea7a23cc5 100644
|
|
--- a/include/dt-bindings/clock/sun50i-a64-ccu.h
|
|
+++ b/include/dt-bindings/clock/sun50i-a64-ccu.h
|
|
@@ -44,7 +44,9 @@
|
|
#define _DT_BINDINGS_CLK_SUN50I_A64_H_
|
|
|
|
#define CLK_PLL_VIDEO0 7
|
|
+#define CLK_PLL_VIDEO0_2X 8
|
|
#define CLK_PLL_PERIPH0 11
|
|
+#define CLK_PLL_MIPI 17
|
|
|
|
#define CLK_CPUX 21
|
|
#define CLK_BUS_MIPI_DSI 28
|
|
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
|
|
index 44e9de51eedfb6..572030db2f0616 100644
|
|
--- a/include/linux/buffer_head.h
|
|
+++ b/include/linux/buffer_head.h
|
|
@@ -203,8 +203,8 @@ struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size,
|
|
bool retry);
|
|
void create_empty_buffers(struct page *, unsigned long,
|
|
unsigned long b_state);
|
|
-void folio_create_empty_buffers(struct folio *folio, unsigned long blocksize,
|
|
- unsigned long b_state);
|
|
+struct buffer_head *folio_create_empty_buffers(struct folio *folio,
|
|
+ unsigned long blocksize, unsigned long b_state);
|
|
void end_buffer_read_sync(struct buffer_head *bh, int uptodate);
|
|
void end_buffer_write_sync(struct buffer_head *bh, int uptodate);
|
|
void end_buffer_async_write(struct buffer_head *bh, int uptodate);
|
|
diff --git a/include/linux/hid.h b/include/linux/hid.h
|
|
index af55a25db91b0d..774cb25dec34c5 100644
|
|
--- a/include/linux/hid.h
|
|
+++ b/include/linux/hid.h
|
|
@@ -218,6 +218,7 @@ struct hid_item {
|
|
#define HID_GD_DOWN 0x00010091
|
|
#define HID_GD_RIGHT 0x00010092
|
|
#define HID_GD_LEFT 0x00010093
|
|
+#define HID_GD_DO_NOT_DISTURB 0x0001009b
|
|
/* Microsoft Win8 Wireless Radio Controls CA usage codes */
|
|
#define HID_GD_RFKILL_BTN 0x000100c6
|
|
#define HID_GD_RFKILL_LED 0x000100c7
|
|
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
|
|
index 5f1e5a16d7b2c3..0ff10007eb1a5e 100644
|
|
--- a/include/linux/ieee80211.h
|
|
+++ b/include/linux/ieee80211.h
|
|
@@ -4826,28 +4826,24 @@ static inline u8 ieee80211_mle_common_size(const u8 *data)
|
|
{
|
|
const struct ieee80211_multi_link_elem *mle = (const void *)data;
|
|
u16 control = le16_to_cpu(mle->control);
|
|
- u8 common = 0;
|
|
|
|
switch (u16_get_bits(control, IEEE80211_ML_CONTROL_TYPE)) {
|
|
case IEEE80211_ML_CONTROL_TYPE_BASIC:
|
|
case IEEE80211_ML_CONTROL_TYPE_PREQ:
|
|
case IEEE80211_ML_CONTROL_TYPE_TDLS:
|
|
case IEEE80211_ML_CONTROL_TYPE_RECONF:
|
|
+ case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS:
|
|
/*
|
|
* The length is the first octet pointed by mle->variable so no
|
|
* need to add anything
|
|
*/
|
|
break;
|
|
- case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS:
|
|
- if (control & IEEE80211_MLC_PRIO_ACCESS_PRES_AP_MLD_MAC_ADDR)
|
|
- common += ETH_ALEN;
|
|
- return common;
|
|
default:
|
|
WARN_ON(1);
|
|
return 0;
|
|
}
|
|
|
|
- return sizeof(*mle) + common + mle->variable[0];
|
|
+ return sizeof(*mle) + mle->variable[0];
|
|
}
|
|
|
|
/**
|
|
@@ -4989,8 +4985,7 @@ static inline bool ieee80211_mle_size_ok(const u8 *data, size_t len)
|
|
check_common_len = true;
|
|
break;
|
|
case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS:
|
|
- if (control & IEEE80211_MLC_PRIO_ACCESS_PRES_AP_MLD_MAC_ADDR)
|
|
- common += ETH_ALEN;
|
|
+ common = ETH_ALEN + 1;
|
|
break;
|
|
default:
|
|
/* we don't know this type */
|
|
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
|
|
index c3f075e8f60cb6..1c6a6c1704d8d0 100644
|
|
--- a/include/linux/kallsyms.h
|
|
+++ b/include/linux/kallsyms.h
|
|
@@ -57,10 +57,10 @@ static inline void *dereference_symbol_descriptor(void *ptr)
|
|
|
|
preempt_disable();
|
|
mod = __module_address((unsigned long)ptr);
|
|
- preempt_enable();
|
|
|
|
if (mod)
|
|
ptr = dereference_module_function_descriptor(mod, ptr);
|
|
+ preempt_enable();
|
|
#endif
|
|
return ptr;
|
|
}
|
|
diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h
|
|
index fecc2fa2a36475..aad9c6b5046368 100644
|
|
--- a/include/linux/mfd/syscon.h
|
|
+++ b/include/linux/mfd/syscon.h
|
|
@@ -17,20 +17,19 @@
|
|
struct device_node;
|
|
|
|
#ifdef CONFIG_MFD_SYSCON
|
|
-extern struct regmap *device_node_to_regmap(struct device_node *np);
|
|
-extern struct regmap *syscon_node_to_regmap(struct device_node *np);
|
|
-extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
|
|
-extern struct regmap *syscon_regmap_lookup_by_phandle(
|
|
- struct device_node *np,
|
|
- const char *property);
|
|
-extern struct regmap *syscon_regmap_lookup_by_phandle_args(
|
|
- struct device_node *np,
|
|
- const char *property,
|
|
- int arg_count,
|
|
- unsigned int *out_args);
|
|
-extern struct regmap *syscon_regmap_lookup_by_phandle_optional(
|
|
- struct device_node *np,
|
|
- const char *property);
|
|
+struct regmap *device_node_to_regmap(struct device_node *np);
|
|
+struct regmap *syscon_node_to_regmap(struct device_node *np);
|
|
+struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
|
|
+struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np,
|
|
+ const char *property);
|
|
+struct regmap *syscon_regmap_lookup_by_phandle_args(struct device_node *np,
|
|
+ const char *property,
|
|
+ int arg_count,
|
|
+ unsigned int *out_args);
|
|
+struct regmap *syscon_regmap_lookup_by_phandle_optional(struct device_node *np,
|
|
+ const char *property);
|
|
+int of_syscon_register_regmap(struct device_node *np,
|
|
+ struct regmap *regmap);
|
|
#else
|
|
static inline struct regmap *device_node_to_regmap(struct device_node *np)
|
|
{
|
|
@@ -70,6 +69,12 @@ static inline struct regmap *syscon_regmap_lookup_by_phandle_optional(
|
|
return NULL;
|
|
}
|
|
|
|
+static inline int of_syscon_register_regmap(struct device_node *np,
|
|
+ struct regmap *regmap)
|
|
+{
|
|
+ return -EOPNOTSUPP;
|
|
+}
|
|
+
|
|
#endif
|
|
|
|
#endif /* __LINUX_MFD_SYSCON_H__ */
|
|
diff --git a/include/linux/mroute_base.h b/include/linux/mroute_base.h
|
|
index 9dd4bf1572553f..58a2401e4b551b 100644
|
|
--- a/include/linux/mroute_base.h
|
|
+++ b/include/linux/mroute_base.h
|
|
@@ -146,9 +146,9 @@ struct mr_mfc {
|
|
unsigned long last_assert;
|
|
int minvif;
|
|
int maxvif;
|
|
- unsigned long bytes;
|
|
- unsigned long pkt;
|
|
- unsigned long wrong_if;
|
|
+ atomic_long_t bytes;
|
|
+ atomic_long_t pkt;
|
|
+ atomic_long_t wrong_if;
|
|
unsigned long lastuse;
|
|
unsigned char ttls[MAXVIFS];
|
|
refcount_t refcount;
|
|
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
|
|
index 1576e7443eee50..8b5121eb8757ef 100644
|
|
--- a/include/linux/netdevice.h
|
|
+++ b/include/linux/netdevice.h
|
|
@@ -2217,7 +2217,7 @@ struct net_device {
|
|
void *atalk_ptr;
|
|
#endif
|
|
#if IS_ENABLED(CONFIG_AX25)
|
|
- void *ax25_ptr;
|
|
+ struct ax25_dev __rcu *ax25_ptr;
|
|
#endif
|
|
#if IS_ENABLED(CONFIG_CFG80211)
|
|
struct wireless_dev *ieee80211_ptr;
|
|
diff --git a/include/linux/of.h b/include/linux/of.h
|
|
index 024dda54b9c776..afee93163fddd5 100644
|
|
--- a/include/linux/of.h
|
|
+++ b/include/linux/of.h
|
|
@@ -423,11 +423,9 @@ extern int of_detach_node(struct device_node *);
|
|
#define of_match_ptr(_ptr) (_ptr)
|
|
|
|
/*
|
|
- * struct property *prop;
|
|
- * const __be32 *p;
|
|
* u32 u;
|
|
*
|
|
- * of_property_for_each_u32(np, "propname", prop, p, u)
|
|
+ * of_property_for_each_u32(np, "propname", u)
|
|
* printk("U32 value: %x\n", u);
|
|
*/
|
|
const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
|
|
@@ -1399,11 +1397,12 @@ static inline int of_property_read_s32(const struct device_node *np,
|
|
err == 0; \
|
|
err = of_phandle_iterator_next(it))
|
|
|
|
-#define of_property_for_each_u32(np, propname, prop, p, u) \
|
|
- for (prop = of_find_property(np, propname, NULL), \
|
|
- p = of_prop_next_u32(prop, NULL, &u); \
|
|
- p; \
|
|
- p = of_prop_next_u32(prop, p, &u))
|
|
+#define of_property_for_each_u32(np, propname, u) \
|
|
+ for (struct {struct property *prop; const __be32 *item; } _it = \
|
|
+ {of_find_property(np, propname, NULL), \
|
|
+ of_prop_next_u32(_it.prop, NULL, &u)}; \
|
|
+ _it.item; \
|
|
+ _it.item = of_prop_next_u32(_it.prop, _it.item, &u))
|
|
|
|
#define of_property_for_each_string(np, propname, prop, s) \
|
|
for (prop = of_find_property(np, propname, NULL), \
|
|
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
|
|
index 7a5563ffe61b53..fcb834dd75c240 100644
|
|
--- a/include/linux/perf_event.h
|
|
+++ b/include/linux/perf_event.h
|
|
@@ -1231,12 +1231,18 @@ static inline void perf_sample_save_callchain(struct perf_sample_data *data,
|
|
}
|
|
|
|
static inline void perf_sample_save_raw_data(struct perf_sample_data *data,
|
|
+ struct perf_event *event,
|
|
struct perf_raw_record *raw)
|
|
{
|
|
struct perf_raw_frag *frag = &raw->frag;
|
|
u32 sum = 0;
|
|
int size;
|
|
|
|
+ if (!(event->attr.sample_type & PERF_SAMPLE_RAW))
|
|
+ return;
|
|
+ if (WARN_ON_ONCE(data->sample_flags & PERF_SAMPLE_RAW))
|
|
+ return;
|
|
+
|
|
do {
|
|
sum += frag->size;
|
|
if (perf_raw_frag_last(frag))
|
|
diff --git a/include/linux/platform_data/pca953x.h b/include/linux/platform_data/pca953x.h
|
|
index 96c1a14ab3657a..3c3787c4d96ca2 100644
|
|
--- a/include/linux/platform_data/pca953x.h
|
|
+++ b/include/linux/platform_data/pca953x.h
|
|
@@ -11,21 +11,8 @@ struct pca953x_platform_data {
|
|
/* number of the first GPIO */
|
|
unsigned gpio_base;
|
|
|
|
- /* initial polarity inversion setting */
|
|
- u32 invert;
|
|
-
|
|
/* interrupt base */
|
|
int irq_base;
|
|
-
|
|
- void *context; /* param to setup/teardown */
|
|
-
|
|
- int (*setup)(struct i2c_client *client,
|
|
- unsigned gpio, unsigned ngpio,
|
|
- void *context);
|
|
- void (*teardown)(struct i2c_client *client,
|
|
- unsigned gpio, unsigned ngpio,
|
|
- void *context);
|
|
- const char *const *names;
|
|
};
|
|
|
|
#endif /* _LINUX_PCA953X_H */
|
|
diff --git a/include/linux/platform_data/si5351.h b/include/linux/platform_data/si5351.h
|
|
index c71a2dd661437a..5f412a615532bb 100644
|
|
--- a/include/linux/platform_data/si5351.h
|
|
+++ b/include/linux/platform_data/si5351.h
|
|
@@ -105,10 +105,12 @@ struct si5351_clkout_config {
|
|
* @clk_xtal: xtal input clock
|
|
* @clk_clkin: clkin input clock
|
|
* @pll_src: array of pll source clock setting
|
|
+ * @pll_reset: array indicating if plls should be reset after setting the rate
|
|
* @clkout: array of clkout configuration
|
|
*/
|
|
struct si5351_platform_data {
|
|
enum si5351_pll_src pll_src[2];
|
|
+ bool pll_reset[2];
|
|
struct si5351_clkout_config clkout[8];
|
|
};
|
|
|
|
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
|
|
index 78c8ac4951b581..c7abce28ed2995 100644
|
|
--- a/include/linux/pps_kernel.h
|
|
+++ b/include/linux/pps_kernel.h
|
|
@@ -56,8 +56,7 @@ struct pps_device {
|
|
|
|
unsigned int id; /* PPS source unique ID */
|
|
void const *lookup_cookie; /* For pps_lookup_dev() only */
|
|
- struct cdev cdev;
|
|
- struct device *dev;
|
|
+ struct device dev;
|
|
struct fasync_struct *async_queue; /* fasync method */
|
|
spinlock_t lock;
|
|
};
|
|
diff --git a/include/linux/sched.h b/include/linux/sched.h
|
|
index d4f9d82c69e0b0..2af0a8859d6473 100644
|
|
--- a/include/linux/sched.h
|
|
+++ b/include/linux/sched.h
|
|
@@ -896,6 +896,7 @@ struct task_struct {
|
|
unsigned sched_reset_on_fork:1;
|
|
unsigned sched_contributes_to_load:1;
|
|
unsigned sched_migrated:1;
|
|
+ unsigned sched_task_hot:1;
|
|
|
|
/* Force alignment to the next boundary: */
|
|
unsigned :0;
|
|
diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h
|
|
index ab7ca872950bb1..0bdb4f565d0f89 100644
|
|
--- a/include/linux/usb/tcpm.h
|
|
+++ b/include/linux/usb/tcpm.h
|
|
@@ -150,7 +150,8 @@ struct tcpc_dev {
|
|
void (*frs_sourcing_vbus)(struct tcpc_dev *dev);
|
|
int (*enable_auto_vbus_discharge)(struct tcpc_dev *dev, bool enable);
|
|
int (*set_auto_vbus_discharge_threshold)(struct tcpc_dev *dev, enum typec_pwr_opmode mode,
|
|
- bool pps_active, u32 requested_vbus_voltage);
|
|
+ bool pps_active, u32 requested_vbus_voltage,
|
|
+ u32 pps_apdo_min_voltage);
|
|
bool (*is_vbus_vsafe0v)(struct tcpc_dev *dev);
|
|
void (*set_partner_usb_comm_capable)(struct tcpc_dev *dev, bool enable);
|
|
void (*check_contaminant)(struct tcpc_dev *dev);
|
|
diff --git a/include/net/ax25.h b/include/net/ax25.h
|
|
index c2a85fd3f5ea40..ef79023f1a286f 100644
|
|
--- a/include/net/ax25.h
|
|
+++ b/include/net/ax25.h
|
|
@@ -229,6 +229,7 @@ typedef struct ax25_dev {
|
|
#endif
|
|
refcount_t refcount;
|
|
bool device_up;
|
|
+ struct rcu_head rcu;
|
|
} ax25_dev;
|
|
|
|
typedef struct ax25_cb {
|
|
@@ -288,9 +289,8 @@ static inline void ax25_dev_hold(ax25_dev *ax25_dev)
|
|
|
|
static inline void ax25_dev_put(ax25_dev *ax25_dev)
|
|
{
|
|
- if (refcount_dec_and_test(&ax25_dev->refcount)) {
|
|
- kfree(ax25_dev);
|
|
- }
|
|
+ if (refcount_dec_and_test(&ax25_dev->refcount))
|
|
+ kfree_rcu(ax25_dev, rcu);
|
|
}
|
|
static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev)
|
|
{
|
|
@@ -333,9 +333,9 @@ void ax25_digi_invert(const ax25_digi *, ax25_digi *);
|
|
extern spinlock_t ax25_dev_lock;
|
|
|
|
#if IS_ENABLED(CONFIG_AX25)
|
|
-static inline ax25_dev *ax25_dev_ax25dev(struct net_device *dev)
|
|
+static inline ax25_dev *ax25_dev_ax25dev(const struct net_device *dev)
|
|
{
|
|
- return dev->ax25_ptr;
|
|
+ return rcu_dereference_rtnl(dev->ax25_ptr);
|
|
}
|
|
#endif
|
|
|
|
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
|
|
index 74ff688568a0c6..f475757daafba9 100644
|
|
--- a/include/net/inetpeer.h
|
|
+++ b/include/net/inetpeer.h
|
|
@@ -96,30 +96,28 @@ static inline struct in6_addr *inetpeer_get_addr_v6(struct inetpeer_addr *iaddr)
|
|
|
|
/* can be called with or without local BH being disabled */
|
|
struct inet_peer *inet_getpeer(struct inet_peer_base *base,
|
|
- const struct inetpeer_addr *daddr,
|
|
- int create);
|
|
+ const struct inetpeer_addr *daddr);
|
|
|
|
static inline struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base,
|
|
__be32 v4daddr,
|
|
- int vif, int create)
|
|
+ int vif)
|
|
{
|
|
struct inetpeer_addr daddr;
|
|
|
|
daddr.a4.addr = v4daddr;
|
|
daddr.a4.vif = vif;
|
|
daddr.family = AF_INET;
|
|
- return inet_getpeer(base, &daddr, create);
|
|
+ return inet_getpeer(base, &daddr);
|
|
}
|
|
|
|
static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
|
|
- const struct in6_addr *v6daddr,
|
|
- int create)
|
|
+ const struct in6_addr *v6daddr)
|
|
{
|
|
struct inetpeer_addr daddr;
|
|
|
|
daddr.a6 = *v6daddr;
|
|
daddr.family = AF_INET6;
|
|
- return inet_getpeer(base, &daddr, create);
|
|
+ return inet_getpeer(base, &daddr);
|
|
}
|
|
|
|
static inline int inetpeer_addr_cmp(const struct inetpeer_addr *a,
|
|
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
|
|
index 8321915dddb284..dcbf3f299548f7 100644
|
|
--- a/include/net/netfilter/nf_tables.h
|
|
+++ b/include/net/netfilter/nf_tables.h
|
|
@@ -429,6 +429,9 @@ struct nft_set_ext;
|
|
* @remove: remove element from set
|
|
* @walk: iterate over all set elements
|
|
* @get: get set elements
|
|
+ * @ksize: kernel set size
|
|
+ * @usize: userspace set size
|
|
+ * @adjust_maxsize: delta to adjust maximum set size
|
|
* @commit: commit set elements
|
|
* @abort: abort set elements
|
|
* @privsize: function to return size of set private data
|
|
@@ -481,7 +484,10 @@ struct nft_set_ops {
|
|
const struct nft_set *set,
|
|
const struct nft_set_elem *elem,
|
|
unsigned int flags);
|
|
- void (*commit)(const struct nft_set *set);
|
|
+ u32 (*ksize)(u32 size);
|
|
+ u32 (*usize)(u32 size);
|
|
+ u32 (*adjust_maxsize)(const struct nft_set *set);
|
|
+ void (*commit)(struct nft_set *set);
|
|
void (*abort)(const struct nft_set *set);
|
|
u64 (*privsize)(const struct nlattr * const nla[],
|
|
const struct nft_set_desc *desc);
|
|
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
|
|
index 93a9866ee481fa..b33d27e42cff38 100644
|
|
--- a/include/net/xfrm.h
|
|
+++ b/include/net/xfrm.h
|
|
@@ -1181,9 +1181,19 @@ static inline int __xfrm_policy_check2(struct sock *sk, int dir,
|
|
|
|
if (xo) {
|
|
x = xfrm_input_state(skb);
|
|
- if (x->xso.type == XFRM_DEV_OFFLOAD_PACKET)
|
|
- return (xo->flags & CRYPTO_DONE) &&
|
|
- (xo->status & CRYPTO_SUCCESS);
|
|
+ if (x->xso.type == XFRM_DEV_OFFLOAD_PACKET) {
|
|
+ bool check = (xo->flags & CRYPTO_DONE) &&
|
|
+ (xo->status & CRYPTO_SUCCESS);
|
|
+
|
|
+ /* The packets here are plain ones and secpath was
|
|
+ * needed to indicate that hardware already handled
|
|
+ * them and there is no need to do nothing in addition.
|
|
+ *
|
|
+ * Consume secpath which was set by drivers.
|
|
+ */
|
|
+ secpath_reset(skb);
|
|
+ return check;
|
|
+ }
|
|
}
|
|
|
|
return __xfrm_check_nopolicy(net, skb, dir) ||
|
|
diff --git a/include/trace/events/afs.h b/include/trace/events/afs.h
|
|
index d1ee4272d1cb8b..ceb0146ffc7cd1 100644
|
|
--- a/include/trace/events/afs.h
|
|
+++ b/include/trace/events/afs.h
|
|
@@ -118,6 +118,8 @@ enum yfs_cm_operation {
|
|
*/
|
|
#define afs_call_traces \
|
|
EM(afs_call_trace_alloc, "ALLOC") \
|
|
+ EM(afs_call_trace_async_abort, "ASYAB") \
|
|
+ EM(afs_call_trace_async_kill, "ASYKL") \
|
|
EM(afs_call_trace_free, "FREE ") \
|
|
EM(afs_call_trace_get, "GET ") \
|
|
EM(afs_call_trace_put, "PUT ") \
|
|
diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h
|
|
index ed36f5f577a9d3..252bb90aca599b 100644
|
|
--- a/include/trace/events/rxrpc.h
|
|
+++ b/include/trace/events/rxrpc.h
|
|
@@ -117,6 +117,7 @@
|
|
#define rxrpc_call_poke_traces \
|
|
EM(rxrpc_call_poke_abort, "Abort") \
|
|
EM(rxrpc_call_poke_complete, "Compl") \
|
|
+ EM(rxrpc_call_poke_conn_abort, "Conn-abort") \
|
|
EM(rxrpc_call_poke_error, "Error") \
|
|
EM(rxrpc_call_poke_idle, "Idle") \
|
|
EM(rxrpc_call_poke_start, "Start") \
|
|
@@ -278,6 +279,7 @@
|
|
EM(rxrpc_call_see_activate_client, "SEE act-clnt") \
|
|
EM(rxrpc_call_see_connect_failed, "SEE con-fail") \
|
|
EM(rxrpc_call_see_connected, "SEE connect ") \
|
|
+ EM(rxrpc_call_see_conn_abort, "SEE conn-abt") \
|
|
EM(rxrpc_call_see_disconnected, "SEE disconn ") \
|
|
EM(rxrpc_call_see_distribute_error, "SEE dist-err") \
|
|
EM(rxrpc_call_see_input, "SEE input ") \
|
|
@@ -961,6 +963,29 @@ TRACE_EVENT(rxrpc_rx_abort,
|
|
__entry->abort_code)
|
|
);
|
|
|
|
+TRACE_EVENT(rxrpc_rx_conn_abort,
|
|
+ TP_PROTO(const struct rxrpc_connection *conn, const struct sk_buff *skb),
|
|
+
|
|
+ TP_ARGS(conn, skb),
|
|
+
|
|
+ TP_STRUCT__entry(
|
|
+ __field(unsigned int, conn)
|
|
+ __field(rxrpc_serial_t, serial)
|
|
+ __field(u32, abort_code)
|
|
+ ),
|
|
+
|
|
+ TP_fast_assign(
|
|
+ __entry->conn = conn->debug_id;
|
|
+ __entry->serial = rxrpc_skb(skb)->hdr.serial;
|
|
+ __entry->abort_code = skb->priority;
|
|
+ ),
|
|
+
|
|
+ TP_printk("C=%08x ABORT %08x ac=%d",
|
|
+ __entry->conn,
|
|
+ __entry->serial,
|
|
+ __entry->abort_code)
|
|
+ );
|
|
+
|
|
TRACE_EVENT(rxrpc_rx_challenge,
|
|
TP_PROTO(struct rxrpc_connection *conn, rxrpc_serial_t serial,
|
|
u32 version, u32 nonce, u32 min_level),
|
|
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
|
|
index 5fa19861cda546..2cbd1c24414c61 100644
|
|
--- a/io_uring/uring_cmd.c
|
|
+++ b/io_uring/uring_cmd.c
|
|
@@ -175,7 +175,7 @@ int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags)
|
|
if (!prot || !prot->ioctl)
|
|
return -EOPNOTSUPP;
|
|
|
|
- switch (cmd->sqe->cmd_op) {
|
|
+ switch (cmd->cmd_op) {
|
|
case SOCKET_URING_OP_SIOCINQ:
|
|
ret = prot->ioctl(sk, SIOCINQ, &arg);
|
|
if (ret)
|
|
diff --git a/kernel/bpf/bpf_local_storage.c b/kernel/bpf/bpf_local_storage.c
|
|
index e8d02212da7039..b4c6b9b3cb421e 100644
|
|
--- a/kernel/bpf/bpf_local_storage.c
|
|
+++ b/kernel/bpf/bpf_local_storage.c
|
|
@@ -823,8 +823,12 @@ bpf_local_storage_map_alloc(union bpf_attr *attr,
|
|
smap->elem_size = offsetof(struct bpf_local_storage_elem,
|
|
sdata.data[attr->value_size]);
|
|
|
|
- smap->bpf_ma = bpf_ma;
|
|
- if (bpf_ma) {
|
|
+ /* In PREEMPT_RT, kmalloc(GFP_ATOMIC) is still not safe in non
|
|
+ * preemptible context. Thus, enforce all storages to use
|
|
+ * bpf_mem_alloc when CONFIG_PREEMPT_RT is enabled.
|
|
+ */
|
|
+ smap->bpf_ma = IS_ENABLED(CONFIG_PREEMPT_RT) ? true : bpf_ma;
|
|
+ if (smap->bpf_ma) {
|
|
err = bpf_mem_alloc_init(&smap->selem_ma, smap->elem_size, false);
|
|
if (err)
|
|
goto free_smap;
|
|
diff --git a/kernel/events/core.c b/kernel/events/core.c
|
|
index ec0fae49a0dd9a..5d6458ea675e9d 100644
|
|
--- a/kernel/events/core.c
|
|
+++ b/kernel/events/core.c
|
|
@@ -10157,9 +10157,9 @@ static struct pmu perf_tracepoint = {
|
|
};
|
|
|
|
static int perf_tp_filter_match(struct perf_event *event,
|
|
- struct perf_sample_data *data)
|
|
+ struct perf_raw_record *raw)
|
|
{
|
|
- void *record = data->raw->frag.data;
|
|
+ void *record = raw->frag.data;
|
|
|
|
/* only top level events have filters set */
|
|
if (event->parent)
|
|
@@ -10171,7 +10171,7 @@ static int perf_tp_filter_match(struct perf_event *event,
|
|
}
|
|
|
|
static int perf_tp_event_match(struct perf_event *event,
|
|
- struct perf_sample_data *data,
|
|
+ struct perf_raw_record *raw,
|
|
struct pt_regs *regs)
|
|
{
|
|
if (event->hw.state & PERF_HES_STOPPED)
|
|
@@ -10182,7 +10182,7 @@ static int perf_tp_event_match(struct perf_event *event,
|
|
if (event->attr.exclude_kernel && !user_mode(regs))
|
|
return 0;
|
|
|
|
- if (!perf_tp_filter_match(event, data))
|
|
+ if (!perf_tp_filter_match(event, raw))
|
|
return 0;
|
|
|
|
return 1;
|
|
@@ -10208,6 +10208,7 @@ EXPORT_SYMBOL_GPL(perf_trace_run_bpf_submit);
|
|
static void __perf_tp_event_target_task(u64 count, void *record,
|
|
struct pt_regs *regs,
|
|
struct perf_sample_data *data,
|
|
+ struct perf_raw_record *raw,
|
|
struct perf_event *event)
|
|
{
|
|
struct trace_entry *entry = record;
|
|
@@ -10217,13 +10218,17 @@ static void __perf_tp_event_target_task(u64 count, void *record,
|
|
/* Cannot deliver synchronous signal to other task. */
|
|
if (event->attr.sigtrap)
|
|
return;
|
|
- if (perf_tp_event_match(event, data, regs))
|
|
+ if (perf_tp_event_match(event, raw, regs)) {
|
|
+ perf_sample_data_init(data, 0, 0);
|
|
+ perf_sample_save_raw_data(data, event, raw);
|
|
perf_swevent_event(event, count, data, regs);
|
|
+ }
|
|
}
|
|
|
|
static void perf_tp_event_target_task(u64 count, void *record,
|
|
struct pt_regs *regs,
|
|
struct perf_sample_data *data,
|
|
+ struct perf_raw_record *raw,
|
|
struct perf_event_context *ctx)
|
|
{
|
|
unsigned int cpu = smp_processor_id();
|
|
@@ -10231,15 +10236,15 @@ static void perf_tp_event_target_task(u64 count, void *record,
|
|
struct perf_event *event, *sibling;
|
|
|
|
perf_event_groups_for_cpu_pmu(event, &ctx->pinned_groups, cpu, pmu) {
|
|
- __perf_tp_event_target_task(count, record, regs, data, event);
|
|
+ __perf_tp_event_target_task(count, record, regs, data, raw, event);
|
|
for_each_sibling_event(sibling, event)
|
|
- __perf_tp_event_target_task(count, record, regs, data, sibling);
|
|
+ __perf_tp_event_target_task(count, record, regs, data, raw, sibling);
|
|
}
|
|
|
|
perf_event_groups_for_cpu_pmu(event, &ctx->flexible_groups, cpu, pmu) {
|
|
- __perf_tp_event_target_task(count, record, regs, data, event);
|
|
+ __perf_tp_event_target_task(count, record, regs, data, raw, event);
|
|
for_each_sibling_event(sibling, event)
|
|
- __perf_tp_event_target_task(count, record, regs, data, sibling);
|
|
+ __perf_tp_event_target_task(count, record, regs, data, raw, sibling);
|
|
}
|
|
}
|
|
|
|
@@ -10257,15 +10262,10 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
|
|
},
|
|
};
|
|
|
|
- perf_sample_data_init(&data, 0, 0);
|
|
- perf_sample_save_raw_data(&data, &raw);
|
|
-
|
|
perf_trace_buf_update(record, event_type);
|
|
|
|
hlist_for_each_entry_rcu(event, head, hlist_entry) {
|
|
- if (perf_tp_event_match(event, &data, regs)) {
|
|
- perf_swevent_event(event, count, &data, regs);
|
|
-
|
|
+ if (perf_tp_event_match(event, &raw, regs)) {
|
|
/*
|
|
* Here use the same on-stack perf_sample_data,
|
|
* some members in data are event-specific and
|
|
@@ -10275,7 +10275,8 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
|
|
* because data->sample_flags is set.
|
|
*/
|
|
perf_sample_data_init(&data, 0, 0);
|
|
- perf_sample_save_raw_data(&data, &raw);
|
|
+ perf_sample_save_raw_data(&data, event, &raw);
|
|
+ perf_swevent_event(event, count, &data, regs);
|
|
}
|
|
}
|
|
|
|
@@ -10292,7 +10293,7 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
|
|
goto unlock;
|
|
|
|
raw_spin_lock(&ctx->lock);
|
|
- perf_tp_event_target_task(count, record, regs, &data, ctx);
|
|
+ perf_tp_event_target_task(count, record, regs, &data, &raw, ctx);
|
|
raw_spin_unlock(&ctx->lock);
|
|
unlock:
|
|
rcu_read_unlock();
|
|
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
|
|
index bcc7f21db9eeb3..fbeecc608f54cc 100644
|
|
--- a/kernel/irq/internals.h
|
|
+++ b/kernel/irq/internals.h
|
|
@@ -434,10 +434,6 @@ static inline struct cpumask *irq_desc_get_pending_mask(struct irq_desc *desc)
|
|
{
|
|
return desc->pending_mask;
|
|
}
|
|
-static inline bool handle_enforce_irqctx(struct irq_data *data)
|
|
-{
|
|
- return irqd_is_handle_enforce_irqctx(data);
|
|
-}
|
|
bool irq_fixup_move_pending(struct irq_desc *desc, bool force_clear);
|
|
#else /* CONFIG_GENERIC_PENDING_IRQ */
|
|
static inline bool irq_can_move_pcntxt(struct irq_data *data)
|
|
@@ -464,11 +460,12 @@ static inline bool irq_fixup_move_pending(struct irq_desc *desc, bool fclear)
|
|
{
|
|
return false;
|
|
}
|
|
+#endif /* !CONFIG_GENERIC_PENDING_IRQ */
|
|
+
|
|
static inline bool handle_enforce_irqctx(struct irq_data *data)
|
|
{
|
|
- return false;
|
|
+ return irqd_is_handle_enforce_irqctx(data);
|
|
}
|
|
-#endif /* !CONFIG_GENERIC_PENDING_IRQ */
|
|
|
|
#if !defined(CONFIG_IRQ_DOMAIN) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY)
|
|
static inline int irq_domain_activate_irq(struct irq_data *data, bool reserve)
|
|
diff --git a/kernel/padata.c b/kernel/padata.c
|
|
index 9bf77b58ee08d4..071d8cad807871 100644
|
|
--- a/kernel/padata.c
|
|
+++ b/kernel/padata.c
|
|
@@ -47,6 +47,22 @@ struct padata_mt_job_state {
|
|
static void padata_free_pd(struct parallel_data *pd);
|
|
static void __init padata_mt_helper(struct work_struct *work);
|
|
|
|
+static inline void padata_get_pd(struct parallel_data *pd)
|
|
+{
|
|
+ refcount_inc(&pd->refcnt);
|
|
+}
|
|
+
|
|
+static inline void padata_put_pd_cnt(struct parallel_data *pd, int cnt)
|
|
+{
|
|
+ if (refcount_sub_and_test(cnt, &pd->refcnt))
|
|
+ padata_free_pd(pd);
|
|
+}
|
|
+
|
|
+static inline void padata_put_pd(struct parallel_data *pd)
|
|
+{
|
|
+ padata_put_pd_cnt(pd, 1);
|
|
+}
|
|
+
|
|
static int padata_index_to_cpu(struct parallel_data *pd, int cpu_index)
|
|
{
|
|
int cpu, target_cpu;
|
|
@@ -206,7 +222,7 @@ int padata_do_parallel(struct padata_shell *ps,
|
|
if ((pinst->flags & PADATA_RESET))
|
|
goto out;
|
|
|
|
- refcount_inc(&pd->refcnt);
|
|
+ padata_get_pd(pd);
|
|
padata->pd = pd;
|
|
padata->cb_cpu = *cb_cpu;
|
|
|
|
@@ -336,8 +352,14 @@ static void padata_reorder(struct parallel_data *pd)
|
|
smp_mb();
|
|
|
|
reorder = per_cpu_ptr(pd->reorder_list, pd->cpu);
|
|
- if (!list_empty(&reorder->list) && padata_find_next(pd, false))
|
|
+ if (!list_empty(&reorder->list) && padata_find_next(pd, false)) {
|
|
+ /*
|
|
+ * Other context(eg. the padata_serial_worker) can finish the request.
|
|
+ * To avoid UAF issue, add pd ref here, and put pd ref after reorder_work finish.
|
|
+ */
|
|
+ padata_get_pd(pd);
|
|
queue_work(pinst->serial_wq, &pd->reorder_work);
|
|
+ }
|
|
}
|
|
|
|
static void invoke_padata_reorder(struct work_struct *work)
|
|
@@ -348,6 +370,8 @@ static void invoke_padata_reorder(struct work_struct *work)
|
|
pd = container_of(work, struct parallel_data, reorder_work);
|
|
padata_reorder(pd);
|
|
local_bh_enable();
|
|
+ /* Pairs with putting the reorder_work in the serial_wq */
|
|
+ padata_put_pd(pd);
|
|
}
|
|
|
|
static void padata_serial_worker(struct work_struct *serial_work)
|
|
@@ -380,8 +404,7 @@ static void padata_serial_worker(struct work_struct *serial_work)
|
|
}
|
|
local_bh_enable();
|
|
|
|
- if (refcount_sub_and_test(cnt, &pd->refcnt))
|
|
- padata_free_pd(pd);
|
|
+ padata_put_pd_cnt(pd, cnt);
|
|
}
|
|
|
|
/**
|
|
@@ -678,8 +701,7 @@ static int padata_replace(struct padata_instance *pinst)
|
|
synchronize_rcu();
|
|
|
|
list_for_each_entry_continue_reverse(ps, &pinst->pslist, list)
|
|
- if (refcount_dec_and_test(&ps->opd->refcnt))
|
|
- padata_free_pd(ps->opd);
|
|
+ padata_put_pd(ps->opd);
|
|
|
|
pinst->flags &= ~PADATA_RESET;
|
|
|
|
@@ -967,7 +989,7 @@ static ssize_t padata_sysfs_store(struct kobject *kobj, struct attribute *attr,
|
|
|
|
pinst = kobj2pinst(kobj);
|
|
pentry = attr2pentry(attr);
|
|
- if (pentry->show)
|
|
+ if (pentry->store)
|
|
ret = pentry->store(pinst, attr, buf, count);
|
|
|
|
return ret;
|
|
@@ -1118,11 +1140,16 @@ void padata_free_shell(struct padata_shell *ps)
|
|
if (!ps)
|
|
return;
|
|
|
|
+ /*
|
|
+ * Wait for all _do_serial calls to finish to avoid touching
|
|
+ * freed pd's and ps's.
|
|
+ */
|
|
+ synchronize_rcu();
|
|
+
|
|
mutex_lock(&ps->pinst->lock);
|
|
list_del(&ps->list);
|
|
pd = rcu_dereference_protected(ps->pd, 1);
|
|
- if (refcount_dec_and_test(&pd->refcnt))
|
|
- padata_free_pd(pd);
|
|
+ padata_put_pd(pd);
|
|
mutex_unlock(&ps->pinst->lock);
|
|
|
|
kfree(ps);
|
|
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
|
|
index 8d35b9f9aaa3f2..c2fc58938dee5d 100644
|
|
--- a/kernel/power/hibernate.c
|
|
+++ b/kernel/power/hibernate.c
|
|
@@ -599,7 +599,11 @@ int hibernation_platform_enter(void)
|
|
|
|
local_irq_disable();
|
|
system_state = SYSTEM_SUSPEND;
|
|
- syscore_suspend();
|
|
+
|
|
+ error = syscore_suspend();
|
|
+ if (error)
|
|
+ goto Enable_irqs;
|
|
+
|
|
if (pm_wakeup_pending()) {
|
|
error = -EAGAIN;
|
|
goto Power_up;
|
|
@@ -611,6 +615,7 @@ int hibernation_platform_enter(void)
|
|
|
|
Power_up:
|
|
syscore_resume();
|
|
+ Enable_irqs:
|
|
system_state = SYSTEM_RUNNING;
|
|
local_irq_enable();
|
|
|
|
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
|
|
index 458d359f5991ca..a49f136014ce6b 100644
|
|
--- a/kernel/sched/cpufreq_schedutil.c
|
|
+++ b/kernel/sched/cpufreq_schedutil.c
|
|
@@ -83,7 +83,7 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
|
|
|
|
if (unlikely(sg_policy->limits_changed)) {
|
|
sg_policy->limits_changed = false;
|
|
- sg_policy->need_freq_update = true;
|
|
+ sg_policy->need_freq_update = cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS);
|
|
return true;
|
|
}
|
|
|
|
@@ -96,7 +96,7 @@ static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time,
|
|
unsigned int next_freq)
|
|
{
|
|
if (sg_policy->need_freq_update)
|
|
- sg_policy->need_freq_update = cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS);
|
|
+ sg_policy->need_freq_update = false;
|
|
else if (sg_policy->next_freq == next_freq)
|
|
return false;
|
|
|
|
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
|
|
index 3b2cfdb8d788d9..726fa69c4d88b2 100644
|
|
--- a/kernel/sched/fair.c
|
|
+++ b/kernel/sched/fair.c
|
|
@@ -8921,6 +8921,8 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
|
|
int tsk_cache_hot;
|
|
|
|
lockdep_assert_rq_held(env->src_rq);
|
|
+ if (p->sched_task_hot)
|
|
+ p->sched_task_hot = 0;
|
|
|
|
/*
|
|
* We do not migrate tasks that are:
|
|
@@ -8993,10 +8995,8 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
|
|
|
|
if (tsk_cache_hot <= 0 ||
|
|
env->sd->nr_balance_failed > env->sd->cache_nice_tries) {
|
|
- if (tsk_cache_hot == 1) {
|
|
- schedstat_inc(env->sd->lb_hot_gained[env->idle]);
|
|
- schedstat_inc(p->stats.nr_forced_migrations);
|
|
- }
|
|
+ if (tsk_cache_hot == 1)
|
|
+ p->sched_task_hot = 1;
|
|
return 1;
|
|
}
|
|
|
|
@@ -9011,6 +9011,12 @@ static void detach_task(struct task_struct *p, struct lb_env *env)
|
|
{
|
|
lockdep_assert_rq_held(env->src_rq);
|
|
|
|
+ if (p->sched_task_hot) {
|
|
+ p->sched_task_hot = 0;
|
|
+ schedstat_inc(env->sd->lb_hot_gained[env->idle]);
|
|
+ schedstat_inc(p->stats.nr_forced_migrations);
|
|
+ }
|
|
+
|
|
deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK);
|
|
set_task_cpu(p, env->dst_cpu);
|
|
}
|
|
@@ -9171,6 +9177,9 @@ static int detach_tasks(struct lb_env *env)
|
|
|
|
continue;
|
|
next:
|
|
+ if (p->sched_task_hot)
|
|
+ schedstat_inc(p->stats.nr_failed_migrations_hot);
|
|
+
|
|
list_move(&p->se.group_node, tasks);
|
|
}
|
|
|
|
@@ -9773,7 +9782,7 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu)
|
|
* can only do it if @group is an SMT group and has exactly on busy CPU. Larger
|
|
* imbalances in the number of CPUS are dealt with in find_busiest_group().
|
|
*
|
|
- * If we are balancing load within an SMT core, or at DIE domain level, always
|
|
+ * If we are balancing load within an SMT core, or at PKG domain level, always
|
|
* proceed.
|
|
*
|
|
* Return: true if @env::dst_cpu can do with asym_packing load balance. False
|
|
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
|
|
index 3a13cecf177402..2ed884bb362137 100644
|
|
--- a/kernel/sched/topology.c
|
|
+++ b/kernel/sched/topology.c
|
|
@@ -1117,7 +1117,7 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)
|
|
*
|
|
* - Simultaneous multithreading (SMT)
|
|
* - Multi-Core Cache (MC)
|
|
- * - Package (DIE)
|
|
+ * - Package (PKG)
|
|
*
|
|
* Where the last one more or less denotes everything up to a NUMA node.
|
|
*
|
|
@@ -1139,13 +1139,13 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)
|
|
*
|
|
* CPU 0 1 2 3 4 5 6 7
|
|
*
|
|
- * DIE [ ]
|
|
+ * PKG [ ]
|
|
* MC [ ] [ ]
|
|
* SMT [ ] [ ] [ ] [ ]
|
|
*
|
|
* - or -
|
|
*
|
|
- * DIE 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7
|
|
+ * PKG 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7
|
|
* MC 0-3 0-3 0-3 0-3 4-7 4-7 4-7 4-7
|
|
* SMT 0-1 0-1 2-3 2-3 4-5 4-5 6-7 6-7
|
|
*
|
|
@@ -1679,7 +1679,7 @@ static struct sched_domain_topology_level default_topology[] = {
|
|
#ifdef CONFIG_SCHED_MC
|
|
{ cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) },
|
|
#endif
|
|
- { cpu_cpu_mask, SD_INIT_NAME(DIE) },
|
|
+ { cpu_cpu_mask, SD_INIT_NAME(PKG) },
|
|
{ NULL, },
|
|
};
|
|
|
|
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
|
|
index aab43ba3daeb51..9d8f60e0cb5546 100644
|
|
--- a/kernel/trace/bpf_trace.c
|
|
+++ b/kernel/trace/bpf_trace.c
|
|
@@ -616,7 +616,8 @@ static const struct bpf_func_proto bpf_perf_event_read_value_proto = {
|
|
|
|
static __always_inline u64
|
|
__bpf_perf_event_output(struct pt_regs *regs, struct bpf_map *map,
|
|
- u64 flags, struct perf_sample_data *sd)
|
|
+ u64 flags, struct perf_raw_record *raw,
|
|
+ struct perf_sample_data *sd)
|
|
{
|
|
struct bpf_array *array = container_of(map, struct bpf_array, map);
|
|
unsigned int cpu = smp_processor_id();
|
|
@@ -641,6 +642,8 @@ __bpf_perf_event_output(struct pt_regs *regs, struct bpf_map *map,
|
|
if (unlikely(event->oncpu != cpu))
|
|
return -EOPNOTSUPP;
|
|
|
|
+ perf_sample_save_raw_data(sd, event, raw);
|
|
+
|
|
return perf_event_output(event, sd, regs);
|
|
}
|
|
|
|
@@ -684,9 +687,8 @@ BPF_CALL_5(bpf_perf_event_output, struct pt_regs *, regs, struct bpf_map *, map,
|
|
}
|
|
|
|
perf_sample_data_init(sd, 0, 0);
|
|
- perf_sample_save_raw_data(sd, &raw);
|
|
|
|
- err = __bpf_perf_event_output(regs, map, flags, sd);
|
|
+ err = __bpf_perf_event_output(regs, map, flags, &raw, sd);
|
|
out:
|
|
this_cpu_dec(bpf_trace_nest_level);
|
|
preempt_enable();
|
|
@@ -745,9 +747,8 @@ u64 bpf_event_output(struct bpf_map *map, u64 flags, void *meta, u64 meta_size,
|
|
|
|
perf_fetch_caller_regs(regs);
|
|
perf_sample_data_init(sd, 0, 0);
|
|
- perf_sample_save_raw_data(sd, &raw);
|
|
|
|
- ret = __bpf_perf_event_output(regs, map, flags, sd);
|
|
+ ret = __bpf_perf_event_output(regs, map, flags, &raw, sd);
|
|
out:
|
|
this_cpu_dec(bpf_event_output_nest_level);
|
|
preempt_enable();
|
|
@@ -852,7 +853,7 @@ static int bpf_send_signal_common(u32 sig, enum pid_type type)
|
|
if (unlikely(is_global_init(current)))
|
|
return -EPERM;
|
|
|
|
- if (irqs_disabled()) {
|
|
+ if (!preemptible()) {
|
|
/* Do an early check on signal validity. Otherwise,
|
|
* the error is lost in deferred irq_work.
|
|
*/
|
|
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
|
|
index 26a3095bec4620..0f66dd8715bd87 100644
|
|
--- a/net/ax25/af_ax25.c
|
|
+++ b/net/ax25/af_ax25.c
|
|
@@ -467,7 +467,7 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
|
|
goto out_put;
|
|
}
|
|
|
|
-static void ax25_fillin_cb_from_dev(ax25_cb *ax25, ax25_dev *ax25_dev)
|
|
+static void ax25_fillin_cb_from_dev(ax25_cb *ax25, const ax25_dev *ax25_dev)
|
|
{
|
|
ax25->rtt = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]) / 2;
|
|
ax25->t1 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]);
|
|
@@ -677,22 +677,22 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
|
|
break;
|
|
}
|
|
|
|
- rtnl_lock();
|
|
- dev = __dev_get_by_name(&init_net, devname);
|
|
+ rcu_read_lock();
|
|
+ dev = dev_get_by_name_rcu(&init_net, devname);
|
|
if (!dev) {
|
|
- rtnl_unlock();
|
|
+ rcu_read_unlock();
|
|
res = -ENODEV;
|
|
break;
|
|
}
|
|
|
|
ax25->ax25_dev = ax25_dev_ax25dev(dev);
|
|
if (!ax25->ax25_dev) {
|
|
- rtnl_unlock();
|
|
+ rcu_read_unlock();
|
|
res = -ENODEV;
|
|
break;
|
|
}
|
|
ax25_fillin_cb(ax25, ax25->ax25_dev);
|
|
- rtnl_unlock();
|
|
+ rcu_read_unlock();
|
|
break;
|
|
|
|
default:
|
|
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
|
|
index 67ae6b8c52989b..0715f9b1527569 100644
|
|
--- a/net/ax25/ax25_dev.c
|
|
+++ b/net/ax25/ax25_dev.c
|
|
@@ -87,7 +87,7 @@ void ax25_dev_device_up(struct net_device *dev)
|
|
|
|
spin_lock_bh(&ax25_dev_lock);
|
|
list_add(&ax25_dev->list, &ax25_dev_list);
|
|
- dev->ax25_ptr = ax25_dev;
|
|
+ rcu_assign_pointer(dev->ax25_ptr, ax25_dev);
|
|
spin_unlock_bh(&ax25_dev_lock);
|
|
|
|
ax25_register_dev_sysctl(ax25_dev);
|
|
@@ -122,7 +122,7 @@ void ax25_dev_device_down(struct net_device *dev)
|
|
}
|
|
}
|
|
|
|
- dev->ax25_ptr = NULL;
|
|
+ RCU_INIT_POINTER(dev->ax25_ptr, NULL);
|
|
spin_unlock_bh(&ax25_dev_lock);
|
|
netdev_put(dev, &ax25_dev->dev_tracker);
|
|
ax25_dev_put(ax25_dev);
|
|
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c
|
|
index 36249776c021e7..215d4ccf12b913 100644
|
|
--- a/net/ax25/ax25_ip.c
|
|
+++ b/net/ax25/ax25_ip.c
|
|
@@ -122,6 +122,7 @@ netdev_tx_t ax25_ip_xmit(struct sk_buff *skb)
|
|
if (dev == NULL)
|
|
dev = skb->dev;
|
|
|
|
+ rcu_read_lock();
|
|
if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) {
|
|
kfree_skb(skb);
|
|
goto put;
|
|
@@ -202,7 +203,7 @@ netdev_tx_t ax25_ip_xmit(struct sk_buff *skb)
|
|
ax25_queue_xmit(skb, dev);
|
|
|
|
put:
|
|
-
|
|
+ rcu_read_unlock();
|
|
ax25_route_lock_unuse();
|
|
return NETDEV_TX_OK;
|
|
}
|
|
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
|
|
index 3db76d2470e954..8bca2ace98e51b 100644
|
|
--- a/net/ax25/ax25_out.c
|
|
+++ b/net/ax25/ax25_out.c
|
|
@@ -39,10 +39,14 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, const ax25_address *sr
|
|
* specified.
|
|
*/
|
|
if (paclen == 0) {
|
|
- if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL)
|
|
+ rcu_read_lock();
|
|
+ ax25_dev = ax25_dev_ax25dev(dev);
|
|
+ if (!ax25_dev) {
|
|
+ rcu_read_unlock();
|
|
return NULL;
|
|
-
|
|
+ }
|
|
paclen = ax25_dev->values[AX25_VALUES_PACLEN];
|
|
+ rcu_read_unlock();
|
|
}
|
|
|
|
/*
|
|
@@ -53,13 +57,19 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, const ax25_address *sr
|
|
return ax25; /* It already existed */
|
|
}
|
|
|
|
- if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL)
|
|
+ rcu_read_lock();
|
|
+ ax25_dev = ax25_dev_ax25dev(dev);
|
|
+ if (!ax25_dev) {
|
|
+ rcu_read_unlock();
|
|
return NULL;
|
|
+ }
|
|
|
|
- if ((ax25 = ax25_create_cb()) == NULL)
|
|
+ if ((ax25 = ax25_create_cb()) == NULL) {
|
|
+ rcu_read_unlock();
|
|
return NULL;
|
|
-
|
|
+ }
|
|
ax25_fillin_cb(ax25, ax25_dev);
|
|
+ rcu_read_unlock();
|
|
|
|
ax25->source_addr = *src;
|
|
ax25->dest_addr = *dest;
|
|
@@ -358,7 +368,9 @@ void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev)
|
|
{
|
|
unsigned char *ptr;
|
|
|
|
+ rcu_read_lock();
|
|
skb->protocol = ax25_type_trans(skb, ax25_fwd_dev(dev));
|
|
+ rcu_read_unlock();
|
|
|
|
ptr = skb_push(skb, 1);
|
|
*ptr = 0x00; /* KISS */
|
|
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
|
|
index b7c4d656a94b71..69de75db0c9c21 100644
|
|
--- a/net/ax25/ax25_route.c
|
|
+++ b/net/ax25/ax25_route.c
|
|
@@ -406,6 +406,7 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr)
|
|
ax25_route_lock_unuse();
|
|
return -EHOSTUNREACH;
|
|
}
|
|
+ rcu_read_lock();
|
|
if ((ax25->ax25_dev = ax25_dev_ax25dev(ax25_rt->dev)) == NULL) {
|
|
err = -EHOSTUNREACH;
|
|
goto put;
|
|
@@ -442,6 +443,7 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr)
|
|
}
|
|
|
|
put:
|
|
+ rcu_read_unlock();
|
|
ax25_route_lock_unuse();
|
|
return err;
|
|
}
|
|
diff --git a/net/core/dev.c b/net/core/dev.c
|
|
index 69da7b009f8b98..479a3892f98c3c 100644
|
|
--- a/net/core/dev.c
|
|
+++ b/net/core/dev.c
|
|
@@ -9346,6 +9346,10 @@ static int dev_xdp_attach(struct net_device *dev, struct netlink_ext_ack *extack
|
|
NL_SET_ERR_MSG(extack, "Program bound to different device");
|
|
return -EINVAL;
|
|
}
|
|
+ if (bpf_prog_is_dev_bound(new_prog->aux) && mode == XDP_MODE_SKB) {
|
|
+ NL_SET_ERR_MSG(extack, "Can't attach device-bound programs in generic mode");
|
|
+ return -EINVAL;
|
|
+ }
|
|
if (new_prog->expected_attach_type == BPF_XDP_DEVMAP) {
|
|
NL_SET_ERR_MSG(extack, "BPF_XDP_DEVMAP programs can not be attached to a device");
|
|
return -EINVAL;
|
|
diff --git a/net/core/filter.c b/net/core/filter.c
|
|
index 5881944f1681c9..84992279f4b10e 100644
|
|
--- a/net/core/filter.c
|
|
+++ b/net/core/filter.c
|
|
@@ -7604,7 +7604,7 @@ static const struct bpf_func_proto bpf_sock_ops_load_hdr_opt_proto = {
|
|
.gpl_only = false,
|
|
.ret_type = RET_INTEGER,
|
|
.arg1_type = ARG_PTR_TO_CTX,
|
|
- .arg2_type = ARG_PTR_TO_MEM,
|
|
+ .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE,
|
|
.arg3_type = ARG_CONST_SIZE,
|
|
.arg4_type = ARG_ANYTHING,
|
|
};
|
|
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
|
|
index 373b5b2231c492..0b15272dd2d35b 100644
|
|
--- a/net/core/sysctl_net_core.c
|
|
+++ b/net/core/sysctl_net_core.c
|
|
@@ -297,7 +297,7 @@ static int proc_do_dev_weight(struct ctl_table *table, int write,
|
|
int ret, weight;
|
|
|
|
mutex_lock(&dev_weight_mutex);
|
|
- ret = proc_dointvec(table, write, buffer, lenp, ppos);
|
|
+ ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
|
|
if (!ret && write) {
|
|
weight = READ_ONCE(weight_p);
|
|
WRITE_ONCE(dev_rx_weight, weight * dev_weight_rx_bias);
|
|
@@ -422,6 +422,7 @@ static struct ctl_table net_core_table[] = {
|
|
.maxlen = sizeof(int),
|
|
.mode = 0644,
|
|
.proc_handler = proc_do_dev_weight,
|
|
+ .extra1 = SYSCTL_ONE,
|
|
},
|
|
{
|
|
.procname = "dev_weight_rx_bias",
|
|
@@ -429,6 +430,7 @@ static struct ctl_table net_core_table[] = {
|
|
.maxlen = sizeof(int),
|
|
.mode = 0644,
|
|
.proc_handler = proc_do_dev_weight,
|
|
+ .extra1 = SYSCTL_ONE,
|
|
},
|
|
{
|
|
.procname = "dev_weight_tx_bias",
|
|
@@ -436,6 +438,7 @@ static struct ctl_table net_core_table[] = {
|
|
.maxlen = sizeof(int),
|
|
.mode = 0644,
|
|
.proc_handler = proc_do_dev_weight,
|
|
+ .extra1 = SYSCTL_ONE,
|
|
},
|
|
{
|
|
.procname = "netdev_max_backlog",
|
|
diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
|
|
index fe3553f60bf39e..c1ad63bee8eade 100644
|
|
--- a/net/ethtool/netlink.c
|
|
+++ b/net/ethtool/netlink.c
|
|
@@ -41,7 +41,7 @@ int ethnl_ops_begin(struct net_device *dev)
|
|
pm_runtime_get_sync(dev->dev.parent);
|
|
|
|
if (!netif_device_present(dev) ||
|
|
- dev->reg_state == NETREG_UNREGISTERING) {
|
|
+ dev->reg_state >= NETREG_UNREGISTERING) {
|
|
ret = -ENODEV;
|
|
goto err;
|
|
}
|
|
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
|
|
index 2790f3964d6bd4..9317f96127c1b1 100644
|
|
--- a/net/hsr/hsr_forward.c
|
|
+++ b/net/hsr/hsr_forward.c
|
|
@@ -588,9 +588,12 @@ static int fill_frame_info(struct hsr_frame_info *frame,
|
|
frame->is_vlan = true;
|
|
|
|
if (frame->is_vlan) {
|
|
- if (skb->mac_len < offsetofend(struct hsr_vlan_ethhdr, vlanhdr))
|
|
+ /* Note: skb->mac_len might be wrong here. */
|
|
+ if (!pskb_may_pull(skb,
|
|
+ skb_mac_offset(skb) +
|
|
+ offsetofend(struct hsr_vlan_ethhdr, vlanhdr)))
|
|
return -EINVAL;
|
|
- vlan_hdr = (struct hsr_vlan_ethhdr *)ethhdr;
|
|
+ vlan_hdr = (struct hsr_vlan_ethhdr *)skb_mac_header(skb);
|
|
proto = vlan_hdr->vlanhdr.h_vlan_encapsulated_proto;
|
|
/* FIXME: */
|
|
netdev_warn_once(skb->dev, "VLAN not yet supported");
|
|
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
|
|
index 9dffdd876fef50..a6adf6a2ec4b57 100644
|
|
--- a/net/ipv4/icmp.c
|
|
+++ b/net/ipv4/icmp.c
|
|
@@ -316,7 +316,6 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,
|
|
struct dst_entry *dst = &rt->dst;
|
|
struct inet_peer *peer;
|
|
bool rc = true;
|
|
- int vif;
|
|
|
|
if (!apply_ratelimit)
|
|
return true;
|
|
@@ -325,12 +324,12 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,
|
|
if (dst->dev && (dst->dev->flags&IFF_LOOPBACK))
|
|
goto out;
|
|
|
|
- vif = l3mdev_master_ifindex(dst->dev);
|
|
- peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, vif, 1);
|
|
+ rcu_read_lock();
|
|
+ peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr,
|
|
+ l3mdev_master_ifindex_rcu(dst->dev));
|
|
rc = inet_peer_xrlim_allow(peer,
|
|
READ_ONCE(net->ipv4.sysctl_icmp_ratelimit));
|
|
- if (peer)
|
|
- inet_putpeer(peer);
|
|
+ rcu_read_unlock();
|
|
out:
|
|
if (!rc)
|
|
__ICMP_INC_STATS(net, ICMP_MIB_RATELIMITHOST);
|
|
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
|
|
index e9fed83e9b3cc5..23896b6b8417df 100644
|
|
--- a/net/ipv4/inetpeer.c
|
|
+++ b/net/ipv4/inetpeer.c
|
|
@@ -98,6 +98,7 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr,
|
|
{
|
|
struct rb_node **pp, *parent, *next;
|
|
struct inet_peer *p;
|
|
+ u32 now;
|
|
|
|
pp = &base->rb_root.rb_node;
|
|
parent = NULL;
|
|
@@ -111,8 +112,9 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr,
|
|
p = rb_entry(parent, struct inet_peer, rb_node);
|
|
cmp = inetpeer_addr_cmp(daddr, &p->daddr);
|
|
if (cmp == 0) {
|
|
- if (!refcount_inc_not_zero(&p->refcnt))
|
|
- break;
|
|
+ now = jiffies;
|
|
+ if (READ_ONCE(p->dtime) != now)
|
|
+ WRITE_ONCE(p->dtime, now);
|
|
return p;
|
|
}
|
|
if (gc_stack) {
|
|
@@ -158,9 +160,6 @@ static void inet_peer_gc(struct inet_peer_base *base,
|
|
for (i = 0; i < gc_cnt; i++) {
|
|
p = gc_stack[i];
|
|
|
|
- /* The READ_ONCE() pairs with the WRITE_ONCE()
|
|
- * in inet_putpeer()
|
|
- */
|
|
delta = (__u32)jiffies - READ_ONCE(p->dtime);
|
|
|
|
if (delta < ttl || !refcount_dec_if_one(&p->refcnt))
|
|
@@ -176,31 +175,23 @@ static void inet_peer_gc(struct inet_peer_base *base,
|
|
}
|
|
}
|
|
|
|
+/* Must be called under RCU : No refcount change is done here. */
|
|
struct inet_peer *inet_getpeer(struct inet_peer_base *base,
|
|
- const struct inetpeer_addr *daddr,
|
|
- int create)
|
|
+ const struct inetpeer_addr *daddr)
|
|
{
|
|
struct inet_peer *p, *gc_stack[PEER_MAX_GC];
|
|
struct rb_node **pp, *parent;
|
|
unsigned int gc_cnt, seq;
|
|
- int invalidated;
|
|
|
|
/* Attempt a lockless lookup first.
|
|
* Because of a concurrent writer, we might not find an existing entry.
|
|
*/
|
|
- rcu_read_lock();
|
|
seq = read_seqbegin(&base->lock);
|
|
p = lookup(daddr, base, seq, NULL, &gc_cnt, &parent, &pp);
|
|
- invalidated = read_seqretry(&base->lock, seq);
|
|
- rcu_read_unlock();
|
|
|
|
if (p)
|
|
return p;
|
|
|
|
- /* If no writer did a change during our lookup, we can return early. */
|
|
- if (!create && !invalidated)
|
|
- return NULL;
|
|
-
|
|
/* retry an exact lookup, taking the lock before.
|
|
* At least, nodes should be hot in our cache.
|
|
*/
|
|
@@ -209,12 +200,12 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,
|
|
|
|
gc_cnt = 0;
|
|
p = lookup(daddr, base, seq, gc_stack, &gc_cnt, &parent, &pp);
|
|
- if (!p && create) {
|
|
+ if (!p) {
|
|
p = kmem_cache_alloc(peer_cachep, GFP_ATOMIC);
|
|
if (p) {
|
|
p->daddr = *daddr;
|
|
p->dtime = (__u32)jiffies;
|
|
- refcount_set(&p->refcnt, 2);
|
|
+ refcount_set(&p->refcnt, 1);
|
|
atomic_set(&p->rid, 0);
|
|
p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW;
|
|
p->rate_tokens = 0;
|
|
@@ -239,15 +230,9 @@ EXPORT_SYMBOL_GPL(inet_getpeer);
|
|
|
|
void inet_putpeer(struct inet_peer *p)
|
|
{
|
|
- /* The WRITE_ONCE() pairs with itself (we run lockless)
|
|
- * and the READ_ONCE() in inet_peer_gc()
|
|
- */
|
|
- WRITE_ONCE(p->dtime, (__u32)jiffies);
|
|
-
|
|
if (refcount_dec_and_test(&p->refcnt))
|
|
call_rcu(&p->rcu, inetpeer_free_rcu);
|
|
}
|
|
-EXPORT_SYMBOL_GPL(inet_putpeer);
|
|
|
|
/*
|
|
* Check transmit rate limitation for given message.
|
|
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
|
|
index fb947d1613fe2b..877d1e03150c77 100644
|
|
--- a/net/ipv4/ip_fragment.c
|
|
+++ b/net/ipv4/ip_fragment.c
|
|
@@ -82,15 +82,20 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *skb,
|
|
static void ip4_frag_init(struct inet_frag_queue *q, const void *a)
|
|
{
|
|
struct ipq *qp = container_of(q, struct ipq, q);
|
|
- struct net *net = q->fqdir->net;
|
|
-
|
|
const struct frag_v4_compare_key *key = a;
|
|
+ struct net *net = q->fqdir->net;
|
|
+ struct inet_peer *p = NULL;
|
|
|
|
q->key.v4 = *key;
|
|
qp->ecn = 0;
|
|
- qp->peer = q->fqdir->max_dist ?
|
|
- inet_getpeer_v4(net->ipv4.peers, key->saddr, key->vif, 1) :
|
|
- NULL;
|
|
+ if (q->fqdir->max_dist) {
|
|
+ rcu_read_lock();
|
|
+ p = inet_getpeer_v4(net->ipv4.peers, key->saddr, key->vif);
|
|
+ if (p && !refcount_inc_not_zero(&p->refcnt))
|
|
+ p = NULL;
|
|
+ rcu_read_unlock();
|
|
+ }
|
|
+ qp->peer = p;
|
|
}
|
|
|
|
static void ip4_frag_free(struct inet_frag_queue *q)
|
|
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
|
|
index dc0ad979a894ab..af9412a507cf34 100644
|
|
--- a/net/ipv4/ipmr.c
|
|
+++ b/net/ipv4/ipmr.c
|
|
@@ -816,7 +816,7 @@ static void ipmr_update_thresholds(struct mr_table *mrt, struct mr_mfc *cache,
|
|
cache->mfc_un.res.maxvif = vifi + 1;
|
|
}
|
|
}
|
|
- cache->mfc_un.res.lastuse = jiffies;
|
|
+ WRITE_ONCE(cache->mfc_un.res.lastuse, jiffies);
|
|
}
|
|
|
|
static int vif_add(struct net *net, struct mr_table *mrt,
|
|
@@ -1666,9 +1666,9 @@ int ipmr_ioctl(struct sock *sk, int cmd, void *arg)
|
|
rcu_read_lock();
|
|
c = ipmr_cache_find(mrt, sr->src.s_addr, sr->grp.s_addr);
|
|
if (c) {
|
|
- sr->pktcnt = c->_c.mfc_un.res.pkt;
|
|
- sr->bytecnt = c->_c.mfc_un.res.bytes;
|
|
- sr->wrong_if = c->_c.mfc_un.res.wrong_if;
|
|
+ sr->pktcnt = atomic_long_read(&c->_c.mfc_un.res.pkt);
|
|
+ sr->bytecnt = atomic_long_read(&c->_c.mfc_un.res.bytes);
|
|
+ sr->wrong_if = atomic_long_read(&c->_c.mfc_un.res.wrong_if);
|
|
rcu_read_unlock();
|
|
return 0;
|
|
}
|
|
@@ -1738,9 +1738,9 @@ int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
|
|
rcu_read_lock();
|
|
c = ipmr_cache_find(mrt, sr.src.s_addr, sr.grp.s_addr);
|
|
if (c) {
|
|
- sr.pktcnt = c->_c.mfc_un.res.pkt;
|
|
- sr.bytecnt = c->_c.mfc_un.res.bytes;
|
|
- sr.wrong_if = c->_c.mfc_un.res.wrong_if;
|
|
+ sr.pktcnt = atomic_long_read(&c->_c.mfc_un.res.pkt);
|
|
+ sr.bytecnt = atomic_long_read(&c->_c.mfc_un.res.bytes);
|
|
+ sr.wrong_if = atomic_long_read(&c->_c.mfc_un.res.wrong_if);
|
|
rcu_read_unlock();
|
|
|
|
if (copy_to_user(arg, &sr, sizeof(sr)))
|
|
@@ -1973,9 +1973,9 @@ static void ip_mr_forward(struct net *net, struct mr_table *mrt,
|
|
int vif, ct;
|
|
|
|
vif = c->_c.mfc_parent;
|
|
- c->_c.mfc_un.res.pkt++;
|
|
- c->_c.mfc_un.res.bytes += skb->len;
|
|
- c->_c.mfc_un.res.lastuse = jiffies;
|
|
+ atomic_long_inc(&c->_c.mfc_un.res.pkt);
|
|
+ atomic_long_add(skb->len, &c->_c.mfc_un.res.bytes);
|
|
+ WRITE_ONCE(c->_c.mfc_un.res.lastuse, jiffies);
|
|
|
|
if (c->mfc_origin == htonl(INADDR_ANY) && true_vifi >= 0) {
|
|
struct mfc_cache *cache_proxy;
|
|
@@ -2006,7 +2006,7 @@ static void ip_mr_forward(struct net *net, struct mr_table *mrt,
|
|
goto dont_forward;
|
|
}
|
|
|
|
- c->_c.mfc_un.res.wrong_if++;
|
|
+ atomic_long_inc(&c->_c.mfc_un.res.wrong_if);
|
|
|
|
if (true_vifi >= 0 && mrt->mroute_do_assert &&
|
|
/* pimsm uses asserts, when switching from RPT to SPT,
|
|
@@ -3013,9 +3013,9 @@ static int ipmr_mfc_seq_show(struct seq_file *seq, void *v)
|
|
|
|
if (it->cache != &mrt->mfc_unres_queue) {
|
|
seq_printf(seq, " %8lu %8lu %8lu",
|
|
- mfc->_c.mfc_un.res.pkt,
|
|
- mfc->_c.mfc_un.res.bytes,
|
|
- mfc->_c.mfc_un.res.wrong_if);
|
|
+ atomic_long_read(&mfc->_c.mfc_un.res.pkt),
|
|
+ atomic_long_read(&mfc->_c.mfc_un.res.bytes),
|
|
+ atomic_long_read(&mfc->_c.mfc_un.res.wrong_if));
|
|
for (n = mfc->_c.mfc_un.res.minvif;
|
|
n < mfc->_c.mfc_un.res.maxvif; n++) {
|
|
if (VIF_EXISTS(mrt, n) &&
|
|
diff --git a/net/ipv4/ipmr_base.c b/net/ipv4/ipmr_base.c
|
|
index f0af12a2f70bcd..28d77d454d442e 100644
|
|
--- a/net/ipv4/ipmr_base.c
|
|
+++ b/net/ipv4/ipmr_base.c
|
|
@@ -263,9 +263,9 @@ int mr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
|
|
lastuse = READ_ONCE(c->mfc_un.res.lastuse);
|
|
lastuse = time_after_eq(jiffies, lastuse) ? jiffies - lastuse : 0;
|
|
|
|
- mfcs.mfcs_packets = c->mfc_un.res.pkt;
|
|
- mfcs.mfcs_bytes = c->mfc_un.res.bytes;
|
|
- mfcs.mfcs_wrong_if = c->mfc_un.res.wrong_if;
|
|
+ mfcs.mfcs_packets = atomic_long_read(&c->mfc_un.res.pkt);
|
|
+ mfcs.mfcs_bytes = atomic_long_read(&c->mfc_un.res.bytes);
|
|
+ mfcs.mfcs_wrong_if = atomic_long_read(&c->mfc_un.res.wrong_if);
|
|
if (nla_put_64bit(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs, RTA_PAD) ||
|
|
nla_put_u64_64bit(skb, RTA_EXPIRES, jiffies_to_clock_t(lastuse),
|
|
RTA_PAD))
|
|
@@ -330,9 +330,6 @@ int mr_table_dump(struct mr_table *mrt, struct sk_buff *skb,
|
|
list_for_each_entry(mfc, &mrt->mfc_unres_queue, list) {
|
|
if (e < s_e)
|
|
goto next_entry2;
|
|
- if (filter->dev &&
|
|
- !mr_mfc_uses_dev(mrt, mfc, filter->dev))
|
|
- goto next_entry2;
|
|
|
|
err = fill(mrt, skb, NETLINK_CB(cb->skb).portid,
|
|
cb->nlh->nlmsg_seq, mfc, RTM_NEWROUTE, flags);
|
|
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
|
|
index 285482060082f8..61fc2166a870e6 100644
|
|
--- a/net/ipv4/route.c
|
|
+++ b/net/ipv4/route.c
|
|
@@ -882,11 +882,11 @@ void ip_rt_send_redirect(struct sk_buff *skb)
|
|
}
|
|
log_martians = IN_DEV_LOG_MARTIANS(in_dev);
|
|
vif = l3mdev_master_ifindex_rcu(rt->dst.dev);
|
|
- rcu_read_unlock();
|
|
|
|
net = dev_net(rt->dst.dev);
|
|
- peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->saddr, vif, 1);
|
|
+ peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->saddr, vif);
|
|
if (!peer) {
|
|
+ rcu_read_unlock();
|
|
icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST,
|
|
rt_nexthop(rt, ip_hdr(skb)->daddr));
|
|
return;
|
|
@@ -905,7 +905,7 @@ void ip_rt_send_redirect(struct sk_buff *skb)
|
|
*/
|
|
if (peer->n_redirects >= ip_rt_redirect_number) {
|
|
peer->rate_last = jiffies;
|
|
- goto out_put_peer;
|
|
+ goto out_unlock;
|
|
}
|
|
|
|
/* Check for load limit; set rate_last to the latest sent
|
|
@@ -926,8 +926,8 @@ void ip_rt_send_redirect(struct sk_buff *skb)
|
|
&ip_hdr(skb)->saddr, inet_iif(skb),
|
|
&ip_hdr(skb)->daddr, &gw);
|
|
}
|
|
-out_put_peer:
|
|
- inet_putpeer(peer);
|
|
+out_unlock:
|
|
+ rcu_read_unlock();
|
|
}
|
|
|
|
static int ip_error(struct sk_buff *skb)
|
|
@@ -987,9 +987,9 @@ static int ip_error(struct sk_buff *skb)
|
|
break;
|
|
}
|
|
|
|
+ rcu_read_lock();
|
|
peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->saddr,
|
|
- l3mdev_master_ifindex(skb->dev), 1);
|
|
-
|
|
+ l3mdev_master_ifindex_rcu(skb->dev));
|
|
send = true;
|
|
if (peer) {
|
|
now = jiffies;
|
|
@@ -1001,8 +1001,9 @@ static int ip_error(struct sk_buff *skb)
|
|
peer->rate_tokens -= ip_rt_error_cost;
|
|
else
|
|
send = false;
|
|
- inet_putpeer(peer);
|
|
}
|
|
+ rcu_read_unlock();
|
|
+
|
|
if (send)
|
|
icmp_send(skb, ICMP_DEST_UNREACH, code, 0);
|
|
|
|
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
|
|
index 0fd78ecb67e756..5ff7be13deb6b7 100644
|
|
--- a/net/ipv4/tcp_cubic.c
|
|
+++ b/net/ipv4/tcp_cubic.c
|
|
@@ -392,6 +392,10 @@ static void hystart_update(struct sock *sk, u32 delay)
|
|
if (after(tp->snd_una, ca->end_seq))
|
|
bictcp_hystart_reset(sk);
|
|
|
|
+ /* hystart triggers when cwnd is larger than some threshold */
|
|
+ if (tcp_snd_cwnd(tp) < hystart_low_window)
|
|
+ return;
|
|
+
|
|
if (hystart_detect & HYSTART_ACK_TRAIN) {
|
|
u32 now = bictcp_clock_us(sk);
|
|
|
|
@@ -467,9 +471,7 @@ __bpf_kfunc static void cubictcp_acked(struct sock *sk, const struct ack_sample
|
|
if (ca->delay_min == 0 || ca->delay_min > delay)
|
|
ca->delay_min = delay;
|
|
|
|
- /* hystart triggers when cwnd is larger than some threshold */
|
|
- if (!ca->found && tcp_in_slow_start(tp) && hystart &&
|
|
- tcp_snd_cwnd(tp) >= hystart_low_window)
|
|
+ if (!ca->found && tcp_in_slow_start(tp) && hystart)
|
|
hystart_update(sk, delay);
|
|
}
|
|
|
|
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
|
|
index cfddc94508f0b7..3771ed22c2f56f 100644
|
|
--- a/net/ipv4/tcp_output.c
|
|
+++ b/net/ipv4/tcp_output.c
|
|
@@ -263,11 +263,14 @@ static u16 tcp_select_window(struct sock *sk)
|
|
u32 cur_win, new_win;
|
|
|
|
/* Make the window 0 if we failed to queue the data because we
|
|
- * are out of memory. The window is temporary, so we don't store
|
|
- * it on the socket.
|
|
+ * are out of memory.
|
|
*/
|
|
- if (unlikely(inet_csk(sk)->icsk_ack.pending & ICSK_ACK_NOMEM))
|
|
+ if (unlikely(inet_csk(sk)->icsk_ack.pending & ICSK_ACK_NOMEM)) {
|
|
+ tp->pred_flags = 0;
|
|
+ tp->rcv_wnd = 0;
|
|
+ tp->rcv_wup = tp->rcv_nxt;
|
|
return 0;
|
|
+ }
|
|
|
|
cur_win = tcp_receive_window(tp);
|
|
new_win = __tcp_select_window(sk);
|
|
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
|
|
index 25a3a726fa1177..35df405ce1f753 100644
|
|
--- a/net/ipv6/icmp.c
|
|
+++ b/net/ipv6/icmp.c
|
|
@@ -222,10 +222,10 @@ static bool icmpv6_xrlim_allow(struct sock *sk, u8 type,
|
|
if (rt->rt6i_dst.plen < 128)
|
|
tmo >>= ((128 - rt->rt6i_dst.plen)>>5);
|
|
|
|
- peer = inet_getpeer_v6(net->ipv6.peers, &fl6->daddr, 1);
|
|
+ rcu_read_lock();
|
|
+ peer = inet_getpeer_v6(net->ipv6.peers, &fl6->daddr);
|
|
res = inet_peer_xrlim_allow(peer, tmo);
|
|
- if (peer)
|
|
- inet_putpeer(peer);
|
|
+ rcu_read_unlock();
|
|
}
|
|
if (!res)
|
|
__ICMP6_INC_STATS(net, ip6_dst_idev(dst),
|
|
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
|
|
index 2341a4373bb949..cd89a2b35dfb56 100644
|
|
--- a/net/ipv6/ip6_output.c
|
|
+++ b/net/ipv6/ip6_output.c
|
|
@@ -612,15 +612,15 @@ int ip6_forward(struct sk_buff *skb)
|
|
else
|
|
target = &hdr->daddr;
|
|
|
|
- peer = inet_getpeer_v6(net->ipv6.peers, &hdr->daddr, 1);
|
|
+ rcu_read_lock();
|
|
+ peer = inet_getpeer_v6(net->ipv6.peers, &hdr->daddr);
|
|
|
|
/* Limit redirects both by destination (here)
|
|
and by source (inside ndisc_send_redirect)
|
|
*/
|
|
if (inet_peer_xrlim_allow(peer, 1*HZ))
|
|
ndisc_send_redirect(skb, target);
|
|
- if (peer)
|
|
- inet_putpeer(peer);
|
|
+ rcu_read_unlock();
|
|
} else {
|
|
int addrtype = ipv6_addr_type(&hdr->saddr);
|
|
|
|
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
|
|
index 1571e85a3531ed..7f19868d7d6c6b 100644
|
|
--- a/net/ipv6/ip6mr.c
|
|
+++ b/net/ipv6/ip6mr.c
|
|
@@ -506,9 +506,9 @@ static int ipmr_mfc_seq_show(struct seq_file *seq, void *v)
|
|
|
|
if (it->cache != &mrt->mfc_unres_queue) {
|
|
seq_printf(seq, " %8lu %8lu %8lu",
|
|
- mfc->_c.mfc_un.res.pkt,
|
|
- mfc->_c.mfc_un.res.bytes,
|
|
- mfc->_c.mfc_un.res.wrong_if);
|
|
+ atomic_long_read(&mfc->_c.mfc_un.res.pkt),
|
|
+ atomic_long_read(&mfc->_c.mfc_un.res.bytes),
|
|
+ atomic_long_read(&mfc->_c.mfc_un.res.wrong_if));
|
|
for (n = mfc->_c.mfc_un.res.minvif;
|
|
n < mfc->_c.mfc_un.res.maxvif; n++) {
|
|
if (VIF_EXISTS(mrt, n) &&
|
|
@@ -870,7 +870,7 @@ static void ip6mr_update_thresholds(struct mr_table *mrt,
|
|
cache->mfc_un.res.maxvif = vifi + 1;
|
|
}
|
|
}
|
|
- cache->mfc_un.res.lastuse = jiffies;
|
|
+ WRITE_ONCE(cache->mfc_un.res.lastuse, jiffies);
|
|
}
|
|
|
|
static int mif6_add(struct net *net, struct mr_table *mrt,
|
|
@@ -1931,9 +1931,9 @@ int ip6mr_ioctl(struct sock *sk, int cmd, void *arg)
|
|
c = ip6mr_cache_find(mrt, &sr->src.sin6_addr,
|
|
&sr->grp.sin6_addr);
|
|
if (c) {
|
|
- sr->pktcnt = c->_c.mfc_un.res.pkt;
|
|
- sr->bytecnt = c->_c.mfc_un.res.bytes;
|
|
- sr->wrong_if = c->_c.mfc_un.res.wrong_if;
|
|
+ sr->pktcnt = atomic_long_read(&c->_c.mfc_un.res.pkt);
|
|
+ sr->bytecnt = atomic_long_read(&c->_c.mfc_un.res.bytes);
|
|
+ sr->wrong_if = atomic_long_read(&c->_c.mfc_un.res.wrong_if);
|
|
rcu_read_unlock();
|
|
return 0;
|
|
}
|
|
@@ -2003,9 +2003,9 @@ int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
|
|
rcu_read_lock();
|
|
c = ip6mr_cache_find(mrt, &sr.src.sin6_addr, &sr.grp.sin6_addr);
|
|
if (c) {
|
|
- sr.pktcnt = c->_c.mfc_un.res.pkt;
|
|
- sr.bytecnt = c->_c.mfc_un.res.bytes;
|
|
- sr.wrong_if = c->_c.mfc_un.res.wrong_if;
|
|
+ sr.pktcnt = atomic_long_read(&c->_c.mfc_un.res.pkt);
|
|
+ sr.bytecnt = atomic_long_read(&c->_c.mfc_un.res.bytes);
|
|
+ sr.wrong_if = atomic_long_read(&c->_c.mfc_un.res.wrong_if);
|
|
rcu_read_unlock();
|
|
|
|
if (copy_to_user(arg, &sr, sizeof(sr)))
|
|
@@ -2128,9 +2128,9 @@ static void ip6_mr_forward(struct net *net, struct mr_table *mrt,
|
|
int true_vifi = ip6mr_find_vif(mrt, dev);
|
|
|
|
vif = c->_c.mfc_parent;
|
|
- c->_c.mfc_un.res.pkt++;
|
|
- c->_c.mfc_un.res.bytes += skb->len;
|
|
- c->_c.mfc_un.res.lastuse = jiffies;
|
|
+ atomic_long_inc(&c->_c.mfc_un.res.pkt);
|
|
+ atomic_long_add(skb->len, &c->_c.mfc_un.res.bytes);
|
|
+ WRITE_ONCE(c->_c.mfc_un.res.lastuse, jiffies);
|
|
|
|
if (ipv6_addr_any(&c->mf6c_origin) && true_vifi >= 0) {
|
|
struct mfc6_cache *cache_proxy;
|
|
@@ -2148,7 +2148,7 @@ static void ip6_mr_forward(struct net *net, struct mr_table *mrt,
|
|
* Wrong interface: drop packet and (maybe) send PIM assert.
|
|
*/
|
|
if (rcu_access_pointer(mrt->vif_table[vif].dev) != dev) {
|
|
- c->_c.mfc_un.res.wrong_if++;
|
|
+ atomic_long_inc(&c->_c.mfc_un.res.wrong_if);
|
|
|
|
if (true_vifi >= 0 && mrt->mroute_do_assert &&
|
|
/* pimsm uses asserts, when switching from RPT to SPT,
|
|
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
|
|
index 23b46b5705c537..2ad0ef47b07c24 100644
|
|
--- a/net/ipv6/ndisc.c
|
|
+++ b/net/ipv6/ndisc.c
|
|
@@ -1717,10 +1717,12 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
|
|
"Redirect: destination is not a neighbour\n");
|
|
goto release;
|
|
}
|
|
- peer = inet_getpeer_v6(net->ipv6.peers, &ipv6_hdr(skb)->saddr, 1);
|
|
+
|
|
+ rcu_read_lock();
|
|
+ peer = inet_getpeer_v6(net->ipv6.peers, &ipv6_hdr(skb)->saddr);
|
|
ret = inet_peer_xrlim_allow(peer, 1*HZ);
|
|
- if (peer)
|
|
- inet_putpeer(peer);
|
|
+ rcu_read_unlock();
|
|
+
|
|
if (!ret)
|
|
goto release;
|
|
|
|
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
|
|
index 63250286dc8b7a..d6938ffd764caf 100644
|
|
--- a/net/mac80211/debugfs_netdev.c
|
|
+++ b/net/mac80211/debugfs_netdev.c
|
|
@@ -616,7 +616,7 @@ static ssize_t ieee80211_if_parse_active_links(struct ieee80211_sub_if_data *sda
|
|
{
|
|
u16 active_links;
|
|
|
|
- if (kstrtou16(buf, 0, &active_links))
|
|
+ if (kstrtou16(buf, 0, &active_links) || !active_links)
|
|
return -EINVAL;
|
|
|
|
return ieee80211_set_active_links(&sdata->vif, active_links) ?: buflen;
|
|
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
|
|
index 2bc2fbe58f944b..78aa3bc51586e2 100644
|
|
--- a/net/mac80211/driver-ops.h
|
|
+++ b/net/mac80211/driver-ops.h
|
|
@@ -665,6 +665,9 @@ static inline void drv_flush_sta(struct ieee80211_local *local,
|
|
if (sdata && !check_sdata_in_driver(sdata))
|
|
return;
|
|
|
|
+ if (!sta->uploaded)
|
|
+ return;
|
|
+
|
|
trace_drv_flush_sta(local, sdata, &sta->sta);
|
|
if (local->ops->flush_sta)
|
|
local->ops->flush_sta(&local->hw, &sdata->vif, &sta->sta);
|
|
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
|
|
index 604863cebc198a..5eb233f619817b 100644
|
|
--- a/net/mac80211/rx.c
|
|
+++ b/net/mac80211/rx.c
|
|
@@ -2957,6 +2957,7 @@ ieee80211_rx_mesh_data(struct ieee80211_sub_if_data *sdata, struct sta_info *sta
|
|
}
|
|
|
|
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
|
|
+ ieee80211_set_qos_hdr(sdata, fwd_skb);
|
|
ieee80211_add_pending_skb(local, fwd_skb);
|
|
|
|
rx_accept:
|
|
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
|
|
index 8e6a6dc6e0a409..838c154b2b90f5 100644
|
|
--- a/net/mptcp/options.c
|
|
+++ b/net/mptcp/options.c
|
|
@@ -108,7 +108,6 @@ static void mptcp_parse_option(const struct sk_buff *skb,
|
|
mp_opt->suboptions |= OPTION_MPTCP_DSS;
|
|
mp_opt->use_map = 1;
|
|
mp_opt->mpc_map = 1;
|
|
- mp_opt->use_ack = 0;
|
|
mp_opt->data_len = get_unaligned_be16(ptr);
|
|
ptr += 2;
|
|
}
|
|
@@ -157,11 +156,6 @@ static void mptcp_parse_option(const struct sk_buff *skb,
|
|
pr_debug("DSS\n");
|
|
ptr++;
|
|
|
|
- /* we must clear 'mpc_map' be able to detect MP_CAPABLE
|
|
- * map vs DSS map in mptcp_incoming_options(), and reconstruct
|
|
- * map info accordingly
|
|
- */
|
|
- mp_opt->mpc_map = 0;
|
|
flags = (*ptr++) & MPTCP_DSS_FLAG_MASK;
|
|
mp_opt->data_fin = (flags & MPTCP_DSS_DATA_FIN) != 0;
|
|
mp_opt->dsn64 = (flags & MPTCP_DSS_DSN64) != 0;
|
|
@@ -369,8 +363,11 @@ void mptcp_get_options(const struct sk_buff *skb,
|
|
const unsigned char *ptr;
|
|
int length;
|
|
|
|
- /* initialize option status */
|
|
- mp_opt->suboptions = 0;
|
|
+ /* Ensure that casting the whole status to u32 is efficient and safe */
|
|
+ BUILD_BUG_ON(sizeof_field(struct mptcp_options_received, status) != sizeof(u32));
|
|
+ BUILD_BUG_ON(!IS_ALIGNED(offsetof(struct mptcp_options_received, status),
|
|
+ sizeof(u32)));
|
|
+ *(u32 *)&mp_opt->status = 0;
|
|
|
|
length = (th->doff * 4) - sizeof(struct tcphdr);
|
|
ptr = (const unsigned char *)(th + 1);
|
|
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
|
|
index 07f3a9703312e5..5143214695dcd8 100644
|
|
--- a/net/mptcp/protocol.c
|
|
+++ b/net/mptcp/protocol.c
|
|
@@ -1768,8 +1768,10 @@ static int mptcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg,
|
|
* see mptcp_disconnect().
|
|
* Attempt it again outside the problematic scope.
|
|
*/
|
|
- if (!mptcp_disconnect(sk, 0))
|
|
+ if (!mptcp_disconnect(sk, 0)) {
|
|
+ sk->sk_disconnects++;
|
|
sk->sk_socket->state = SS_UNCONNECTED;
|
|
+ }
|
|
}
|
|
inet_clear_bit(DEFER_CONNECT, sk);
|
|
|
|
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
|
|
index 88c762de772875..0bb0386aa0897e 100644
|
|
--- a/net/mptcp/protocol.h
|
|
+++ b/net/mptcp/protocol.h
|
|
@@ -149,22 +149,24 @@ struct mptcp_options_received {
|
|
u32 subflow_seq;
|
|
u16 data_len;
|
|
__sum16 csum;
|
|
- u16 suboptions;
|
|
+ struct_group(status,
|
|
+ u16 suboptions;
|
|
+ u16 use_map:1,
|
|
+ dsn64:1,
|
|
+ data_fin:1,
|
|
+ use_ack:1,
|
|
+ ack64:1,
|
|
+ mpc_map:1,
|
|
+ reset_reason:4,
|
|
+ reset_transient:1,
|
|
+ echo:1,
|
|
+ backup:1,
|
|
+ deny_join_id0:1,
|
|
+ __unused:2;
|
|
+ );
|
|
+ u8 join_id;
|
|
u32 token;
|
|
u32 nonce;
|
|
- u16 use_map:1,
|
|
- dsn64:1,
|
|
- data_fin:1,
|
|
- use_ack:1,
|
|
- ack64:1,
|
|
- mpc_map:1,
|
|
- reset_reason:4,
|
|
- reset_transient:1,
|
|
- echo:1,
|
|
- backup:1,
|
|
- deny_join_id0:1,
|
|
- __unused:2;
|
|
- u8 join_id;
|
|
u64 thmac;
|
|
u8 hmac[MPTCPOPT_HMAC_LEN];
|
|
struct mptcp_addr_info addr;
|
|
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
|
|
index 1d1e998acd675e..bf24c63aff7b54 100644
|
|
--- a/net/netfilter/nf_tables_api.c
|
|
+++ b/net/netfilter/nf_tables_api.c
|
|
@@ -4552,6 +4552,14 @@ static int nf_tables_fill_set_concat(struct sk_buff *skb,
|
|
return 0;
|
|
}
|
|
|
|
+static u32 nft_set_userspace_size(const struct nft_set_ops *ops, u32 size)
|
|
+{
|
|
+ if (ops->usize)
|
|
+ return ops->usize(size);
|
|
+
|
|
+ return size;
|
|
+}
|
|
+
|
|
static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx,
|
|
const struct nft_set *set, u16 event, u16 flags)
|
|
{
|
|
@@ -4622,7 +4630,8 @@ static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx,
|
|
if (!nest)
|
|
goto nla_put_failure;
|
|
if (set->size &&
|
|
- nla_put_be32(skb, NFTA_SET_DESC_SIZE, htonl(set->size)))
|
|
+ nla_put_be32(skb, NFTA_SET_DESC_SIZE,
|
|
+ htonl(nft_set_userspace_size(set->ops, set->size))))
|
|
goto nla_put_failure;
|
|
|
|
if (set->field_count > 1 &&
|
|
@@ -4866,7 +4875,7 @@ static int nft_set_desc_concat_parse(const struct nlattr *attr,
|
|
static int nft_set_desc_concat(struct nft_set_desc *desc,
|
|
const struct nlattr *nla)
|
|
{
|
|
- u32 num_regs = 0, key_num_regs = 0;
|
|
+ u32 len = 0, num_regs;
|
|
struct nlattr *attr;
|
|
int rem, err, i;
|
|
|
|
@@ -4880,12 +4889,12 @@ static int nft_set_desc_concat(struct nft_set_desc *desc,
|
|
}
|
|
|
|
for (i = 0; i < desc->field_count; i++)
|
|
- num_regs += DIV_ROUND_UP(desc->field_len[i], sizeof(u32));
|
|
+ len += round_up(desc->field_len[i], sizeof(u32));
|
|
|
|
- key_num_regs = DIV_ROUND_UP(desc->klen, sizeof(u32));
|
|
- if (key_num_regs != num_regs)
|
|
+ if (len != desc->klen)
|
|
return -EINVAL;
|
|
|
|
+ num_regs = DIV_ROUND_UP(desc->klen, sizeof(u32));
|
|
if (num_regs > NFT_REG32_COUNT)
|
|
return -E2BIG;
|
|
|
|
@@ -4992,6 +5001,15 @@ static bool nft_set_is_same(const struct nft_set *set,
|
|
return true;
|
|
}
|
|
|
|
+static u32 nft_set_kernel_size(const struct nft_set_ops *ops,
|
|
+ const struct nft_set_desc *desc)
|
|
+{
|
|
+ if (ops->ksize)
|
|
+ return ops->ksize(desc->size);
|
|
+
|
|
+ return desc->size;
|
|
+}
|
|
+
|
|
static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
|
|
const struct nlattr * const nla[])
|
|
{
|
|
@@ -5174,6 +5192,9 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
|
|
if (err < 0)
|
|
return err;
|
|
|
|
+ if (desc.size)
|
|
+ desc.size = nft_set_kernel_size(set->ops, &desc);
|
|
+
|
|
err = 0;
|
|
if (!nft_set_is_same(set, &desc, exprs, num_exprs, flags)) {
|
|
NL_SET_BAD_ATTR(extack, nla[NFTA_SET_NAME]);
|
|
@@ -5196,6 +5217,9 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
|
|
if (IS_ERR(ops))
|
|
return PTR_ERR(ops);
|
|
|
|
+ if (desc.size)
|
|
+ desc.size = nft_set_kernel_size(ops, &desc);
|
|
+
|
|
udlen = 0;
|
|
if (nla[NFTA_SET_USERDATA])
|
|
udlen = nla_len(nla[NFTA_SET_USERDATA]);
|
|
@@ -6679,6 +6703,27 @@ static bool nft_setelem_valid_key_end(const struct nft_set *set,
|
|
return true;
|
|
}
|
|
|
|
+static u32 nft_set_maxsize(const struct nft_set *set)
|
|
+{
|
|
+ u32 maxsize, delta;
|
|
+
|
|
+ if (!set->size)
|
|
+ return UINT_MAX;
|
|
+
|
|
+ if (set->ops->adjust_maxsize)
|
|
+ delta = set->ops->adjust_maxsize(set);
|
|
+ else
|
|
+ delta = 0;
|
|
+
|
|
+ if (check_add_overflow(set->size, set->ndeact, &maxsize))
|
|
+ return UINT_MAX;
|
|
+
|
|
+ if (check_add_overflow(maxsize, delta, &maxsize))
|
|
+ return UINT_MAX;
|
|
+
|
|
+ return maxsize;
|
|
+}
|
|
+
|
|
static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
|
|
const struct nlattr *attr, u32 nlmsg_flags)
|
|
{
|
|
@@ -7023,7 +7068,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
|
|
}
|
|
|
|
if (!(flags & NFT_SET_ELEM_CATCHALL)) {
|
|
- unsigned int max = set->size ? set->size + set->ndeact : UINT_MAX;
|
|
+ unsigned int max = nft_set_maxsize(set);
|
|
|
|
if (!atomic_add_unless(&set->nelems, 1, max)) {
|
|
err = -ENFILE;
|
|
diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c
|
|
index 397351fa4d5f82..5a3d6854204202 100644
|
|
--- a/net/netfilter/nft_flow_offload.c
|
|
+++ b/net/netfilter/nft_flow_offload.c
|
|
@@ -288,6 +288,15 @@ static bool nft_flow_offload_skip(struct sk_buff *skb, int family)
|
|
return false;
|
|
}
|
|
|
|
+static void flow_offload_ct_tcp(struct nf_conn *ct)
|
|
+{
|
|
+ /* conntrack will not see all packets, disable tcp window validation. */
|
|
+ spin_lock_bh(&ct->lock);
|
|
+ ct->proto.tcp.seen[0].flags |= IP_CT_TCP_FLAG_BE_LIBERAL;
|
|
+ ct->proto.tcp.seen[1].flags |= IP_CT_TCP_FLAG_BE_LIBERAL;
|
|
+ spin_unlock_bh(&ct->lock);
|
|
+}
|
|
+
|
|
static void nft_flow_offload_eval(const struct nft_expr *expr,
|
|
struct nft_regs *regs,
|
|
const struct nft_pktinfo *pkt)
|
|
@@ -355,11 +364,8 @@ static void nft_flow_offload_eval(const struct nft_expr *expr,
|
|
goto err_flow_alloc;
|
|
|
|
flow_offload_route_init(flow, &route);
|
|
-
|
|
- if (tcph) {
|
|
- ct->proto.tcp.seen[0].flags |= IP_CT_TCP_FLAG_BE_LIBERAL;
|
|
- ct->proto.tcp.seen[1].flags |= IP_CT_TCP_FLAG_BE_LIBERAL;
|
|
- }
|
|
+ if (tcph)
|
|
+ flow_offload_ct_tcp(ct);
|
|
|
|
ret = flow_offload_add(flowtable, flow);
|
|
if (ret < 0)
|
|
diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c
|
|
index 334958ef8d66c8..5dab9905ebbecc 100644
|
|
--- a/net/netfilter/nft_set_pipapo.c
|
|
+++ b/net/netfilter/nft_set_pipapo.c
|
|
@@ -1574,12 +1574,11 @@ static void nft_pipapo_gc_deactivate(struct net *net, struct nft_set *set,
|
|
|
|
/**
|
|
* pipapo_gc() - Drop expired entries from set, destroy start and end elements
|
|
- * @_set: nftables API set representation
|
|
+ * @set: nftables API set representation
|
|
* @m: Matching data
|
|
*/
|
|
-static void pipapo_gc(const struct nft_set *_set, struct nft_pipapo_match *m)
|
|
+static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)
|
|
{
|
|
- struct nft_set *set = (struct nft_set *) _set;
|
|
struct nft_pipapo *priv = nft_set_priv(set);
|
|
struct net *net = read_pnet(&set->net);
|
|
int rules_f0, first_rule = 0;
|
|
@@ -1693,7 +1692,7 @@ static void pipapo_reclaim_match(struct rcu_head *rcu)
|
|
* We also need to create a new working copy for subsequent insertions and
|
|
* deletions.
|
|
*/
|
|
-static void nft_pipapo_commit(const struct nft_set *set)
|
|
+static void nft_pipapo_commit(struct nft_set *set)
|
|
{
|
|
struct nft_pipapo *priv = nft_set_priv(set);
|
|
struct nft_pipapo_match *new_clone, *old;
|
|
diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
|
|
index afbda7e3fd0487..8ad1e008d12b5b 100644
|
|
--- a/net/netfilter/nft_set_rbtree.c
|
|
+++ b/net/netfilter/nft_set_rbtree.c
|
|
@@ -19,7 +19,7 @@ struct nft_rbtree {
|
|
struct rb_root root;
|
|
rwlock_t lock;
|
|
seqcount_rwlock_t count;
|
|
- struct delayed_work gc_work;
|
|
+ unsigned long last_gc;
|
|
};
|
|
|
|
struct nft_rbtree_elem {
|
|
@@ -48,8 +48,7 @@ static int nft_rbtree_cmp(const struct nft_set *set,
|
|
|
|
static bool nft_rbtree_elem_expired(const struct nft_rbtree_elem *rbe)
|
|
{
|
|
- return nft_set_elem_expired(&rbe->ext) ||
|
|
- nft_set_elem_is_dead(&rbe->ext);
|
|
+ return nft_set_elem_expired(&rbe->ext);
|
|
}
|
|
|
|
static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *set,
|
|
@@ -221,14 +220,15 @@ static void *nft_rbtree_get(const struct net *net, const struct nft_set *set,
|
|
return rbe;
|
|
}
|
|
|
|
-static void nft_rbtree_gc_remove(struct net *net, struct nft_set *set,
|
|
- struct nft_rbtree *priv,
|
|
- struct nft_rbtree_elem *rbe)
|
|
+static void nft_rbtree_gc_elem_remove(struct net *net, struct nft_set *set,
|
|
+ struct nft_rbtree *priv,
|
|
+ struct nft_rbtree_elem *rbe)
|
|
{
|
|
struct nft_set_elem elem = {
|
|
.priv = rbe,
|
|
};
|
|
|
|
+ lockdep_assert_held_write(&priv->lock);
|
|
nft_setelem_data_deactivate(net, set, &elem);
|
|
rb_erase(&rbe->node, &priv->root);
|
|
}
|
|
@@ -263,7 +263,7 @@ nft_rbtree_gc_elem(const struct nft_set *__set, struct nft_rbtree *priv,
|
|
rbe_prev = NULL;
|
|
if (prev) {
|
|
rbe_prev = rb_entry(prev, struct nft_rbtree_elem, node);
|
|
- nft_rbtree_gc_remove(net, set, priv, rbe_prev);
|
|
+ nft_rbtree_gc_elem_remove(net, set, priv, rbe_prev);
|
|
|
|
/* There is always room in this trans gc for this element,
|
|
* memory allocation never actually happens, hence, the warning
|
|
@@ -277,7 +277,7 @@ nft_rbtree_gc_elem(const struct nft_set *__set, struct nft_rbtree *priv,
|
|
nft_trans_gc_elem_add(gc, rbe_prev);
|
|
}
|
|
|
|
- nft_rbtree_gc_remove(net, set, priv, rbe);
|
|
+ nft_rbtree_gc_elem_remove(net, set, priv, rbe);
|
|
gc = nft_trans_gc_queue_sync(gc, GFP_ATOMIC);
|
|
if (WARN_ON_ONCE(!gc))
|
|
return ERR_PTR(-ENOMEM);
|
|
@@ -507,6 +507,15 @@ static int nft_rbtree_insert(const struct net *net, const struct nft_set *set,
|
|
return err;
|
|
}
|
|
|
|
+static void nft_rbtree_erase(struct nft_rbtree *priv, struct nft_rbtree_elem *rbe)
|
|
+{
|
|
+ write_lock_bh(&priv->lock);
|
|
+ write_seqcount_begin(&priv->count);
|
|
+ rb_erase(&rbe->node, &priv->root);
|
|
+ write_seqcount_end(&priv->count);
|
|
+ write_unlock_bh(&priv->lock);
|
|
+}
|
|
+
|
|
static void nft_rbtree_remove(const struct net *net,
|
|
const struct nft_set *set,
|
|
const struct nft_set_elem *elem)
|
|
@@ -514,11 +523,7 @@ static void nft_rbtree_remove(const struct net *net,
|
|
struct nft_rbtree *priv = nft_set_priv(set);
|
|
struct nft_rbtree_elem *rbe = elem->priv;
|
|
|
|
- write_lock_bh(&priv->lock);
|
|
- write_seqcount_begin(&priv->count);
|
|
- rb_erase(&rbe->node, &priv->root);
|
|
- write_seqcount_end(&priv->count);
|
|
- write_unlock_bh(&priv->lock);
|
|
+ nft_rbtree_erase(priv, rbe);
|
|
}
|
|
|
|
static void nft_rbtree_activate(const struct net *net,
|
|
@@ -610,45 +615,40 @@ static void nft_rbtree_walk(const struct nft_ctx *ctx,
|
|
read_unlock_bh(&priv->lock);
|
|
}
|
|
|
|
-static void nft_rbtree_gc(struct work_struct *work)
|
|
+static void nft_rbtree_gc_remove(struct net *net, struct nft_set *set,
|
|
+ struct nft_rbtree *priv,
|
|
+ struct nft_rbtree_elem *rbe)
|
|
+{
|
|
+ struct nft_set_elem elem = {
|
|
+ .priv = rbe,
|
|
+ };
|
|
+
|
|
+ nft_setelem_data_deactivate(net, set, &elem);
|
|
+ nft_rbtree_erase(priv, rbe);
|
|
+}
|
|
+
|
|
+static void nft_rbtree_gc(struct nft_set *set)
|
|
{
|
|
+ struct nft_rbtree *priv = nft_set_priv(set);
|
|
struct nft_rbtree_elem *rbe, *rbe_end = NULL;
|
|
struct nftables_pernet *nft_net;
|
|
- struct nft_rbtree *priv;
|
|
+ struct rb_node *node, *next;
|
|
struct nft_trans_gc *gc;
|
|
- struct rb_node *node;
|
|
- struct nft_set *set;
|
|
- unsigned int gc_seq;
|
|
struct net *net;
|
|
|
|
- priv = container_of(work, struct nft_rbtree, gc_work.work);
|
|
set = nft_set_container_of(priv);
|
|
net = read_pnet(&set->net);
|
|
nft_net = nft_pernet(net);
|
|
- gc_seq = READ_ONCE(nft_net->gc_seq);
|
|
|
|
- if (nft_set_gc_is_pending(set))
|
|
- goto done;
|
|
-
|
|
- gc = nft_trans_gc_alloc(set, gc_seq, GFP_KERNEL);
|
|
+ gc = nft_trans_gc_alloc(set, 0, GFP_KERNEL);
|
|
if (!gc)
|
|
- goto done;
|
|
+ return;
|
|
|
|
- read_lock_bh(&priv->lock);
|
|
- for (node = rb_first(&priv->root); node != NULL; node = rb_next(node)) {
|
|
-
|
|
- /* Ruleset has been updated, try later. */
|
|
- if (READ_ONCE(nft_net->gc_seq) != gc_seq) {
|
|
- nft_trans_gc_destroy(gc);
|
|
- gc = NULL;
|
|
- goto try_later;
|
|
- }
|
|
+ for (node = rb_first(&priv->root); node ; node = next) {
|
|
+ next = rb_next(node);
|
|
|
|
rbe = rb_entry(node, struct nft_rbtree_elem, node);
|
|
|
|
- if (nft_set_elem_is_dead(&rbe->ext))
|
|
- goto dead_elem;
|
|
-
|
|
/* elements are reversed in the rbtree for historical reasons,
|
|
* from highest to lowest value, that is why end element is
|
|
* always visited before the start element.
|
|
@@ -660,37 +660,34 @@ static void nft_rbtree_gc(struct work_struct *work)
|
|
if (!nft_set_elem_expired(&rbe->ext))
|
|
continue;
|
|
|
|
- nft_set_elem_dead(&rbe->ext);
|
|
-
|
|
- if (!rbe_end)
|
|
- continue;
|
|
-
|
|
- nft_set_elem_dead(&rbe_end->ext);
|
|
-
|
|
- gc = nft_trans_gc_queue_async(gc, gc_seq, GFP_ATOMIC);
|
|
+ gc = nft_trans_gc_queue_sync(gc, GFP_KERNEL);
|
|
if (!gc)
|
|
goto try_later;
|
|
|
|
- nft_trans_gc_elem_add(gc, rbe_end);
|
|
- rbe_end = NULL;
|
|
-dead_elem:
|
|
- gc = nft_trans_gc_queue_async(gc, gc_seq, GFP_ATOMIC);
|
|
+ /* end element needs to be removed first, it has
|
|
+ * no timeout extension.
|
|
+ */
|
|
+ if (rbe_end) {
|
|
+ nft_rbtree_gc_remove(net, set, priv, rbe_end);
|
|
+ nft_trans_gc_elem_add(gc, rbe_end);
|
|
+ rbe_end = NULL;
|
|
+ }
|
|
+
|
|
+ gc = nft_trans_gc_queue_sync(gc, GFP_KERNEL);
|
|
if (!gc)
|
|
goto try_later;
|
|
|
|
+ nft_rbtree_gc_remove(net, set, priv, rbe);
|
|
nft_trans_gc_elem_add(gc, rbe);
|
|
}
|
|
|
|
- gc = nft_trans_gc_catchall_async(gc, gc_seq);
|
|
-
|
|
try_later:
|
|
- read_unlock_bh(&priv->lock);
|
|
|
|
- if (gc)
|
|
- nft_trans_gc_queue_async_done(gc);
|
|
-done:
|
|
- queue_delayed_work(system_power_efficient_wq, &priv->gc_work,
|
|
- nft_set_gc_interval(set));
|
|
+ if (gc) {
|
|
+ gc = nft_trans_gc_catchall_sync(gc);
|
|
+ nft_trans_gc_queue_sync_done(gc);
|
|
+ priv->last_gc = jiffies;
|
|
+ }
|
|
}
|
|
|
|
static u64 nft_rbtree_privsize(const struct nlattr * const nla[],
|
|
@@ -709,11 +706,6 @@ static int nft_rbtree_init(const struct nft_set *set,
|
|
seqcount_rwlock_init(&priv->count, &priv->lock);
|
|
priv->root = RB_ROOT;
|
|
|
|
- INIT_DEFERRABLE_WORK(&priv->gc_work, nft_rbtree_gc);
|
|
- if (set->flags & NFT_SET_TIMEOUT)
|
|
- queue_delayed_work(system_power_efficient_wq, &priv->gc_work,
|
|
- nft_set_gc_interval(set));
|
|
-
|
|
return 0;
|
|
}
|
|
|
|
@@ -724,8 +716,6 @@ static void nft_rbtree_destroy(const struct nft_ctx *ctx,
|
|
struct nft_rbtree_elem *rbe;
|
|
struct rb_node *node;
|
|
|
|
- cancel_delayed_work_sync(&priv->gc_work);
|
|
- rcu_barrier();
|
|
while ((node = priv->root.rb_node) != NULL) {
|
|
rb_erase(node, &priv->root);
|
|
rbe = rb_entry(node, struct nft_rbtree_elem, node);
|
|
@@ -751,6 +741,61 @@ static bool nft_rbtree_estimate(const struct nft_set_desc *desc, u32 features,
|
|
return true;
|
|
}
|
|
|
|
+static void nft_rbtree_commit(struct nft_set *set)
|
|
+{
|
|
+ struct nft_rbtree *priv = nft_set_priv(set);
|
|
+
|
|
+ if (time_after_eq(jiffies, priv->last_gc + nft_set_gc_interval(set)))
|
|
+ nft_rbtree_gc(set);
|
|
+}
|
|
+
|
|
+static void nft_rbtree_gc_init(const struct nft_set *set)
|
|
+{
|
|
+ struct nft_rbtree *priv = nft_set_priv(set);
|
|
+
|
|
+ priv->last_gc = jiffies;
|
|
+}
|
|
+
|
|
+/* rbtree stores ranges as singleton elements, each range is composed of two
|
|
+ * elements ...
|
|
+ */
|
|
+static u32 nft_rbtree_ksize(u32 size)
|
|
+{
|
|
+ return size * 2;
|
|
+}
|
|
+
|
|
+/* ... hide this detail to userspace. */
|
|
+static u32 nft_rbtree_usize(u32 size)
|
|
+{
|
|
+ if (!size)
|
|
+ return 0;
|
|
+
|
|
+ return size / 2;
|
|
+}
|
|
+
|
|
+static u32 nft_rbtree_adjust_maxsize(const struct nft_set *set)
|
|
+{
|
|
+ struct nft_rbtree *priv = nft_set_priv(set);
|
|
+ struct nft_rbtree_elem *rbe;
|
|
+ struct rb_node *node;
|
|
+ const void *key;
|
|
+
|
|
+ node = rb_last(&priv->root);
|
|
+ if (!node)
|
|
+ return 0;
|
|
+
|
|
+ rbe = rb_entry(node, struct nft_rbtree_elem, node);
|
|
+ if (!nft_rbtree_interval_end(rbe))
|
|
+ return 0;
|
|
+
|
|
+ key = nft_set_ext_key(&rbe->ext);
|
|
+ if (memchr(key, 1, set->klen))
|
|
+ return 0;
|
|
+
|
|
+ /* this is the all-zero no-match element. */
|
|
+ return 1;
|
|
+}
|
|
+
|
|
const struct nft_set_type nft_set_rbtree_type = {
|
|
.features = NFT_SET_INTERVAL | NFT_SET_MAP | NFT_SET_OBJECT | NFT_SET_TIMEOUT,
|
|
.ops = {
|
|
@@ -764,8 +809,13 @@ const struct nft_set_type nft_set_rbtree_type = {
|
|
.deactivate = nft_rbtree_deactivate,
|
|
.flush = nft_rbtree_flush,
|
|
.activate = nft_rbtree_activate,
|
|
+ .commit = nft_rbtree_commit,
|
|
+ .gc_init = nft_rbtree_gc_init,
|
|
.lookup = nft_rbtree_lookup,
|
|
.walk = nft_rbtree_walk,
|
|
.get = nft_rbtree_get,
|
|
+ .ksize = nft_rbtree_ksize,
|
|
+ .usize = nft_rbtree_usize,
|
|
+ .adjust_maxsize = nft_rbtree_adjust_maxsize,
|
|
},
|
|
};
|
|
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
|
|
index 42e8b9e37516b2..342823b918e7cc 100644
|
|
--- a/net/rose/af_rose.c
|
|
+++ b/net/rose/af_rose.c
|
|
@@ -397,15 +397,15 @@ static int rose_setsockopt(struct socket *sock, int level, int optname,
|
|
{
|
|
struct sock *sk = sock->sk;
|
|
struct rose_sock *rose = rose_sk(sk);
|
|
- int opt;
|
|
+ unsigned int opt;
|
|
|
|
if (level != SOL_ROSE)
|
|
return -ENOPROTOOPT;
|
|
|
|
- if (optlen < sizeof(int))
|
|
+ if (optlen < sizeof(unsigned int))
|
|
return -EINVAL;
|
|
|
|
- if (copy_from_sockptr(&opt, optval, sizeof(int)))
|
|
+ if (copy_from_sockptr(&opt, optval, sizeof(unsigned int)))
|
|
return -EFAULT;
|
|
|
|
switch (optname) {
|
|
@@ -414,31 +414,31 @@ static int rose_setsockopt(struct socket *sock, int level, int optname,
|
|
return 0;
|
|
|
|
case ROSE_T1:
|
|
- if (opt < 1)
|
|
+ if (opt < 1 || opt > UINT_MAX / HZ)
|
|
return -EINVAL;
|
|
rose->t1 = opt * HZ;
|
|
return 0;
|
|
|
|
case ROSE_T2:
|
|
- if (opt < 1)
|
|
+ if (opt < 1 || opt > UINT_MAX / HZ)
|
|
return -EINVAL;
|
|
rose->t2 = opt * HZ;
|
|
return 0;
|
|
|
|
case ROSE_T3:
|
|
- if (opt < 1)
|
|
+ if (opt < 1 || opt > UINT_MAX / HZ)
|
|
return -EINVAL;
|
|
rose->t3 = opt * HZ;
|
|
return 0;
|
|
|
|
case ROSE_HOLDBACK:
|
|
- if (opt < 1)
|
|
+ if (opt < 1 || opt > UINT_MAX / HZ)
|
|
return -EINVAL;
|
|
rose->hb = opt * HZ;
|
|
return 0;
|
|
|
|
case ROSE_IDLE:
|
|
- if (opt < 0)
|
|
+ if (opt > UINT_MAX / (60 * HZ))
|
|
return -EINVAL;
|
|
rose->idle = opt * 60 * HZ;
|
|
return 0;
|
|
diff --git a/net/rose/rose_timer.c b/net/rose/rose_timer.c
|
|
index f06ddbed3fed63..1525773e94aa17 100644
|
|
--- a/net/rose/rose_timer.c
|
|
+++ b/net/rose/rose_timer.c
|
|
@@ -122,6 +122,10 @@ static void rose_heartbeat_expiry(struct timer_list *t)
|
|
struct rose_sock *rose = rose_sk(sk);
|
|
|
|
bh_lock_sock(sk);
|
|
+ if (sock_owned_by_user(sk)) {
|
|
+ sk_reset_timer(sk, &sk->sk_timer, jiffies + HZ/20);
|
|
+ goto out;
|
|
+ }
|
|
switch (rose->state) {
|
|
case ROSE_STATE_0:
|
|
/* Magic here: If we listen() and a new link dies before it
|
|
@@ -152,6 +156,7 @@ static void rose_heartbeat_expiry(struct timer_list *t)
|
|
}
|
|
|
|
rose_start_heartbeat(sk);
|
|
+out:
|
|
bh_unlock_sock(sk);
|
|
sock_put(sk);
|
|
}
|
|
@@ -162,6 +167,10 @@ static void rose_timer_expiry(struct timer_list *t)
|
|
struct sock *sk = &rose->sock;
|
|
|
|
bh_lock_sock(sk);
|
|
+ if (sock_owned_by_user(sk)) {
|
|
+ sk_reset_timer(sk, &rose->timer, jiffies + HZ/20);
|
|
+ goto out;
|
|
+ }
|
|
switch (rose->state) {
|
|
case ROSE_STATE_1: /* T1 */
|
|
case ROSE_STATE_4: /* T2 */
|
|
@@ -182,6 +191,7 @@ static void rose_timer_expiry(struct timer_list *t)
|
|
}
|
|
break;
|
|
}
|
|
+out:
|
|
bh_unlock_sock(sk);
|
|
sock_put(sk);
|
|
}
|
|
@@ -192,6 +202,10 @@ static void rose_idletimer_expiry(struct timer_list *t)
|
|
struct sock *sk = &rose->sock;
|
|
|
|
bh_lock_sock(sk);
|
|
+ if (sock_owned_by_user(sk)) {
|
|
+ sk_reset_timer(sk, &rose->idletimer, jiffies + HZ/20);
|
|
+ goto out;
|
|
+ }
|
|
rose_clear_queues(sk);
|
|
|
|
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
|
|
@@ -207,6 +221,7 @@ static void rose_idletimer_expiry(struct timer_list *t)
|
|
sk->sk_state_change(sk);
|
|
sock_set_flag(sk, SOCK_DEAD);
|
|
}
|
|
+out:
|
|
bh_unlock_sock(sk);
|
|
sock_put(sk);
|
|
}
|
|
diff --git a/net/rxrpc/conn_event.c b/net/rxrpc/conn_event.c
|
|
index 598b4ee389fc1e..2a1396cd892f30 100644
|
|
--- a/net/rxrpc/conn_event.c
|
|
+++ b/net/rxrpc/conn_event.c
|
|
@@ -63,11 +63,12 @@ int rxrpc_abort_conn(struct rxrpc_connection *conn, struct sk_buff *skb,
|
|
/*
|
|
* Mark a connection as being remotely aborted.
|
|
*/
|
|
-static bool rxrpc_input_conn_abort(struct rxrpc_connection *conn,
|
|
+static void rxrpc_input_conn_abort(struct rxrpc_connection *conn,
|
|
struct sk_buff *skb)
|
|
{
|
|
- return rxrpc_set_conn_aborted(conn, skb, skb->priority, -ECONNABORTED,
|
|
- RXRPC_CALL_REMOTELY_ABORTED);
|
|
+ trace_rxrpc_rx_conn_abort(conn, skb);
|
|
+ rxrpc_set_conn_aborted(conn, skb, skb->priority, -ECONNABORTED,
|
|
+ RXRPC_CALL_REMOTELY_ABORTED);
|
|
}
|
|
|
|
/*
|
|
@@ -202,11 +203,14 @@ static void rxrpc_abort_calls(struct rxrpc_connection *conn)
|
|
|
|
for (i = 0; i < RXRPC_MAXCALLS; i++) {
|
|
call = conn->channels[i].call;
|
|
- if (call)
|
|
+ if (call) {
|
|
+ rxrpc_see_call(call, rxrpc_call_see_conn_abort);
|
|
rxrpc_set_call_completion(call,
|
|
conn->completion,
|
|
conn->abort_code,
|
|
conn->error);
|
|
+ rxrpc_poke_call(call, rxrpc_call_poke_conn_abort);
|
|
+ }
|
|
}
|
|
|
|
_leave("");
|
|
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
|
|
index 00f95e7d1b9116..7cddaa6321c7c9 100644
|
|
--- a/net/sched/sch_api.c
|
|
+++ b/net/sched/sch_api.c
|
|
@@ -1635,6 +1635,10 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
|
|
q = qdisc_lookup(dev, tcm->tcm_handle);
|
|
if (!q)
|
|
goto create_n_graft;
|
|
+ if (q->parent != tcm->tcm_parent) {
|
|
+ NL_SET_ERR_MSG(extack, "Cannot move an existing qdisc to a different parent");
|
|
+ return -EINVAL;
|
|
+ }
|
|
if (n->nlmsg_flags & NLM_F_EXCL) {
|
|
NL_SET_ERR_MSG(extack, "Exclusivity flag on, cannot override");
|
|
return -EEXIST;
|
|
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
|
|
index 66dcb18638fea4..60754f366ab7bc 100644
|
|
--- a/net/sched/sch_sfq.c
|
|
+++ b/net/sched/sch_sfq.c
|
|
@@ -77,12 +77,6 @@
|
|
#define SFQ_EMPTY_SLOT 0xffff
|
|
#define SFQ_DEFAULT_HASH_DIVISOR 1024
|
|
|
|
-/* We use 16 bits to store allot, and want to handle packets up to 64K
|
|
- * Scale allot by 8 (1<<3) so that no overflow occurs.
|
|
- */
|
|
-#define SFQ_ALLOT_SHIFT 3
|
|
-#define SFQ_ALLOT_SIZE(X) DIV_ROUND_UP(X, 1 << SFQ_ALLOT_SHIFT)
|
|
-
|
|
/* This type should contain at least SFQ_MAX_DEPTH + 1 + SFQ_MAX_FLOWS values */
|
|
typedef u16 sfq_index;
|
|
|
|
@@ -104,7 +98,7 @@ struct sfq_slot {
|
|
sfq_index next; /* next slot in sfq RR chain */
|
|
struct sfq_head dep; /* anchor in dep[] chains */
|
|
unsigned short hash; /* hash value (index in ht[]) */
|
|
- short allot; /* credit for this slot */
|
|
+ int allot; /* credit for this slot */
|
|
|
|
unsigned int backlog;
|
|
struct red_vars vars;
|
|
@@ -120,7 +114,6 @@ struct sfq_sched_data {
|
|
siphash_key_t perturbation;
|
|
u8 cur_depth; /* depth of longest slot */
|
|
u8 flags;
|
|
- unsigned short scaled_quantum; /* SFQ_ALLOT_SIZE(quantum) */
|
|
struct tcf_proto __rcu *filter_list;
|
|
struct tcf_block *block;
|
|
sfq_index *ht; /* Hash table ('divisor' slots) */
|
|
@@ -456,7 +449,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)
|
|
*/
|
|
q->tail = slot;
|
|
/* We could use a bigger initial quantum for new flows */
|
|
- slot->allot = q->scaled_quantum;
|
|
+ slot->allot = q->quantum;
|
|
}
|
|
if (++sch->q.qlen <= q->limit)
|
|
return NET_XMIT_SUCCESS;
|
|
@@ -493,7 +486,7 @@ sfq_dequeue(struct Qdisc *sch)
|
|
slot = &q->slots[a];
|
|
if (slot->allot <= 0) {
|
|
q->tail = slot;
|
|
- slot->allot += q->scaled_quantum;
|
|
+ slot->allot += q->quantum;
|
|
goto next_slot;
|
|
}
|
|
skb = slot_dequeue_head(slot);
|
|
@@ -512,7 +505,7 @@ sfq_dequeue(struct Qdisc *sch)
|
|
}
|
|
q->tail->next = next_a;
|
|
} else {
|
|
- slot->allot -= SFQ_ALLOT_SIZE(qdisc_pkt_len(skb));
|
|
+ slot->allot -= qdisc_pkt_len(skb);
|
|
}
|
|
return skb;
|
|
}
|
|
@@ -595,7 +588,7 @@ static void sfq_rehash(struct Qdisc *sch)
|
|
q->tail->next = x;
|
|
}
|
|
q->tail = slot;
|
|
- slot->allot = q->scaled_quantum;
|
|
+ slot->allot = q->quantum;
|
|
}
|
|
}
|
|
sch->q.qlen -= dropped;
|
|
@@ -608,6 +601,7 @@ static void sfq_perturbation(struct timer_list *t)
|
|
struct Qdisc *sch = q->sch;
|
|
spinlock_t *root_lock;
|
|
siphash_key_t nkey;
|
|
+ int period;
|
|
|
|
get_random_bytes(&nkey, sizeof(nkey));
|
|
rcu_read_lock();
|
|
@@ -618,12 +612,17 @@ static void sfq_perturbation(struct timer_list *t)
|
|
sfq_rehash(sch);
|
|
spin_unlock(root_lock);
|
|
|
|
- if (q->perturb_period)
|
|
- mod_timer(&q->perturb_timer, jiffies + q->perturb_period);
|
|
+ /* q->perturb_period can change under us from
|
|
+ * sfq_change() and sfq_destroy().
|
|
+ */
|
|
+ period = READ_ONCE(q->perturb_period);
|
|
+ if (period)
|
|
+ mod_timer(&q->perturb_timer, jiffies + period);
|
|
rcu_read_unlock();
|
|
}
|
|
|
|
-static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
|
|
+static int sfq_change(struct Qdisc *sch, struct nlattr *opt,
|
|
+ struct netlink_ext_ack *extack)
|
|
{
|
|
struct sfq_sched_data *q = qdisc_priv(sch);
|
|
struct tc_sfq_qopt *ctl = nla_data(opt);
|
|
@@ -641,14 +640,10 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
|
|
(!is_power_of_2(ctl->divisor) || ctl->divisor > 65536))
|
|
return -EINVAL;
|
|
|
|
- /* slot->allot is a short, make sure quantum is not too big. */
|
|
- if (ctl->quantum) {
|
|
- unsigned int scaled = SFQ_ALLOT_SIZE(ctl->quantum);
|
|
-
|
|
- if (scaled <= 0 || scaled > SHRT_MAX)
|
|
- return -EINVAL;
|
|
+ if ((int)ctl->quantum < 0) {
|
|
+ NL_SET_ERR_MSG_MOD(extack, "invalid quantum");
|
|
+ return -EINVAL;
|
|
}
|
|
-
|
|
if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max,
|
|
ctl_v1->Wlog, ctl_v1->Scell_log, NULL))
|
|
return -EINVAL;
|
|
@@ -657,12 +652,14 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
|
|
if (!p)
|
|
return -ENOMEM;
|
|
}
|
|
+ if (ctl->limit == 1) {
|
|
+ NL_SET_ERR_MSG_MOD(extack, "invalid limit");
|
|
+ return -EINVAL;
|
|
+ }
|
|
sch_tree_lock(sch);
|
|
- if (ctl->quantum) {
|
|
+ if (ctl->quantum)
|
|
q->quantum = ctl->quantum;
|
|
- q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
|
|
- }
|
|
- q->perturb_period = ctl->perturb_period * HZ;
|
|
+ WRITE_ONCE(q->perturb_period, ctl->perturb_period * HZ);
|
|
if (ctl->flows)
|
|
q->maxflows = min_t(u32, ctl->flows, SFQ_MAX_FLOWS);
|
|
if (ctl->divisor) {
|
|
@@ -724,7 +721,7 @@ static void sfq_destroy(struct Qdisc *sch)
|
|
struct sfq_sched_data *q = qdisc_priv(sch);
|
|
|
|
tcf_block_put(q->block);
|
|
- q->perturb_period = 0;
|
|
+ WRITE_ONCE(q->perturb_period, 0);
|
|
del_timer_sync(&q->perturb_timer);
|
|
sfq_free(q->ht);
|
|
sfq_free(q->slots);
|
|
@@ -757,12 +754,11 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt,
|
|
q->divisor = SFQ_DEFAULT_HASH_DIVISOR;
|
|
q->maxflows = SFQ_DEFAULT_FLOWS;
|
|
q->quantum = psched_mtu(qdisc_dev(sch));
|
|
- q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
|
|
q->perturb_period = 0;
|
|
get_random_bytes(&q->perturbation, sizeof(q->perturbation));
|
|
|
|
if (opt) {
|
|
- int err = sfq_change(sch, opt);
|
|
+ int err = sfq_change(sch, opt, extack);
|
|
if (err)
|
|
return err;
|
|
}
|
|
@@ -873,7 +869,7 @@ static int sfq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
|
|
if (idx != SFQ_EMPTY_SLOT) {
|
|
const struct sfq_slot *slot = &q->slots[idx];
|
|
|
|
- xstats.allot = slot->allot << SFQ_ALLOT_SHIFT;
|
|
+ xstats.allot = slot->allot;
|
|
qs.qlen = slot->qlen;
|
|
qs.backlog = slot->backlog;
|
|
}
|
|
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
|
|
index 0acf07538840cc..45efbbfff94ae2 100644
|
|
--- a/net/smc/af_smc.c
|
|
+++ b/net/smc/af_smc.c
|
|
@@ -2745,7 +2745,7 @@ static int smc_accept(struct socket *sock, struct socket *new_sock,
|
|
release_sock(clcsk);
|
|
} else if (!atomic_read(&smc_sk(nsk)->conn.bytes_to_rcv)) {
|
|
lock_sock(nsk);
|
|
- smc_rx_wait(smc_sk(nsk), &timeo, smc_rx_data_available);
|
|
+ smc_rx_wait(smc_sk(nsk), &timeo, 0, smc_rx_data_available);
|
|
release_sock(nsk);
|
|
}
|
|
}
|
|
diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
|
|
index 9a2f3638d161d2..acb14e28cad411 100644
|
|
--- a/net/smc/smc_rx.c
|
|
+++ b/net/smc/smc_rx.c
|
|
@@ -238,22 +238,23 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len,
|
|
return -ENOMEM;
|
|
}
|
|
|
|
-static int smc_rx_data_available_and_no_splice_pend(struct smc_connection *conn)
|
|
+static int smc_rx_data_available_and_no_splice_pend(struct smc_connection *conn, size_t peeked)
|
|
{
|
|
- return atomic_read(&conn->bytes_to_rcv) &&
|
|
+ return smc_rx_data_available(conn, peeked) &&
|
|
!atomic_read(&conn->splice_pending);
|
|
}
|
|
|
|
/* blocks rcvbuf consumer until >=len bytes available or timeout or interrupted
|
|
* @smc smc socket
|
|
* @timeo pointer to max seconds to wait, pointer to value 0 for no timeout
|
|
+ * @peeked number of bytes already peeked
|
|
* @fcrit add'l criterion to evaluate as function pointer
|
|
* Returns:
|
|
* 1 if at least 1 byte available in rcvbuf or if socket error/shutdown.
|
|
* 0 otherwise (nothing in rcvbuf nor timeout, e.g. interrupted).
|
|
*/
|
|
-int smc_rx_wait(struct smc_sock *smc, long *timeo,
|
|
- int (*fcrit)(struct smc_connection *conn))
|
|
+int smc_rx_wait(struct smc_sock *smc, long *timeo, size_t peeked,
|
|
+ int (*fcrit)(struct smc_connection *conn, size_t baseline))
|
|
{
|
|
DEFINE_WAIT_FUNC(wait, woken_wake_function);
|
|
struct smc_connection *conn = &smc->conn;
|
|
@@ -262,7 +263,7 @@ int smc_rx_wait(struct smc_sock *smc, long *timeo,
|
|
struct sock *sk = &smc->sk;
|
|
int rc;
|
|
|
|
- if (fcrit(conn))
|
|
+ if (fcrit(conn, peeked))
|
|
return 1;
|
|
sk_set_bit(SOCKWQ_ASYNC_WAITDATA, sk);
|
|
add_wait_queue(sk_sleep(sk), &wait);
|
|
@@ -271,7 +272,7 @@ int smc_rx_wait(struct smc_sock *smc, long *timeo,
|
|
cflags->peer_conn_abort ||
|
|
READ_ONCE(sk->sk_shutdown) & RCV_SHUTDOWN ||
|
|
conn->killed ||
|
|
- fcrit(conn),
|
|
+ fcrit(conn, peeked),
|
|
&wait);
|
|
remove_wait_queue(sk_sleep(sk), &wait);
|
|
sk_clear_bit(SOCKWQ_ASYNC_WAITDATA, sk);
|
|
@@ -322,11 +323,11 @@ static int smc_rx_recv_urg(struct smc_sock *smc, struct msghdr *msg, int len,
|
|
return -EAGAIN;
|
|
}
|
|
|
|
-static bool smc_rx_recvmsg_data_available(struct smc_sock *smc)
|
|
+static bool smc_rx_recvmsg_data_available(struct smc_sock *smc, size_t peeked)
|
|
{
|
|
struct smc_connection *conn = &smc->conn;
|
|
|
|
- if (smc_rx_data_available(conn))
|
|
+ if (smc_rx_data_available(conn, peeked))
|
|
return true;
|
|
else if (conn->urg_state == SMC_URG_VALID)
|
|
/* we received a single urgent Byte - skip */
|
|
@@ -344,10 +345,10 @@ static bool smc_rx_recvmsg_data_available(struct smc_sock *smc)
|
|
int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
|
|
struct pipe_inode_info *pipe, size_t len, int flags)
|
|
{
|
|
- size_t copylen, read_done = 0, read_remaining = len;
|
|
+ size_t copylen, read_done = 0, read_remaining = len, peeked_bytes = 0;
|
|
size_t chunk_len, chunk_off, chunk_len_sum;
|
|
struct smc_connection *conn = &smc->conn;
|
|
- int (*func)(struct smc_connection *conn);
|
|
+ int (*func)(struct smc_connection *conn, size_t baseline);
|
|
union smc_host_cursor cons;
|
|
int readable, chunk;
|
|
char *rcvbuf_base;
|
|
@@ -384,14 +385,14 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
|
|
if (conn->killed)
|
|
break;
|
|
|
|
- if (smc_rx_recvmsg_data_available(smc))
|
|
+ if (smc_rx_recvmsg_data_available(smc, peeked_bytes))
|
|
goto copy;
|
|
|
|
if (sk->sk_shutdown & RCV_SHUTDOWN) {
|
|
/* smc_cdc_msg_recv_action() could have run after
|
|
* above smc_rx_recvmsg_data_available()
|
|
*/
|
|
- if (smc_rx_recvmsg_data_available(smc))
|
|
+ if (smc_rx_recvmsg_data_available(smc, peeked_bytes))
|
|
goto copy;
|
|
break;
|
|
}
|
|
@@ -425,26 +426,28 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
|
|
}
|
|
}
|
|
|
|
- if (!smc_rx_data_available(conn)) {
|
|
- smc_rx_wait(smc, &timeo, smc_rx_data_available);
|
|
+ if (!smc_rx_data_available(conn, peeked_bytes)) {
|
|
+ smc_rx_wait(smc, &timeo, peeked_bytes, smc_rx_data_available);
|
|
continue;
|
|
}
|
|
|
|
copy:
|
|
/* initialize variables for 1st iteration of subsequent loop */
|
|
/* could be just 1 byte, even after waiting on data above */
|
|
- readable = atomic_read(&conn->bytes_to_rcv);
|
|
+ readable = smc_rx_data_available(conn, peeked_bytes);
|
|
splbytes = atomic_read(&conn->splice_pending);
|
|
if (!readable || (msg && splbytes)) {
|
|
if (splbytes)
|
|
func = smc_rx_data_available_and_no_splice_pend;
|
|
else
|
|
func = smc_rx_data_available;
|
|
- smc_rx_wait(smc, &timeo, func);
|
|
+ smc_rx_wait(smc, &timeo, peeked_bytes, func);
|
|
continue;
|
|
}
|
|
|
|
smc_curs_copy(&cons, &conn->local_tx_ctrl.cons, conn);
|
|
+ if ((flags & MSG_PEEK) && peeked_bytes)
|
|
+ smc_curs_add(conn->rmb_desc->len, &cons, peeked_bytes);
|
|
/* subsequent splice() calls pick up where previous left */
|
|
if (splbytes)
|
|
smc_curs_add(conn->rmb_desc->len, &cons, splbytes);
|
|
@@ -480,6 +483,8 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
|
|
}
|
|
read_remaining -= chunk_len;
|
|
read_done += chunk_len;
|
|
+ if (flags & MSG_PEEK)
|
|
+ peeked_bytes += chunk_len;
|
|
|
|
if (chunk_len_sum == copylen)
|
|
break; /* either on 1st or 2nd iteration */
|
|
diff --git a/net/smc/smc_rx.h b/net/smc/smc_rx.h
|
|
index db823c97d824ea..994f5e42d1ba26 100644
|
|
--- a/net/smc/smc_rx.h
|
|
+++ b/net/smc/smc_rx.h
|
|
@@ -21,11 +21,11 @@ void smc_rx_init(struct smc_sock *smc);
|
|
|
|
int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
|
|
struct pipe_inode_info *pipe, size_t len, int flags);
|
|
-int smc_rx_wait(struct smc_sock *smc, long *timeo,
|
|
- int (*fcrit)(struct smc_connection *conn));
|
|
-static inline int smc_rx_data_available(struct smc_connection *conn)
|
|
+int smc_rx_wait(struct smc_sock *smc, long *timeo, size_t peeked,
|
|
+ int (*fcrit)(struct smc_connection *conn, size_t baseline));
|
|
+static inline int smc_rx_data_available(struct smc_connection *conn, size_t peeked)
|
|
{
|
|
- return atomic_read(&conn->bytes_to_rcv);
|
|
+ return atomic_read(&conn->bytes_to_rcv) - peeked;
|
|
}
|
|
|
|
#endif /* SMC_RX_H */
|
|
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
|
|
index 83996eea100626..8d760f8fc4b5a6 100644
|
|
--- a/net/sunrpc/svcsock.c
|
|
+++ b/net/sunrpc/svcsock.c
|
|
@@ -1093,9 +1093,6 @@ static void svc_tcp_fragment_received(struct svc_sock *svsk)
|
|
/* If we have more data, signal svc_xprt_enqueue() to try again */
|
|
svsk->sk_tcplen = 0;
|
|
svsk->sk_marker = xdr_zero;
|
|
-
|
|
- smp_wmb();
|
|
- tcp_set_rcvlowat(svsk->sk_sk, 1);
|
|
}
|
|
|
|
/**
|
|
@@ -1185,17 +1182,10 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
|
|
goto err_delete;
|
|
if (len == want)
|
|
svc_tcp_fragment_received(svsk);
|
|
- else {
|
|
- /* Avoid more ->sk_data_ready() calls until the rest
|
|
- * of the message has arrived. This reduces service
|
|
- * thread wake-ups on large incoming messages. */
|
|
- tcp_set_rcvlowat(svsk->sk_sk,
|
|
- svc_sock_reclen(svsk) - svsk->sk_tcplen);
|
|
-
|
|
+ else
|
|
trace_svcsock_tcp_recv_short(&svsk->sk_xprt,
|
|
svc_sock_reclen(svsk),
|
|
svsk->sk_tcplen - sizeof(rpc_fraghdr));
|
|
- }
|
|
goto err_noclose;
|
|
error:
|
|
if (len != -EAGAIN)
|
|
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
|
|
index 2050d888df2ae1..f4dbf5f87962d9 100644
|
|
--- a/net/vmw_vsock/af_vsock.c
|
|
+++ b/net/vmw_vsock/af_vsock.c
|
|
@@ -1453,6 +1453,11 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr,
|
|
if (err < 0)
|
|
goto out;
|
|
|
|
+ /* sk_err might have been set as a result of an earlier
|
|
+ * (failed) connect attempt.
|
|
+ */
|
|
+ sk->sk_err = 0;
|
|
+
|
|
/* Mark sock as connecting and set the error code to in
|
|
* progress in case this is a non-blocking connect.
|
|
*/
|
|
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
|
|
index 4fc6279750ea15..ce622a287abc6b 100644
|
|
--- a/net/wireless/scan.c
|
|
+++ b/net/wireless/scan.c
|
|
@@ -831,10 +831,45 @@ static int cfg80211_scan_6ghz(struct cfg80211_registered_device *rdev)
|
|
list_for_each_entry(intbss, &rdev->bss_list, list) {
|
|
struct cfg80211_bss *res = &intbss->pub;
|
|
const struct cfg80211_bss_ies *ies;
|
|
+ const struct element *ssid_elem;
|
|
+ struct cfg80211_colocated_ap *entry;
|
|
+ u32 s_ssid_tmp;
|
|
+ int ret;
|
|
|
|
ies = rcu_access_pointer(res->ies);
|
|
count += cfg80211_parse_colocated_ap(ies,
|
|
&coloc_ap_list);
|
|
+
|
|
+ /* In case the scan request specified a specific BSSID
|
|
+ * and the BSS is found and operating on 6GHz band then
|
|
+ * add this AP to the collocated APs list.
|
|
+ * This is relevant for ML probe requests when the lower
|
|
+ * band APs have not been discovered.
|
|
+ */
|
|
+ if (is_broadcast_ether_addr(rdev_req->bssid) ||
|
|
+ !ether_addr_equal(rdev_req->bssid, res->bssid) ||
|
|
+ res->channel->band != NL80211_BAND_6GHZ)
|
|
+ continue;
|
|
+
|
|
+ ret = cfg80211_calc_short_ssid(ies, &ssid_elem,
|
|
+ &s_ssid_tmp);
|
|
+ if (ret)
|
|
+ continue;
|
|
+
|
|
+ entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
|
|
+ if (!entry)
|
|
+ continue;
|
|
+
|
|
+ memcpy(entry->bssid, res->bssid, ETH_ALEN);
|
|
+ entry->short_ssid = s_ssid_tmp;
|
|
+ memcpy(entry->ssid, ssid_elem->data,
|
|
+ ssid_elem->datalen);
|
|
+ entry->ssid_len = ssid_elem->datalen;
|
|
+ entry->short_ssid_valid = true;
|
|
+ entry->center_freq = res->channel->center_freq;
|
|
+
|
|
+ list_add_tail(&entry->list, &coloc_ap_list);
|
|
+ count++;
|
|
}
|
|
spin_unlock_bh(&rdev->bss_lock);
|
|
}
|
|
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c
|
|
index ce56d659c55a69..7f52bb2e14c13a 100644
|
|
--- a/net/xfrm/xfrm_replay.c
|
|
+++ b/net/xfrm/xfrm_replay.c
|
|
@@ -714,10 +714,12 @@ static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff
|
|
oseq += skb_shinfo(skb)->gso_segs;
|
|
}
|
|
|
|
- if (unlikely(xo->seq.low < replay_esn->oseq)) {
|
|
- XFRM_SKB_CB(skb)->seq.output.hi = ++oseq_hi;
|
|
- xo->seq.hi = oseq_hi;
|
|
- replay_esn->oseq_hi = oseq_hi;
|
|
+ if (unlikely(oseq < replay_esn->oseq)) {
|
|
+ replay_esn->oseq_hi = ++oseq_hi;
|
|
+ if (xo->seq.low < replay_esn->oseq) {
|
|
+ XFRM_SKB_CB(skb)->seq.output.hi = oseq_hi;
|
|
+ xo->seq.hi = oseq_hi;
|
|
+ }
|
|
if (replay_esn->oseq_hi == 0) {
|
|
replay_esn->oseq--;
|
|
replay_esn->oseq_hi--;
|
|
diff --git a/samples/landlock/sandboxer.c b/samples/landlock/sandboxer.c
|
|
index e2056c8b902c55..be4fec95c46010 100644
|
|
--- a/samples/landlock/sandboxer.c
|
|
+++ b/samples/landlock/sandboxer.c
|
|
@@ -65,6 +65,9 @@ static int parse_path(char *env_path, const char ***const path_list)
|
|
}
|
|
}
|
|
*path_list = malloc(num_paths * sizeof(**path_list));
|
|
+ if (!*path_list)
|
|
+ return -1;
|
|
+
|
|
for (i = 0; i < num_paths; i++)
|
|
(*path_list)[i] = strsep(&env_path, ENV_PATH_TOKEN);
|
|
|
|
@@ -100,6 +103,10 @@ static int populate_ruleset(const char *const env_var, const int ruleset_fd,
|
|
env_path_name = strdup(env_path_name);
|
|
unsetenv(env_var);
|
|
num_paths = parse_path(env_path_name, &path_list);
|
|
+ if (num_paths < 0) {
|
|
+ fprintf(stderr, "Failed to allocate memory\n");
|
|
+ goto out_free_name;
|
|
+ }
|
|
if (num_paths == 1 && path_list[0][0] == '\0') {
|
|
/*
|
|
* Allows to not use all possible restrictions (e.g. use
|
|
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
|
|
index e702552fb131af..44f20b1b853a50 100644
|
|
--- a/scripts/Makefile.lib
|
|
+++ b/scripts/Makefile.lib
|
|
@@ -472,10 +472,10 @@ quiet_cmd_lzo_with_size = LZO $@
|
|
cmd_lzo_with_size = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@
|
|
|
|
quiet_cmd_lz4 = LZ4 $@
|
|
- cmd_lz4 = cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout > $@
|
|
+ cmd_lz4 = cat $(real-prereqs) | $(LZ4) -l -9 - - > $@
|
|
|
|
quiet_cmd_lz4_with_size = LZ4 $@
|
|
- cmd_lz4_with_size = { cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout; \
|
|
+ cmd_lz4_with_size = { cat $(real-prereqs) | $(LZ4) -l -9 - -; \
|
|
$(size_append); } > $@
|
|
|
|
# U-Boot mkimage
|
|
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
|
|
index f5dfdb9d80e9d5..6b0eb3898e4ec7 100644
|
|
--- a/scripts/genksyms/genksyms.c
|
|
+++ b/scripts/genksyms/genksyms.c
|
|
@@ -241,6 +241,7 @@ static struct symbol *__add_symbol(const char *name, enum symbol_type type,
|
|
"unchanged\n");
|
|
}
|
|
sym->is_declared = 1;
|
|
+ free_list(defn, NULL);
|
|
return sym;
|
|
} else if (!sym->is_declared) {
|
|
if (sym->is_override && flag_preserve) {
|
|
@@ -249,6 +250,7 @@ static struct symbol *__add_symbol(const char *name, enum symbol_type type,
|
|
print_type_name(type, name);
|
|
fprintf(stderr, " modversion change\n");
|
|
sym->is_declared = 1;
|
|
+ free_list(defn, NULL);
|
|
return sym;
|
|
} else {
|
|
status = is_unknown_symbol(sym) ?
|
|
@@ -256,6 +258,7 @@ static struct symbol *__add_symbol(const char *name, enum symbol_type type,
|
|
}
|
|
} else {
|
|
error_with_pos("redefinition of %s", name);
|
|
+ free_list(defn, NULL);
|
|
return sym;
|
|
}
|
|
break;
|
|
@@ -271,11 +274,15 @@ static struct symbol *__add_symbol(const char *name, enum symbol_type type,
|
|
break;
|
|
}
|
|
}
|
|
+
|
|
+ free_list(sym->defn, NULL);
|
|
+ free(sym->name);
|
|
+ free(sym);
|
|
--nsyms;
|
|
}
|
|
|
|
sym = xmalloc(sizeof(*sym));
|
|
- sym->name = name;
|
|
+ sym->name = xstrdup(name);
|
|
sym->type = type;
|
|
sym->defn = defn;
|
|
sym->expansion_trail = NULL;
|
|
@@ -482,7 +489,7 @@ static void read_reference(FILE *f)
|
|
defn = def;
|
|
def = read_node(f);
|
|
}
|
|
- subsym = add_reference_symbol(xstrdup(sym->string), sym->tag,
|
|
+ subsym = add_reference_symbol(sym->string, sym->tag,
|
|
defn, is_extern);
|
|
subsym->is_override = is_override;
|
|
free_node(sym);
|
|
diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h
|
|
index 21ed2ec2d98ca8..5621533dcb8e43 100644
|
|
--- a/scripts/genksyms/genksyms.h
|
|
+++ b/scripts/genksyms/genksyms.h
|
|
@@ -32,7 +32,7 @@ struct string_list {
|
|
|
|
struct symbol {
|
|
struct symbol *hash_next;
|
|
- const char *name;
|
|
+ char *name;
|
|
enum symbol_type type;
|
|
struct string_list *defn;
|
|
struct symbol *expansion_trail;
|
|
diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
|
|
index 8e9b5e69e8f01d..689cb6bb40b657 100644
|
|
--- a/scripts/genksyms/parse.y
|
|
+++ b/scripts/genksyms/parse.y
|
|
@@ -152,14 +152,19 @@ simple_declaration:
|
|
;
|
|
|
|
init_declarator_list_opt:
|
|
- /* empty */ { $$ = NULL; }
|
|
- | init_declarator_list
|
|
+ /* empty */ { $$ = NULL; }
|
|
+ | init_declarator_list { free_list(decl_spec, NULL); $$ = $1; }
|
|
;
|
|
|
|
init_declarator_list:
|
|
init_declarator
|
|
{ struct string_list *decl = *$1;
|
|
*$1 = NULL;
|
|
+
|
|
+ /* avoid sharing among multiple init_declarators */
|
|
+ if (decl_spec)
|
|
+ decl_spec = copy_list_range(decl_spec, NULL);
|
|
+
|
|
add_symbol(current_name,
|
|
is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
|
|
current_name = NULL;
|
|
@@ -170,6 +175,11 @@ init_declarator_list:
|
|
*$3 = NULL;
|
|
free_list(*$2, NULL);
|
|
*$2 = decl_spec;
|
|
+
|
|
+ /* avoid sharing among multiple init_declarators */
|
|
+ if (decl_spec)
|
|
+ decl_spec = copy_list_range(decl_spec, NULL);
|
|
+
|
|
add_symbol(current_name,
|
|
is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
|
|
current_name = NULL;
|
|
@@ -472,12 +482,12 @@ enumerator_list:
|
|
enumerator:
|
|
IDENT
|
|
{
|
|
- const char *name = strdup((*$1)->string);
|
|
+ const char *name = (*$1)->string;
|
|
add_symbol(name, SYM_ENUM_CONST, NULL, 0);
|
|
}
|
|
| IDENT '=' EXPRESSION_PHRASE
|
|
{
|
|
- const char *name = strdup((*$1)->string);
|
|
+ const char *name = (*$1)->string;
|
|
struct string_list *expr = copy_list_range(*$3, *$2);
|
|
add_symbol(name, SYM_ENUM_CONST, expr, 0);
|
|
}
|
|
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
|
|
index 33d19e419908b8..662a5e7c37c285 100644
|
|
--- a/scripts/kconfig/conf.c
|
|
+++ b/scripts/kconfig/conf.c
|
|
@@ -827,6 +827,9 @@ int main(int ac, char **av)
|
|
break;
|
|
}
|
|
|
|
+ if (conf_errors())
|
|
+ exit(1);
|
|
+
|
|
if (sync_kconfig) {
|
|
name = getenv("KCONFIG_NOSILENTUPDATE");
|
|
if (name && *name) {
|
|
@@ -890,6 +893,9 @@ int main(int ac, char **av)
|
|
break;
|
|
}
|
|
|
|
+ if (sym_dep_errors())
|
|
+ exit(1);
|
|
+
|
|
if (input_mode == savedefconfig) {
|
|
if (conf_write_defconfig(defconfig_file)) {
|
|
fprintf(stderr, "n*** Error while saving defconfig to: %s\n\n",
|
|
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
|
|
index 4a6811d77d1829..f214e8d3762e0a 100644
|
|
--- a/scripts/kconfig/confdata.c
|
|
+++ b/scripts/kconfig/confdata.c
|
|
@@ -155,6 +155,13 @@ static void conf_message(const char *fmt, ...)
|
|
static const char *conf_filename;
|
|
static int conf_lineno, conf_warnings;
|
|
|
|
+bool conf_errors(void)
|
|
+{
|
|
+ if (conf_warnings)
|
|
+ return getenv("KCONFIG_WERROR");
|
|
+ return false;
|
|
+}
|
|
+
|
|
static void conf_warning(const char *fmt, ...)
|
|
{
|
|
va_list ap;
|
|
@@ -346,14 +353,12 @@ int conf_read_simple(const char *name, int def)
|
|
FILE *in = NULL;
|
|
char *line = NULL;
|
|
size_t line_asize = 0;
|
|
- char *p, *p2;
|
|
+ char *p, *p2, *val;
|
|
struct symbol *sym;
|
|
int i, def_flags;
|
|
- const char *warn_unknown;
|
|
- const char *werror;
|
|
+ const char *warn_unknown, *sym_name;
|
|
|
|
warn_unknown = getenv("KCONFIG_WARN_UNKNOWN_SYMBOLS");
|
|
- werror = getenv("KCONFIG_WERROR");
|
|
if (name) {
|
|
in = zconf_fopen(name);
|
|
} else {
|
|
@@ -386,10 +391,12 @@ int conf_read_simple(const char *name, int def)
|
|
|
|
*p = '\0';
|
|
|
|
- in = zconf_fopen(env);
|
|
+ name = env;
|
|
+
|
|
+ in = zconf_fopen(name);
|
|
if (in) {
|
|
conf_message("using defaults found in %s",
|
|
- env);
|
|
+ name);
|
|
goto load;
|
|
}
|
|
|
|
@@ -428,80 +435,34 @@ int conf_read_simple(const char *name, int def)
|
|
|
|
while (compat_getline(&line, &line_asize, in) != -1) {
|
|
conf_lineno++;
|
|
- sym = NULL;
|
|
if (line[0] == '#') {
|
|
- if (memcmp(line + 2, CONFIG_, strlen(CONFIG_)))
|
|
+ if (line[1] != ' ')
|
|
+ continue;
|
|
+ p = line + 2;
|
|
+ if (memcmp(p, CONFIG_, strlen(CONFIG_)))
|
|
continue;
|
|
- p = strchr(line + 2 + strlen(CONFIG_), ' ');
|
|
+ sym_name = p + strlen(CONFIG_);
|
|
+ p = strchr(sym_name, ' ');
|
|
if (!p)
|
|
continue;
|
|
*p++ = 0;
|
|
if (strncmp(p, "is not set", 10))
|
|
continue;
|
|
- if (def == S_DEF_USER) {
|
|
- sym = sym_find(line + 2 + strlen(CONFIG_));
|
|
- if (!sym) {
|
|
- if (warn_unknown)
|
|
- conf_warning("unknown symbol: %s",
|
|
- line + 2 + strlen(CONFIG_));
|
|
-
|
|
- conf_set_changed(true);
|
|
- continue;
|
|
- }
|
|
- } else {
|
|
- sym = sym_lookup(line + 2 + strlen(CONFIG_), 0);
|
|
- if (sym->type == S_UNKNOWN)
|
|
- sym->type = S_BOOLEAN;
|
|
- }
|
|
- if (sym->flags & def_flags) {
|
|
- conf_warning("override: reassigning to symbol %s", sym->name);
|
|
- }
|
|
- switch (sym->type) {
|
|
- case S_BOOLEAN:
|
|
- case S_TRISTATE:
|
|
- sym->def[def].tri = no;
|
|
- sym->flags |= def_flags;
|
|
- break;
|
|
- default:
|
|
- ;
|
|
- }
|
|
+
|
|
+ val = "n";
|
|
} else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) {
|
|
- p = strchr(line + strlen(CONFIG_), '=');
|
|
+ sym_name = line + strlen(CONFIG_);
|
|
+ p = strchr(sym_name, '=');
|
|
if (!p)
|
|
continue;
|
|
*p++ = 0;
|
|
+ val = p;
|
|
p2 = strchr(p, '\n');
|
|
if (p2) {
|
|
*p2-- = 0;
|
|
if (*p2 == '\r')
|
|
*p2 = 0;
|
|
}
|
|
-
|
|
- sym = sym_find(line + strlen(CONFIG_));
|
|
- if (!sym) {
|
|
- if (def == S_DEF_AUTO) {
|
|
- /*
|
|
- * Reading from include/config/auto.conf
|
|
- * If CONFIG_FOO previously existed in
|
|
- * auto.conf but it is missing now,
|
|
- * include/config/FOO must be touched.
|
|
- */
|
|
- conf_touch_dep(line + strlen(CONFIG_));
|
|
- } else {
|
|
- if (warn_unknown)
|
|
- conf_warning("unknown symbol: %s",
|
|
- line + strlen(CONFIG_));
|
|
-
|
|
- conf_set_changed(true);
|
|
- }
|
|
- continue;
|
|
- }
|
|
-
|
|
- if (sym->flags & def_flags) {
|
|
- conf_warning("override: reassigning to symbol %s", sym->name);
|
|
- }
|
|
- if (conf_set_sym_val(sym, def, def_flags, p))
|
|
- continue;
|
|
} else {
|
|
if (line[0] != '\r' && line[0] != '\n')
|
|
conf_warning("unexpected data: %.*s",
|
|
@@ -510,6 +471,31 @@ int conf_read_simple(const char *name, int def)
|
|
continue;
|
|
}
|
|
|
|
+ sym = sym_find(sym_name);
|
|
+ if (!sym) {
|
|
+ if (def == S_DEF_AUTO) {
|
|
+ /*
|
|
+ * Reading from include/config/auto.conf.
|
|
+ * If CONFIG_FOO previously existed in auto.conf
|
|
+ * but it is missing now, include/config/FOO
|
|
+ * must be touched.
|
|
+ */
|
|
+ conf_touch_dep(sym_name);
|
|
+ } else {
|
|
+ if (warn_unknown)
|
|
+ conf_warning("unknown symbol: %s", sym_name);
|
|
+
|
|
+ conf_set_changed(true);
|
|
+ }
|
|
+ continue;
|
|
+ }
|
|
+
|
|
+ if (sym->flags & def_flags)
|
|
+ conf_warning("override: reassigning to symbol %s", sym->name);
|
|
+
|
|
+ if (conf_set_sym_val(sym, def, def_flags, val))
|
|
+ continue;
|
|
+
|
|
if (sym && sym_is_choice_value(sym)) {
|
|
struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
|
|
switch (sym->def[def].tri) {
|
|
@@ -533,9 +519,6 @@ int conf_read_simple(const char *name, int def)
|
|
free(line);
|
|
fclose(in);
|
|
|
|
- if (conf_warnings && werror)
|
|
- exit(1);
|
|
-
|
|
return 0;
|
|
}
|
|
|
|
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
|
|
index edd1e617b25c5c..e4931bde7ca765 100644
|
|
--- a/scripts/kconfig/lkc_proto.h
|
|
+++ b/scripts/kconfig/lkc_proto.h
|
|
@@ -12,6 +12,7 @@ void conf_set_changed(bool val);
|
|
bool conf_get_changed(void);
|
|
void conf_set_changed_callback(void (*fn)(void));
|
|
void conf_set_message_callback(void (*fn)(const char *s));
|
|
+bool conf_errors(void);
|
|
|
|
/* symbol.c */
|
|
extern struct symbol * symbol_hash[SYMBOL_HASHSIZE];
|
|
@@ -22,6 +23,7 @@ void print_symbol_for_listconfig(struct symbol *sym);
|
|
struct symbol ** sym_re_search(const char *pattern);
|
|
const char * sym_type_name(enum symbol_type type);
|
|
void sym_calc_value(struct symbol *sym);
|
|
+bool sym_dep_errors(void);
|
|
enum symbol_type sym_get_type(struct symbol *sym);
|
|
bool sym_tristate_within_range(struct symbol *sym,tristate tri);
|
|
bool sym_set_tristate_value(struct symbol *sym,tristate tri);
|
|
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
|
|
index 7b1df55b017679..1c0306c9d74e2e 100644
|
|
--- a/scripts/kconfig/symbol.c
|
|
+++ b/scripts/kconfig/symbol.c
|
|
@@ -40,6 +40,7 @@ static struct symbol symbol_empty = {
|
|
|
|
struct symbol *modules_sym;
|
|
static tristate modules_val;
|
|
+static int sym_warnings;
|
|
|
|
enum symbol_type sym_get_type(struct symbol *sym)
|
|
{
|
|
@@ -320,6 +321,15 @@ static void sym_warn_unmet_dep(struct symbol *sym)
|
|
" Selected by [m]:\n");
|
|
|
|
fputs(str_get(&gs), stderr);
|
|
+ str_free(&gs);
|
|
+ sym_warnings++;
|
|
+}
|
|
+
|
|
+bool sym_dep_errors(void)
|
|
+{
|
|
+ if (sym_warnings)
|
|
+ return getenv("KCONFIG_WERROR");
|
|
+ return false;
|
|
}
|
|
|
|
void sym_calc_value(struct symbol *sym)
|
|
diff --git a/security/landlock/fs.c b/security/landlock/fs.c
|
|
index 1bdd049e3d636a..fe4622d88eb15e 100644
|
|
--- a/security/landlock/fs.c
|
|
+++ b/security/landlock/fs.c
|
|
@@ -664,10 +664,6 @@ static inline access_mask_t get_mode_access(const umode_t mode)
|
|
switch (mode & S_IFMT) {
|
|
case S_IFLNK:
|
|
return LANDLOCK_ACCESS_FS_MAKE_SYM;
|
|
- case 0:
|
|
- /* A zero mode translates to S_IFREG. */
|
|
- case S_IFREG:
|
|
- return LANDLOCK_ACCESS_FS_MAKE_REG;
|
|
case S_IFDIR:
|
|
return LANDLOCK_ACCESS_FS_MAKE_DIR;
|
|
case S_IFCHR:
|
|
@@ -678,9 +674,12 @@ static inline access_mask_t get_mode_access(const umode_t mode)
|
|
return LANDLOCK_ACCESS_FS_MAKE_FIFO;
|
|
case S_IFSOCK:
|
|
return LANDLOCK_ACCESS_FS_MAKE_SOCK;
|
|
+ case S_IFREG:
|
|
+ case 0:
|
|
+ /* A zero mode translates to S_IFREG. */
|
|
default:
|
|
- WARN_ON_ONCE(1);
|
|
- return 0;
|
|
+ /* Treats weird files as regular files. */
|
|
+ return LANDLOCK_ACCESS_FS_MAKE_REG;
|
|
}
|
|
}
|
|
|
|
diff --git a/sound/core/seq/Kconfig b/sound/core/seq/Kconfig
|
|
index c14981daf9432f..e4f58cb985d47c 100644
|
|
--- a/sound/core/seq/Kconfig
|
|
+++ b/sound/core/seq/Kconfig
|
|
@@ -62,7 +62,7 @@ config SND_SEQ_VIRMIDI
|
|
|
|
config SND_SEQ_UMP
|
|
bool "Support for UMP events"
|
|
- default y if SND_SEQ_UMP_CLIENT
|
|
+ default SND_UMP
|
|
help
|
|
Say Y here to enable the support for handling UMP (Universal MIDI
|
|
Packet) events via ALSA sequencer infrastructure, which is an
|
|
@@ -71,7 +71,6 @@ config SND_SEQ_UMP
|
|
among legacy and UMP clients.
|
|
|
|
config SND_SEQ_UMP_CLIENT
|
|
- tristate
|
|
- def_tristate SND_UMP
|
|
+ def_tristate SND_UMP && SND_SEQ_UMP
|
|
|
|
endif # SND_SEQUENCER
|
|
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
|
|
index 739f8fd1792bd5..0b679fd1b82ab9 100644
|
|
--- a/sound/pci/hda/patch_realtek.c
|
|
+++ b/sound/pci/hda/patch_realtek.c
|
|
@@ -9726,6 +9726,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|
SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
|
|
SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
|
|
SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
|
|
+ SND_PCI_QUIRK(0x1025, 0x1360, "Acer Aspire A115", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
|
|
SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
|
|
SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
|
|
SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
|
|
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
|
|
index 7434aeeda292ec..402b9a2ff02406 100644
|
|
--- a/sound/soc/codecs/arizona.c
|
|
+++ b/sound/soc/codecs/arizona.c
|
|
@@ -2786,15 +2786,13 @@ int arizona_of_get_audio_pdata(struct arizona *arizona)
|
|
{
|
|
struct arizona_pdata *pdata = &arizona->pdata;
|
|
struct device_node *np = arizona->dev->of_node;
|
|
- struct property *prop;
|
|
- const __be32 *cur;
|
|
u32 val;
|
|
u32 pdm_val[ARIZONA_MAX_PDM_SPK];
|
|
int ret;
|
|
int count = 0;
|
|
|
|
count = 0;
|
|
- of_property_for_each_u32(np, "wlf,inmode", prop, cur, val) {
|
|
+ of_property_for_each_u32(np, "wlf,inmode", val) {
|
|
if (count == ARRAY_SIZE(pdata->inmode))
|
|
break;
|
|
|
|
@@ -2803,7 +2801,7 @@ int arizona_of_get_audio_pdata(struct arizona *arizona)
|
|
}
|
|
|
|
count = 0;
|
|
- of_property_for_each_u32(np, "wlf,dmic-ref", prop, cur, val) {
|
|
+ of_property_for_each_u32(np, "wlf,dmic-ref", val) {
|
|
if (count == ARRAY_SIZE(pdata->dmic_ref))
|
|
break;
|
|
|
|
@@ -2812,7 +2810,7 @@ int arizona_of_get_audio_pdata(struct arizona *arizona)
|
|
}
|
|
|
|
count = 0;
|
|
- of_property_for_each_u32(np, "wlf,out-mono", prop, cur, val) {
|
|
+ of_property_for_each_u32(np, "wlf,out-mono", val) {
|
|
if (count == ARRAY_SIZE(pdata->out_mono))
|
|
break;
|
|
|
|
@@ -2821,7 +2819,7 @@ int arizona_of_get_audio_pdata(struct arizona *arizona)
|
|
}
|
|
|
|
count = 0;
|
|
- of_property_for_each_u32(np, "wlf,max-channels-clocked", prop, cur, val) {
|
|
+ of_property_for_each_u32(np, "wlf,max-channels-clocked", val) {
|
|
if (count == ARRAY_SIZE(pdata->max_channels_clocked))
|
|
break;
|
|
|
|
@@ -2830,7 +2828,7 @@ int arizona_of_get_audio_pdata(struct arizona *arizona)
|
|
}
|
|
|
|
count = 0;
|
|
- of_property_for_each_u32(np, "wlf,out-volume-limit", prop, cur, val) {
|
|
+ of_property_for_each_u32(np, "wlf,out-volume-limit", val) {
|
|
if (count == ARRAY_SIZE(pdata->out_vol_limit))
|
|
break;
|
|
|
|
diff --git a/sound/soc/intel/avs/apl.c b/sound/soc/intel/avs/apl.c
|
|
index 1860099c782a72..25c389632db4f7 100644
|
|
--- a/sound/soc/intel/avs/apl.c
|
|
+++ b/sound/soc/intel/avs/apl.c
|
|
@@ -14,10 +14,10 @@
|
|
#include "topology.h"
|
|
|
|
static int __maybe_unused
|
|
-apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
|
|
- u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
|
|
+avs_apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
|
|
+ u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
|
|
{
|
|
- struct apl_log_state_info *info;
|
|
+ struct avs_apl_log_state_info *info;
|
|
u32 size, num_cores = adev->hw_cfg.dsp_cores;
|
|
int ret, i;
|
|
|
|
@@ -48,9 +48,9 @@ apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_peri
|
|
return 0;
|
|
}
|
|
|
|
-static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
+static int avs_apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
{
|
|
- struct apl_log_buffer_layout layout;
|
|
+ struct avs_apl_log_buffer_layout layout;
|
|
void __iomem *addr, *buf;
|
|
|
|
addr = avs_log_buffer_addr(adev, msg->log.core);
|
|
@@ -63,11 +63,11 @@ static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg
|
|
/* consume the logs regardless of consumer presence */
|
|
goto update_read_ptr;
|
|
|
|
- buf = apl_log_payload_addr(addr);
|
|
+ buf = avs_apl_log_payload_addr(addr);
|
|
|
|
if (layout.read_ptr > layout.write_ptr) {
|
|
avs_dump_fw_log(adev, buf + layout.read_ptr,
|
|
- apl_log_payload_size(adev) - layout.read_ptr);
|
|
+ avs_apl_log_payload_size(adev) - layout.read_ptr);
|
|
layout.read_ptr = 0;
|
|
}
|
|
avs_dump_fw_log_wakeup(adev, buf + layout.read_ptr, layout.write_ptr - layout.read_ptr);
|
|
@@ -77,7 +77,8 @@ static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg
|
|
return 0;
|
|
}
|
|
|
|
-static int apl_wait_log_entry(struct avs_dev *adev, u32 core, struct apl_log_buffer_layout *layout)
|
|
+static int avs_apl_wait_log_entry(struct avs_dev *adev, u32 core,
|
|
+ struct avs_apl_log_buffer_layout *layout)
|
|
{
|
|
unsigned long timeout;
|
|
void __iomem *addr;
|
|
@@ -99,14 +100,14 @@ static int apl_wait_log_entry(struct avs_dev *adev, u32 core, struct apl_log_buf
|
|
}
|
|
|
|
/* reads log header and tests its type */
|
|
-#define apl_is_entry_stackdump(addr) ((readl(addr) >> 30) & 0x1)
|
|
+#define avs_apl_is_entry_stackdump(addr) ((readl(addr) >> 30) & 0x1)
|
|
|
|
-static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
+static int avs_apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
{
|
|
- struct apl_log_buffer_layout layout;
|
|
+ struct avs_apl_log_buffer_layout layout;
|
|
void __iomem *addr, *buf;
|
|
size_t dump_size;
|
|
- u16 offset = 0;
|
|
+ u32 offset = 0;
|
|
u8 *dump, *pos;
|
|
|
|
dump_size = AVS_FW_REGS_SIZE + msg->ext.coredump.stack_dump_size;
|
|
@@ -124,9 +125,9 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
if (!addr)
|
|
goto exit;
|
|
|
|
- buf = apl_log_payload_addr(addr);
|
|
+ buf = avs_apl_log_payload_addr(addr);
|
|
memcpy_fromio(&layout, addr, sizeof(layout));
|
|
- if (!apl_is_entry_stackdump(buf + layout.read_ptr)) {
|
|
+ if (!avs_apl_is_entry_stackdump(buf + layout.read_ptr)) {
|
|
union avs_notify_msg lbs_msg = AVS_NOTIFICATION(LOG_BUFFER_STATUS);
|
|
|
|
/*
|
|
@@ -142,11 +143,11 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
do {
|
|
u32 count;
|
|
|
|
- if (apl_wait_log_entry(adev, msg->ext.coredump.core_id, &layout))
|
|
+ if (avs_apl_wait_log_entry(adev, msg->ext.coredump.core_id, &layout))
|
|
break;
|
|
|
|
if (layout.read_ptr > layout.write_ptr) {
|
|
- count = apl_log_payload_size(adev) - layout.read_ptr;
|
|
+ count = avs_apl_log_payload_size(adev) - layout.read_ptr;
|
|
memcpy_fromio(pos + offset, buf + layout.read_ptr, count);
|
|
layout.read_ptr = 0;
|
|
offset += count;
|
|
@@ -165,7 +166,7 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
return 0;
|
|
}
|
|
|
|
-static bool apl_lp_streaming(struct avs_dev *adev)
|
|
+static bool avs_apl_lp_streaming(struct avs_dev *adev)
|
|
{
|
|
struct avs_path *path;
|
|
|
|
@@ -201,7 +202,7 @@ static bool apl_lp_streaming(struct avs_dev *adev)
|
|
return true;
|
|
}
|
|
|
|
-static bool apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
|
|
+static bool avs_apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
|
|
{
|
|
/* wake in all cases */
|
|
if (wake)
|
|
@@ -215,10 +216,10 @@ static bool apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool w
|
|
* Note: for cAVS 1.5+ and 1.8, D0IX is LP-firmware transition,
|
|
* not the power-gating mechanism known from cAVS 2.0.
|
|
*/
|
|
- return apl_lp_streaming(adev);
|
|
+ return avs_apl_lp_streaming(adev);
|
|
}
|
|
|
|
-static int apl_set_d0ix(struct avs_dev *adev, bool enable)
|
|
+static int avs_apl_set_d0ix(struct avs_dev *adev, bool enable)
|
|
{
|
|
bool streaming = false;
|
|
int ret;
|
|
@@ -231,7 +232,7 @@ static int apl_set_d0ix(struct avs_dev *adev, bool enable)
|
|
return AVS_IPC_RET(ret);
|
|
}
|
|
|
|
-const struct avs_dsp_ops apl_dsp_ops = {
|
|
+const struct avs_dsp_ops avs_apl_dsp_ops = {
|
|
.power = avs_dsp_core_power,
|
|
.reset = avs_dsp_core_reset,
|
|
.stall = avs_dsp_core_stall,
|
|
@@ -241,10 +242,10 @@ const struct avs_dsp_ops apl_dsp_ops = {
|
|
.load_basefw = avs_hda_load_basefw,
|
|
.load_lib = avs_hda_load_library,
|
|
.transfer_mods = avs_hda_transfer_modules,
|
|
- .log_buffer_offset = skl_log_buffer_offset,
|
|
- .log_buffer_status = apl_log_buffer_status,
|
|
- .coredump = apl_coredump,
|
|
- .d0ix_toggle = apl_d0ix_toggle,
|
|
- .set_d0ix = apl_set_d0ix,
|
|
+ .log_buffer_offset = avs_skl_log_buffer_offset,
|
|
+ .log_buffer_status = avs_apl_log_buffer_status,
|
|
+ .coredump = avs_apl_coredump,
|
|
+ .d0ix_toggle = avs_apl_d0ix_toggle,
|
|
+ .set_d0ix = avs_apl_set_d0ix,
|
|
AVS_SET_ENABLE_LOGS_OP(apl)
|
|
};
|
|
diff --git a/sound/soc/intel/avs/avs.h b/sound/soc/intel/avs/avs.h
|
|
index 0cf38c9e768e7b..1fd501a6a62d9e 100644
|
|
--- a/sound/soc/intel/avs/avs.h
|
|
+++ b/sound/soc/intel/avs/avs.h
|
|
@@ -64,8 +64,8 @@ struct avs_dsp_ops {
|
|
#define avs_dsp_op(adev, op, ...) \
|
|
((adev)->spec->dsp_ops->op(adev, ## __VA_ARGS__))
|
|
|
|
-extern const struct avs_dsp_ops skl_dsp_ops;
|
|
-extern const struct avs_dsp_ops apl_dsp_ops;
|
|
+extern const struct avs_dsp_ops avs_skl_dsp_ops;
|
|
+extern const struct avs_dsp_ops avs_apl_dsp_ops;
|
|
|
|
#define AVS_PLATATTR_CLDMA BIT_ULL(0)
|
|
#define AVS_PLATATTR_IMR BIT_ULL(1)
|
|
@@ -73,6 +73,23 @@ extern const struct avs_dsp_ops apl_dsp_ops;
|
|
#define avs_platattr_test(adev, attr) \
|
|
((adev)->spec->attributes & AVS_PLATATTR_##attr)
|
|
|
|
+struct avs_sram_spec {
|
|
+ const u32 base_offset;
|
|
+ const u32 window_size;
|
|
+ const u32 rom_status_offset;
|
|
+};
|
|
+
|
|
+struct avs_hipc_spec {
|
|
+ const u32 req_offset;
|
|
+ const u32 req_ext_offset;
|
|
+ const u32 req_busy_mask;
|
|
+ const u32 ack_offset;
|
|
+ const u32 ack_done_mask;
|
|
+ const u32 rsp_offset;
|
|
+ const u32 rsp_busy_mask;
|
|
+ const u32 ctl_offset;
|
|
+};
|
|
+
|
|
/* Platform specific descriptor */
|
|
struct avs_spec {
|
|
const char *name;
|
|
@@ -82,9 +99,8 @@ struct avs_spec {
|
|
|
|
const u32 core_init_mask; /* used during DSP boot */
|
|
const u64 attributes; /* bitmask of AVS_PLATATTR_* */
|
|
- const u32 sram_base_offset;
|
|
- const u32 sram_window_size;
|
|
- const u32 rom_status;
|
|
+ const struct avs_sram_spec *sram;
|
|
+ const struct avs_hipc_spec *hipc;
|
|
};
|
|
|
|
struct avs_fw_entry {
|
|
@@ -264,7 +280,7 @@ void avs_ipc_block(struct avs_ipc *ipc);
|
|
int avs_dsp_disable_d0ix(struct avs_dev *adev);
|
|
int avs_dsp_enable_d0ix(struct avs_dev *adev);
|
|
|
|
-int skl_log_buffer_offset(struct avs_dev *adev, u32 core);
|
|
+int avs_skl_log_buffer_offset(struct avs_dev *adev, u32 core);
|
|
|
|
/* Firmware resources management */
|
|
|
|
@@ -358,21 +374,21 @@ static inline int avs_log_buffer_status_locked(struct avs_dev *adev, union avs_n
|
|
return ret;
|
|
}
|
|
|
|
-struct apl_log_buffer_layout {
|
|
+struct avs_apl_log_buffer_layout {
|
|
u32 read_ptr;
|
|
u32 write_ptr;
|
|
u8 buffer[];
|
|
} __packed;
|
|
|
|
-#define apl_log_payload_size(adev) \
|
|
- (avs_log_buffer_size(adev) - sizeof(struct apl_log_buffer_layout))
|
|
+#define avs_apl_log_payload_size(adev) \
|
|
+ (avs_log_buffer_size(adev) - sizeof(struct avs_apl_log_buffer_layout))
|
|
|
|
-#define apl_log_payload_addr(addr) \
|
|
- (addr + sizeof(struct apl_log_buffer_layout))
|
|
+#define avs_apl_log_payload_addr(addr) \
|
|
+ (addr + sizeof(struct avs_apl_log_buffer_layout))
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
#define AVS_SET_ENABLE_LOGS_OP(name) \
|
|
- .enable_logs = name##_enable_logs
|
|
+ .enable_logs = avs_##name##_enable_logs
|
|
|
|
bool avs_logging_fw(struct avs_dev *adev);
|
|
void avs_dump_fw_log(struct avs_dev *adev, const void __iomem *src, unsigned int len);
|
|
diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c
|
|
index 859b217fc761ba..63e4356e8caf94 100644
|
|
--- a/sound/soc/intel/avs/core.c
|
|
+++ b/sound/soc/intel/avs/core.c
|
|
@@ -712,36 +712,47 @@ static const struct dev_pm_ops avs_dev_pm = {
|
|
SET_RUNTIME_PM_OPS(avs_runtime_suspend, avs_runtime_resume, NULL)
|
|
};
|
|
|
|
+static const struct avs_sram_spec skl_sram_spec = {
|
|
+ .base_offset = SKL_ADSP_SRAM_BASE_OFFSET,
|
|
+ .window_size = SKL_ADSP_SRAM_WINDOW_SIZE,
|
|
+ .rom_status_offset = SKL_ADSP_SRAM_BASE_OFFSET,
|
|
+};
|
|
+
|
|
+static const struct avs_sram_spec apl_sram_spec = {
|
|
+ .base_offset = APL_ADSP_SRAM_BASE_OFFSET,
|
|
+ .window_size = APL_ADSP_SRAM_WINDOW_SIZE,
|
|
+ .rom_status_offset = APL_ADSP_SRAM_BASE_OFFSET,
|
|
+};
|
|
+
|
|
+static const struct avs_hipc_spec skl_hipc_spec = {
|
|
+ .req_offset = SKL_ADSP_REG_HIPCI,
|
|
+ .req_ext_offset = SKL_ADSP_REG_HIPCIE,
|
|
+ .req_busy_mask = SKL_ADSP_HIPCI_BUSY,
|
|
+ .ack_offset = SKL_ADSP_REG_HIPCIE,
|
|
+ .ack_done_mask = SKL_ADSP_HIPCIE_DONE,
|
|
+ .rsp_offset = SKL_ADSP_REG_HIPCT,
|
|
+ .rsp_busy_mask = SKL_ADSP_HIPCT_BUSY,
|
|
+ .ctl_offset = SKL_ADSP_REG_HIPCCTL,
|
|
+};
|
|
+
|
|
static const struct avs_spec skl_desc = {
|
|
.name = "skl",
|
|
- .min_fw_version = {
|
|
- .major = 9,
|
|
- .minor = 21,
|
|
- .hotfix = 0,
|
|
- .build = 4732,
|
|
- },
|
|
- .dsp_ops = &skl_dsp_ops,
|
|
+ .min_fw_version = { 9, 21, 0, 4732 },
|
|
+ .dsp_ops = &avs_skl_dsp_ops,
|
|
.core_init_mask = 1,
|
|
.attributes = AVS_PLATATTR_CLDMA,
|
|
- .sram_base_offset = SKL_ADSP_SRAM_BASE_OFFSET,
|
|
- .sram_window_size = SKL_ADSP_SRAM_WINDOW_SIZE,
|
|
- .rom_status = SKL_ADSP_SRAM_BASE_OFFSET,
|
|
+ .sram = &skl_sram_spec,
|
|
+ .hipc = &skl_hipc_spec,
|
|
};
|
|
|
|
static const struct avs_spec apl_desc = {
|
|
.name = "apl",
|
|
- .min_fw_version = {
|
|
- .major = 9,
|
|
- .minor = 22,
|
|
- .hotfix = 1,
|
|
- .build = 4323,
|
|
- },
|
|
- .dsp_ops = &apl_dsp_ops,
|
|
+ .min_fw_version = { 9, 22, 1, 4323 },
|
|
+ .dsp_ops = &avs_apl_dsp_ops,
|
|
.core_init_mask = 3,
|
|
.attributes = AVS_PLATATTR_IMR,
|
|
- .sram_base_offset = APL_ADSP_SRAM_BASE_OFFSET,
|
|
- .sram_window_size = APL_ADSP_SRAM_WINDOW_SIZE,
|
|
- .rom_status = APL_ADSP_SRAM_BASE_OFFSET,
|
|
+ .sram = &apl_sram_spec,
|
|
+ .hipc = &skl_hipc_spec,
|
|
};
|
|
|
|
static const struct pci_device_id avs_ids[] = {
|
|
diff --git a/sound/soc/intel/avs/ipc.c b/sound/soc/intel/avs/ipc.c
|
|
index bdf013c3dd12e2..74f676fdfba29d 100644
|
|
--- a/sound/soc/intel/avs/ipc.c
|
|
+++ b/sound/soc/intel/avs/ipc.c
|
|
@@ -305,6 +305,7 @@ irqreturn_t avs_dsp_irq_handler(int irq, void *dev_id)
|
|
{
|
|
struct avs_dev *adev = dev_id;
|
|
struct avs_ipc *ipc = adev->ipc;
|
|
+ const struct avs_spec *const spec = adev->spec;
|
|
u32 adspis, hipc_rsp, hipc_ack;
|
|
irqreturn_t ret = IRQ_NONE;
|
|
|
|
@@ -312,35 +313,35 @@ irqreturn_t avs_dsp_irq_handler(int irq, void *dev_id)
|
|
if (adspis == UINT_MAX || !(adspis & AVS_ADSP_ADSPIS_IPC))
|
|
return ret;
|
|
|
|
- hipc_ack = snd_hdac_adsp_readl(adev, SKL_ADSP_REG_HIPCIE);
|
|
- hipc_rsp = snd_hdac_adsp_readl(adev, SKL_ADSP_REG_HIPCT);
|
|
+ hipc_ack = snd_hdac_adsp_readl(adev, spec->hipc->ack_offset);
|
|
+ hipc_rsp = snd_hdac_adsp_readl(adev, spec->hipc->rsp_offset);
|
|
|
|
/* DSP acked host's request */
|
|
- if (hipc_ack & SKL_ADSP_HIPCIE_DONE) {
|
|
+ if (hipc_ack & spec->hipc->ack_done_mask) {
|
|
/*
|
|
* As an extra precaution, mask done interrupt. Code executed
|
|
* due to complete() found below does not assume any masking.
|
|
*/
|
|
- snd_hdac_adsp_updatel(adev, SKL_ADSP_REG_HIPCCTL,
|
|
+ snd_hdac_adsp_updatel(adev, spec->hipc->ctl_offset,
|
|
AVS_ADSP_HIPCCTL_DONE, 0);
|
|
|
|
complete(&ipc->done_completion);
|
|
|
|
/* tell DSP it has our attention */
|
|
- snd_hdac_adsp_updatel(adev, SKL_ADSP_REG_HIPCIE,
|
|
- SKL_ADSP_HIPCIE_DONE,
|
|
- SKL_ADSP_HIPCIE_DONE);
|
|
+ snd_hdac_adsp_updatel(adev, spec->hipc->ack_offset,
|
|
+ spec->hipc->ack_done_mask,
|
|
+ spec->hipc->ack_done_mask);
|
|
/* unmask done interrupt */
|
|
- snd_hdac_adsp_updatel(adev, SKL_ADSP_REG_HIPCCTL,
|
|
+ snd_hdac_adsp_updatel(adev, spec->hipc->ctl_offset,
|
|
AVS_ADSP_HIPCCTL_DONE,
|
|
AVS_ADSP_HIPCCTL_DONE);
|
|
ret = IRQ_HANDLED;
|
|
}
|
|
|
|
/* DSP sent new response to process */
|
|
- if (hipc_rsp & SKL_ADSP_HIPCT_BUSY) {
|
|
+ if (hipc_rsp & spec->hipc->rsp_busy_mask) {
|
|
/* mask busy interrupt */
|
|
- snd_hdac_adsp_updatel(adev, SKL_ADSP_REG_HIPCCTL,
|
|
+ snd_hdac_adsp_updatel(adev, spec->hipc->ctl_offset,
|
|
AVS_ADSP_HIPCCTL_BUSY, 0);
|
|
|
|
ret = IRQ_WAKE_THREAD;
|
|
@@ -379,10 +380,11 @@ irqreturn_t avs_dsp_irq_thread(int irq, void *dev_id)
|
|
static bool avs_ipc_is_busy(struct avs_ipc *ipc)
|
|
{
|
|
struct avs_dev *adev = to_avs_dev(ipc->dev);
|
|
+ const struct avs_spec *const spec = adev->spec;
|
|
u32 hipc_rsp;
|
|
|
|
- hipc_rsp = snd_hdac_adsp_readl(adev, SKL_ADSP_REG_HIPCT);
|
|
- return hipc_rsp & SKL_ADSP_HIPCT_BUSY;
|
|
+ hipc_rsp = snd_hdac_adsp_readl(adev, spec->hipc->rsp_offset);
|
|
+ return hipc_rsp & spec->hipc->rsp_busy_mask;
|
|
}
|
|
|
|
static int avs_ipc_wait_busy_completion(struct avs_ipc *ipc, int timeout)
|
|
@@ -440,9 +442,10 @@ static void avs_ipc_msg_init(struct avs_ipc *ipc, struct avs_ipc_msg *reply)
|
|
|
|
static void avs_dsp_send_tx(struct avs_dev *adev, struct avs_ipc_msg *tx, bool read_fwregs)
|
|
{
|
|
+ const struct avs_spec *const spec = adev->spec;
|
|
u64 reg = ULONG_MAX;
|
|
|
|
- tx->header |= SKL_ADSP_HIPCI_BUSY;
|
|
+ tx->header |= spec->hipc->req_busy_mask;
|
|
if (read_fwregs)
|
|
reg = readq(avs_sram_addr(adev, AVS_FW_REGS_WINDOW));
|
|
|
|
@@ -450,8 +453,8 @@ static void avs_dsp_send_tx(struct avs_dev *adev, struct avs_ipc_msg *tx, bool r
|
|
|
|
if (tx->size)
|
|
memcpy_toio(avs_downlink_addr(adev), tx->data, tx->size);
|
|
- snd_hdac_adsp_writel(adev, SKL_ADSP_REG_HIPCIE, tx->header >> 32);
|
|
- snd_hdac_adsp_writel(adev, SKL_ADSP_REG_HIPCI, tx->header & UINT_MAX);
|
|
+ snd_hdac_adsp_writel(adev, spec->hipc->req_ext_offset, tx->header >> 32);
|
|
+ snd_hdac_adsp_writel(adev, spec->hipc->req_offset, tx->header & UINT_MAX);
|
|
}
|
|
|
|
static int avs_dsp_do_send_msg(struct avs_dev *adev, struct avs_ipc_msg *request,
|
|
@@ -586,6 +589,7 @@ int avs_dsp_send_rom_msg(struct avs_dev *adev, struct avs_ipc_msg *request)
|
|
|
|
void avs_dsp_interrupt_control(struct avs_dev *adev, bool enable)
|
|
{
|
|
+ const struct avs_spec *const spec = adev->spec;
|
|
u32 value, mask;
|
|
|
|
/*
|
|
@@ -597,7 +601,7 @@ void avs_dsp_interrupt_control(struct avs_dev *adev, bool enable)
|
|
|
|
mask = AVS_ADSP_HIPCCTL_DONE | AVS_ADSP_HIPCCTL_BUSY;
|
|
value = enable ? mask : 0;
|
|
- snd_hdac_adsp_updatel(adev, SKL_ADSP_REG_HIPCCTL, mask, value);
|
|
+ snd_hdac_adsp_updatel(adev, spec->hipc->ctl_offset, mask, value);
|
|
}
|
|
|
|
int avs_ipc_init(struct avs_ipc *ipc, struct device *dev)
|
|
diff --git a/sound/soc/intel/avs/loader.c b/sound/soc/intel/avs/loader.c
|
|
index 56bb0a59249d54..5c4ae3927ed243 100644
|
|
--- a/sound/soc/intel/avs/loader.c
|
|
+++ b/sound/soc/intel/avs/loader.c
|
|
@@ -306,7 +306,7 @@ avs_hda_init_rom(struct avs_dev *adev, unsigned int dma_id, bool purge)
|
|
}
|
|
|
|
/* await ROM init */
|
|
- ret = snd_hdac_adsp_readq_poll(adev, spec->rom_status, reg,
|
|
+ ret = snd_hdac_adsp_readl_poll(adev, spec->sram->rom_status_offset, reg,
|
|
(reg & 0xF) == AVS_ROM_INIT_DONE ||
|
|
(reg & 0xF) == APL_ROM_FW_ENTERED,
|
|
AVS_ROM_INIT_POLLING_US, APL_ROM_INIT_TIMEOUT_US);
|
|
diff --git a/sound/soc/intel/avs/messages.h b/sound/soc/intel/avs/messages.h
|
|
index 7f23a304b4a94e..9540401b093c13 100644
|
|
--- a/sound/soc/intel/avs/messages.h
|
|
+++ b/sound/soc/intel/avs/messages.h
|
|
@@ -357,21 +357,21 @@ enum avs_skl_log_priority {
|
|
AVS_SKL_LOG_VERBOSE,
|
|
};
|
|
|
|
-struct skl_log_state {
|
|
+struct avs_skl_log_state {
|
|
u32 enable;
|
|
u32 min_priority;
|
|
} __packed;
|
|
|
|
-struct skl_log_state_info {
|
|
+struct avs_skl_log_state_info {
|
|
u32 core_mask;
|
|
- struct skl_log_state logs_core[];
|
|
+ struct avs_skl_log_state logs_core[];
|
|
} __packed;
|
|
|
|
-struct apl_log_state_info {
|
|
+struct avs_apl_log_state_info {
|
|
u32 aging_timer_period;
|
|
u32 fifo_full_timer_period;
|
|
u32 core_mask;
|
|
- struct skl_log_state logs_core[];
|
|
+ struct avs_skl_log_state logs_core[];
|
|
} __packed;
|
|
|
|
int avs_ipc_set_enable_logs(struct avs_dev *adev, u8 *log_info, size_t size);
|
|
diff --git a/sound/soc/intel/avs/registers.h b/sound/soc/intel/avs/registers.h
|
|
index 2b464e466ed520..5c1dce46f71d8b 100644
|
|
--- a/sound/soc/intel/avs/registers.h
|
|
+++ b/sound/soc/intel/avs/registers.h
|
|
@@ -55,7 +55,7 @@
|
|
#define APL_ADSP_SRAM_WINDOW_SIZE 0x20000
|
|
|
|
/* Constants used when accessing SRAM, space shared with firmware */
|
|
-#define AVS_FW_REG_BASE(adev) ((adev)->spec->sram_base_offset)
|
|
+#define AVS_FW_REG_BASE(adev) ((adev)->spec->sram->base_offset)
|
|
#define AVS_FW_REG_STATUS(adev) (AVS_FW_REG_BASE(adev) + 0x0)
|
|
#define AVS_FW_REG_ERROR_CODE(adev) (AVS_FW_REG_BASE(adev) + 0x4)
|
|
|
|
@@ -70,8 +70,8 @@
|
|
|
|
/* registry I/O helpers */
|
|
#define avs_sram_offset(adev, window_idx) \
|
|
- ((adev)->spec->sram_base_offset + \
|
|
- (adev)->spec->sram_window_size * (window_idx))
|
|
+ ((adev)->spec->sram->base_offset + \
|
|
+ (adev)->spec->sram->window_size * (window_idx))
|
|
|
|
#define avs_sram_addr(adev, window_idx) \
|
|
((adev)->dsp_ba + avs_sram_offset(adev, window_idx))
|
|
diff --git a/sound/soc/intel/avs/skl.c b/sound/soc/intel/avs/skl.c
|
|
index 6bb8bbc70442bd..7ea8d91b54d2ed 100644
|
|
--- a/sound/soc/intel/avs/skl.c
|
|
+++ b/sound/soc/intel/avs/skl.c
|
|
@@ -13,10 +13,10 @@
|
|
#include "messages.h"
|
|
|
|
static int __maybe_unused
|
|
-skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
|
|
- u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
|
|
+avs_skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
|
|
+ u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
|
|
{
|
|
- struct skl_log_state_info *info;
|
|
+ struct avs_skl_log_state_info *info;
|
|
u32 size, num_cores = adev->hw_cfg.dsp_cores;
|
|
int ret, i;
|
|
|
|
@@ -45,7 +45,7 @@ skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_peri
|
|
return 0;
|
|
}
|
|
|
|
-int skl_log_buffer_offset(struct avs_dev *adev, u32 core)
|
|
+int avs_skl_log_buffer_offset(struct avs_dev *adev, u32 core)
|
|
{
|
|
return core * avs_log_buffer_size(adev);
|
|
}
|
|
@@ -53,8 +53,7 @@ int skl_log_buffer_offset(struct avs_dev *adev, u32 core)
|
|
/* fw DbgLogWp registers */
|
|
#define FW_REGS_DBG_LOG_WP(core) (0x30 + 0x4 * core)
|
|
|
|
-static int
|
|
-skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
+static int avs_skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
{
|
|
void __iomem *buf;
|
|
u16 size, write, offset;
|
|
@@ -74,7 +73,7 @@ skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
return 0;
|
|
}
|
|
|
|
-static int skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
+static int avs_skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
{
|
|
u8 *dump;
|
|
|
|
@@ -88,20 +87,19 @@ static int skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
|
|
return 0;
|
|
}
|
|
|
|
-static bool
|
|
-skl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
|
|
+static bool avs_skl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
|
|
{
|
|
/* unsupported on cAVS 1.5 hw */
|
|
return false;
|
|
}
|
|
|
|
-static int skl_set_d0ix(struct avs_dev *adev, bool enable)
|
|
+static int avs_skl_set_d0ix(struct avs_dev *adev, bool enable)
|
|
{
|
|
/* unsupported on cAVS 1.5 hw */
|
|
return 0;
|
|
}
|
|
|
|
-const struct avs_dsp_ops skl_dsp_ops = {
|
|
+const struct avs_dsp_ops avs_skl_dsp_ops = {
|
|
.power = avs_dsp_core_power,
|
|
.reset = avs_dsp_core_reset,
|
|
.stall = avs_dsp_core_stall,
|
|
@@ -111,10 +109,10 @@ const struct avs_dsp_ops skl_dsp_ops = {
|
|
.load_basefw = avs_cldma_load_basefw,
|
|
.load_lib = avs_cldma_load_library,
|
|
.transfer_mods = avs_cldma_transfer_modules,
|
|
- .log_buffer_offset = skl_log_buffer_offset,
|
|
- .log_buffer_status = skl_log_buffer_status,
|
|
- .coredump = skl_coredump,
|
|
- .d0ix_toggle = skl_d0ix_toggle,
|
|
- .set_d0ix = skl_set_d0ix,
|
|
+ .log_buffer_offset = avs_skl_log_buffer_offset,
|
|
+ .log_buffer_status = avs_skl_log_buffer_status,
|
|
+ .coredump = avs_skl_coredump,
|
|
+ .d0ix_toggle = avs_skl_d0ix_toggle,
|
|
+ .set_d0ix = avs_skl_set_d0ix,
|
|
AVS_SET_ENABLE_LOGS_OP(skl)
|
|
};
|
|
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c
|
|
index e6a6eabc47e5bb..14e5c53e697b0e 100644
|
|
--- a/sound/soc/rockchip/rockchip_i2s_tdm.c
|
|
+++ b/sound/soc/rockchip/rockchip_i2s_tdm.c
|
|
@@ -24,7 +24,6 @@
|
|
|
|
#define DRV_NAME "rockchip-i2s-tdm"
|
|
|
|
-#define DEFAULT_MCLK_FS 256
|
|
#define CH_GRP_MAX 4 /* The max channel 8 / 2 */
|
|
#define MULTIPLEX_CH_MAX 10
|
|
|
|
@@ -72,6 +71,8 @@ struct rk_i2s_tdm_dev {
|
|
bool has_playback;
|
|
bool has_capture;
|
|
struct snd_soc_dai_driver *dai;
|
|
+ unsigned int mclk_rx_freq;
|
|
+ unsigned int mclk_tx_freq;
|
|
};
|
|
|
|
static int to_ch_num(unsigned int val)
|
|
@@ -647,6 +648,27 @@ static int rockchip_i2s_trcm_mode(struct snd_pcm_substream *substream,
|
|
return 0;
|
|
}
|
|
|
|
+static int rockchip_i2s_tdm_set_sysclk(struct snd_soc_dai *cpu_dai, int stream,
|
|
+ unsigned int freq, int dir)
|
|
+{
|
|
+ struct rk_i2s_tdm_dev *i2s_tdm = to_info(cpu_dai);
|
|
+
|
|
+ if (i2s_tdm->clk_trcm) {
|
|
+ i2s_tdm->mclk_tx_freq = freq;
|
|
+ i2s_tdm->mclk_rx_freq = freq;
|
|
+ } else {
|
|
+ if (stream == SNDRV_PCM_STREAM_PLAYBACK)
|
|
+ i2s_tdm->mclk_tx_freq = freq;
|
|
+ else
|
|
+ i2s_tdm->mclk_rx_freq = freq;
|
|
+ }
|
|
+
|
|
+ dev_dbg(i2s_tdm->dev, "The target mclk_%s freq is: %d\n",
|
|
+ stream ? "rx" : "tx", freq);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static int rockchip_i2s_tdm_hw_params(struct snd_pcm_substream *substream,
|
|
struct snd_pcm_hw_params *params,
|
|
struct snd_soc_dai *dai)
|
|
@@ -661,15 +683,19 @@ static int rockchip_i2s_tdm_hw_params(struct snd_pcm_substream *substream,
|
|
|
|
if (i2s_tdm->clk_trcm == TRCM_TX) {
|
|
mclk = i2s_tdm->mclk_tx;
|
|
+ mclk_rate = i2s_tdm->mclk_tx_freq;
|
|
} else if (i2s_tdm->clk_trcm == TRCM_RX) {
|
|
mclk = i2s_tdm->mclk_rx;
|
|
+ mclk_rate = i2s_tdm->mclk_rx_freq;
|
|
} else if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
|
mclk = i2s_tdm->mclk_tx;
|
|
+ mclk_rate = i2s_tdm->mclk_tx_freq;
|
|
} else {
|
|
mclk = i2s_tdm->mclk_rx;
|
|
+ mclk_rate = i2s_tdm->mclk_rx_freq;
|
|
}
|
|
|
|
- err = clk_set_rate(mclk, DEFAULT_MCLK_FS * params_rate(params));
|
|
+ err = clk_set_rate(mclk, mclk_rate);
|
|
if (err)
|
|
return err;
|
|
|
|
@@ -829,6 +855,7 @@ static const struct snd_soc_dai_ops rockchip_i2s_tdm_dai_ops = {
|
|
.hw_params = rockchip_i2s_tdm_hw_params,
|
|
.set_bclk_ratio = rockchip_i2s_tdm_set_bclk_ratio,
|
|
.set_fmt = rockchip_i2s_tdm_set_fmt,
|
|
+ .set_sysclk = rockchip_i2s_tdm_set_sysclk,
|
|
.set_tdm_slot = rockchip_dai_tdm_slot,
|
|
.trigger = rockchip_i2s_tdm_trigger,
|
|
};
|
|
diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c
|
|
index 1588b93cc35d01..353863f49b3131 100644
|
|
--- a/sound/soc/sh/rz-ssi.c
|
|
+++ b/sound/soc/sh/rz-ssi.c
|
|
@@ -245,8 +245,7 @@ static void rz_ssi_stream_quit(struct rz_ssi_priv *ssi,
|
|
static int rz_ssi_clk_setup(struct rz_ssi_priv *ssi, unsigned int rate,
|
|
unsigned int channels)
|
|
{
|
|
- static s8 ckdv[16] = { 1, 2, 4, 8, 16, 32, 64, 128,
|
|
- 6, 12, 24, 48, 96, -1, -1, -1 };
|
|
+ static u8 ckdv[] = { 1, 2, 4, 8, 16, 32, 64, 128, 6, 12, 24, 48, 96 };
|
|
unsigned int channel_bits = 32; /* System Word Length */
|
|
unsigned long bclk_rate = rate * channels * channel_bits;
|
|
unsigned int div;
|
|
diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
|
|
index 2347aeb049bccf..e482238388de12 100644
|
|
--- a/sound/soc/sunxi/sun4i-spdif.c
|
|
+++ b/sound/soc/sunxi/sun4i-spdif.c
|
|
@@ -177,6 +177,7 @@ struct sun4i_spdif_quirks {
|
|
unsigned int reg_dac_txdata;
|
|
bool has_reset;
|
|
unsigned int val_fctl_ftx;
|
|
+ unsigned int mclk_multiplier;
|
|
};
|
|
|
|
struct sun4i_spdif_dev {
|
|
@@ -314,6 +315,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream,
|
|
default:
|
|
return -EINVAL;
|
|
}
|
|
+ mclk *= host->quirks->mclk_multiplier;
|
|
|
|
ret = clk_set_rate(host->spdif_clk, mclk);
|
|
if (ret < 0) {
|
|
@@ -348,6 +350,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream,
|
|
default:
|
|
return -EINVAL;
|
|
}
|
|
+ mclk_div *= host->quirks->mclk_multiplier;
|
|
|
|
reg_val = 0;
|
|
reg_val |= SUN4I_SPDIF_TXCFG_ASS;
|
|
@@ -541,24 +544,28 @@ static struct snd_soc_dai_driver sun4i_spdif_dai = {
|
|
static const struct sun4i_spdif_quirks sun4i_a10_spdif_quirks = {
|
|
.reg_dac_txdata = SUN4I_SPDIF_TXFIFO,
|
|
.val_fctl_ftx = SUN4I_SPDIF_FCTL_FTX,
|
|
+ .mclk_multiplier = 1,
|
|
};
|
|
|
|
static const struct sun4i_spdif_quirks sun6i_a31_spdif_quirks = {
|
|
.reg_dac_txdata = SUN4I_SPDIF_TXFIFO,
|
|
.val_fctl_ftx = SUN4I_SPDIF_FCTL_FTX,
|
|
.has_reset = true,
|
|
+ .mclk_multiplier = 1,
|
|
};
|
|
|
|
static const struct sun4i_spdif_quirks sun8i_h3_spdif_quirks = {
|
|
.reg_dac_txdata = SUN8I_SPDIF_TXFIFO,
|
|
.val_fctl_ftx = SUN4I_SPDIF_FCTL_FTX,
|
|
.has_reset = true,
|
|
+ .mclk_multiplier = 4,
|
|
};
|
|
|
|
static const struct sun4i_spdif_quirks sun50i_h6_spdif_quirks = {
|
|
.reg_dac_txdata = SUN8I_SPDIF_TXFIFO,
|
|
.val_fctl_ftx = SUN50I_H6_SPDIF_FCTL_FTX,
|
|
.has_reset = true,
|
|
+ .mclk_multiplier = 1,
|
|
};
|
|
|
|
static const struct of_device_id sun4i_spdif_of_match[] = {
|
|
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
|
|
index 9cdd6cfd8219a7..93d9ed8983dfce 100644
|
|
--- a/sound/usb/quirks.c
|
|
+++ b/sound/usb/quirks.c
|
|
@@ -2243,6 +2243,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
|
|
QUIRK_FLAG_CTL_MSG_DELAY_1M),
|
|
DEVICE_FLG(0x2d95, 0x8021, /* VIVO USB-C-XE710 HEADSET */
|
|
QUIRK_FLAG_CTL_MSG_DELAY_1M),
|
|
+ DEVICE_FLG(0x2fc6, 0xf0b7, /* iBasso DC07 Pro */
|
|
+ QUIRK_FLAG_CTL_MSG_DELAY_1M),
|
|
DEVICE_FLG(0x30be, 0x0101, /* Schiit Hel */
|
|
QUIRK_FLAG_IGNORE_CTL_ERROR),
|
|
DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */
|
|
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
|
|
index 156b62a163c5a6..8a48cc2536f566 100644
|
|
--- a/tools/bootconfig/main.c
|
|
+++ b/tools/bootconfig/main.c
|
|
@@ -226,7 +226,7 @@ static int load_xbc_from_initrd(int fd, char **buf)
|
|
/* Wrong Checksum */
|
|
rcsum = xbc_calc_checksum(*buf, size);
|
|
if (csum != rcsum) {
|
|
- pr_err("checksum error: %d != %d\n", csum, rcsum);
|
|
+ pr_err("checksum error: %u != %u\n", csum, rcsum);
|
|
return -EINVAL;
|
|
}
|
|
|
|
@@ -395,7 +395,7 @@ static int apply_xbc(const char *path, const char *xbc_path)
|
|
xbc_get_info(&ret, NULL);
|
|
printf("\tNumber of nodes: %d\n", ret);
|
|
printf("\tSize: %u bytes\n", (unsigned int)size);
|
|
- printf("\tChecksum: %d\n", (unsigned int)csum);
|
|
+ printf("\tChecksum: %u\n", (unsigned int)csum);
|
|
|
|
/* TODO: Check the options by schema */
|
|
xbc_exit();
|
|
diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c
|
|
index 88cc7236f12202..736ebceea233f8 100644
|
|
--- a/tools/lib/bpf/linker.c
|
|
+++ b/tools/lib/bpf/linker.c
|
|
@@ -567,17 +567,15 @@ static int linker_load_obj_file(struct bpf_linker *linker, const char *filename,
|
|
}
|
|
obj->elf = elf_begin(obj->fd, ELF_C_READ_MMAP, NULL);
|
|
if (!obj->elf) {
|
|
- err = -errno;
|
|
pr_warn_elf("failed to parse ELF file '%s'", filename);
|
|
- return err;
|
|
+ return -EINVAL;
|
|
}
|
|
|
|
/* Sanity check ELF file high-level properties */
|
|
ehdr = elf64_getehdr(obj->elf);
|
|
if (!ehdr) {
|
|
- err = -errno;
|
|
pr_warn_elf("failed to get ELF header for %s", filename);
|
|
- return err;
|
|
+ return -EINVAL;
|
|
}
|
|
if (ehdr->e_ident[EI_DATA] != host_endianness) {
|
|
err = -EOPNOTSUPP;
|
|
@@ -593,9 +591,8 @@ static int linker_load_obj_file(struct bpf_linker *linker, const char *filename,
|
|
}
|
|
|
|
if (elf_getshdrstrndx(obj->elf, &obj->shstrs_sec_idx)) {
|
|
- err = -errno;
|
|
pr_warn_elf("failed to get SHSTRTAB section index for %s", filename);
|
|
- return err;
|
|
+ return -EINVAL;
|
|
}
|
|
|
|
scn = NULL;
|
|
@@ -605,26 +602,23 @@ static int linker_load_obj_file(struct bpf_linker *linker, const char *filename,
|
|
|
|
shdr = elf64_getshdr(scn);
|
|
if (!shdr) {
|
|
- err = -errno;
|
|
pr_warn_elf("failed to get section #%zu header for %s",
|
|
sec_idx, filename);
|
|
- return err;
|
|
+ return -EINVAL;
|
|
}
|
|
|
|
sec_name = elf_strptr(obj->elf, obj->shstrs_sec_idx, shdr->sh_name);
|
|
if (!sec_name) {
|
|
- err = -errno;
|
|
pr_warn_elf("failed to get section #%zu name for %s",
|
|
sec_idx, filename);
|
|
- return err;
|
|
+ return -EINVAL;
|
|
}
|
|
|
|
data = elf_getdata(scn, 0);
|
|
if (!data) {
|
|
- err = -errno;
|
|
pr_warn_elf("failed to get section #%zu (%s) data from %s",
|
|
sec_idx, sec_name, filename);
|
|
- return err;
|
|
+ return -EINVAL;
|
|
}
|
|
|
|
sec = add_src_sec(obj, sec_name);
|
|
@@ -2602,14 +2596,14 @@ int bpf_linker__finalize(struct bpf_linker *linker)
|
|
|
|
/* Finalize ELF layout */
|
|
if (elf_update(linker->elf, ELF_C_NULL) < 0) {
|
|
- err = -errno;
|
|
+ err = -EINVAL;
|
|
pr_warn_elf("failed to finalize ELF layout");
|
|
return libbpf_err(err);
|
|
}
|
|
|
|
/* Write out final ELF contents */
|
|
if (elf_update(linker->elf, ELF_C_WRITE) < 0) {
|
|
- err = -errno;
|
|
+ err = -EINVAL;
|
|
pr_warn_elf("failed to write ELF contents");
|
|
return libbpf_err(err);
|
|
}
|
|
diff --git a/tools/lib/bpf/usdt.c b/tools/lib/bpf/usdt.c
|
|
index 93794f01bb67cb..6ff28e7bf5e3da 100644
|
|
--- a/tools/lib/bpf/usdt.c
|
|
+++ b/tools/lib/bpf/usdt.c
|
|
@@ -659,7 +659,7 @@ static int collect_usdt_targets(struct usdt_manager *man, Elf *elf, const char *
|
|
* [0] https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
|
|
*/
|
|
usdt_abs_ip = note.loc_addr;
|
|
- if (base_addr)
|
|
+ if (base_addr && note.base_addr)
|
|
usdt_abs_ip += base_addr - note.base_addr;
|
|
|
|
/* When attaching uprobes (which is what USDTs basically are)
|
|
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
|
|
index fcb32c58bee7e4..bd24ed0af208a1 100644
|
|
--- a/tools/perf/builtin-lock.c
|
|
+++ b/tools/perf/builtin-lock.c
|
|
@@ -1591,8 +1591,8 @@ static const struct {
|
|
{ LCB_F_PERCPU | LCB_F_WRITE, "pcpu-sem:W", "percpu-rwsem" },
|
|
{ LCB_F_MUTEX, "mutex", "mutex" },
|
|
{ LCB_F_MUTEX | LCB_F_SPIN, "mutex", "mutex" },
|
|
- /* alias for get_type_flag() */
|
|
- { LCB_F_MUTEX | LCB_F_SPIN, "mutex-spin", "mutex" },
|
|
+ /* alias for optimistic spinning only */
|
|
+ { LCB_F_MUTEX | LCB_F_SPIN, "mutex:spin", "mutex-spin" },
|
|
};
|
|
|
|
static const char *get_type_str(unsigned int flags)
|
|
@@ -1617,19 +1617,6 @@ static const char *get_type_name(unsigned int flags)
|
|
return "unknown";
|
|
}
|
|
|
|
-static unsigned int get_type_flag(const char *str)
|
|
-{
|
|
- for (unsigned int i = 0; i < ARRAY_SIZE(lock_type_table); i++) {
|
|
- if (!strcmp(lock_type_table[i].name, str))
|
|
- return lock_type_table[i].flags;
|
|
- }
|
|
- for (unsigned int i = 0; i < ARRAY_SIZE(lock_type_table); i++) {
|
|
- if (!strcmp(lock_type_table[i].str, str))
|
|
- return lock_type_table[i].flags;
|
|
- }
|
|
- return UINT_MAX;
|
|
-}
|
|
-
|
|
static void lock_filter_finish(void)
|
|
{
|
|
zfree(&filters.types);
|
|
@@ -2321,29 +2308,58 @@ static int parse_lock_type(const struct option *opt __maybe_unused, const char *
|
|
int unset __maybe_unused)
|
|
{
|
|
char *s, *tmp, *tok;
|
|
- int ret = 0;
|
|
|
|
s = strdup(str);
|
|
if (s == NULL)
|
|
return -1;
|
|
|
|
for (tok = strtok_r(s, ", ", &tmp); tok; tok = strtok_r(NULL, ", ", &tmp)) {
|
|
- unsigned int flags = get_type_flag(tok);
|
|
+ bool found = false;
|
|
|
|
- if (flags == -1U) {
|
|
- pr_err("Unknown lock flags: %s\n", tok);
|
|
- ret = -1;
|
|
- break;
|
|
+ /* `tok` is `str` in `lock_type_table` if it contains ':'. */
|
|
+ if (strchr(tok, ':')) {
|
|
+ for (unsigned int i = 0; i < ARRAY_SIZE(lock_type_table); i++) {
|
|
+ if (!strcmp(lock_type_table[i].str, tok) &&
|
|
+ add_lock_type(lock_type_table[i].flags)) {
|
|
+ found = true;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if (!found) {
|
|
+ pr_err("Unknown lock flags name: %s\n", tok);
|
|
+ free(s);
|
|
+ return -1;
|
|
+ }
|
|
+
|
|
+ continue;
|
|
}
|
|
|
|
- if (!add_lock_type(flags)) {
|
|
- ret = -1;
|
|
- break;
|
|
+ /*
|
|
+ * Otherwise `tok` is `name` in `lock_type_table`.
|
|
+ * Single lock name could contain multiple flags.
|
|
+ */
|
|
+ for (unsigned int i = 0; i < ARRAY_SIZE(lock_type_table); i++) {
|
|
+ if (!strcmp(lock_type_table[i].name, tok)) {
|
|
+ if (add_lock_type(lock_type_table[i].flags)) {
|
|
+ found = true;
|
|
+ } else {
|
|
+ free(s);
|
|
+ return -1;
|
|
+ }
|
|
+ }
|
|
}
|
|
+
|
|
+ if (!found) {
|
|
+ pr_err("Unknown lock name: %s\n", tok);
|
|
+ free(s);
|
|
+ return -1;
|
|
+ }
|
|
+
|
|
}
|
|
|
|
free(s);
|
|
- return ret;
|
|
+ return 0;
|
|
}
|
|
|
|
static bool add_lock_addr(unsigned long addr)
|
|
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
|
|
index cd2f3f1a756330..54b06db597862f 100644
|
|
--- a/tools/perf/builtin-report.c
|
|
+++ b/tools/perf/builtin-report.c
|
|
@@ -1352,7 +1352,7 @@ int cmd_report(int argc, const char **argv)
|
|
OPT_STRING(0, "addr2line", &addr2line_path, "path",
|
|
"addr2line binary to use for line numbers"),
|
|
OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
|
|
- "Disable symbol demangling"),
|
|
+ "Symbol demangling. Enabled by default, use --no-demangle to disable."),
|
|
OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
|
|
"Enable kernel symbol demangling"),
|
|
OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"),
|
|
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
|
|
index 1c1ec444d501ee..381274c70a9afd 100644
|
|
--- a/tools/perf/builtin-top.c
|
|
+++ b/tools/perf/builtin-top.c
|
|
@@ -809,7 +809,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
|
|
* invalid --vmlinux ;-)
|
|
*/
|
|
if (!machine->kptr_restrict_warned && !top->vmlinux_warned &&
|
|
- __map__is_kernel(al.map) && map__has_symbols(al.map)) {
|
|
+ __map__is_kernel(al.map) && !map__has_symbols(al.map)) {
|
|
if (symbol_conf.vmlinux_name) {
|
|
char serr[256];
|
|
|
|
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
|
|
index 3ecd6868be2d6d..12bdbf3ecc6ae4 100644
|
|
--- a/tools/perf/builtin-trace.c
|
|
+++ b/tools/perf/builtin-trace.c
|
|
@@ -1850,8 +1850,12 @@ static int trace__read_syscall_info(struct trace *trace, int id)
|
|
return PTR_ERR(sc->tp_format);
|
|
}
|
|
|
|
+ /*
|
|
+ * The tracepoint format contains __syscall_nr field, so it's one more
|
|
+ * than the actual number of syscall arguments.
|
|
+ */
|
|
if (syscall__alloc_arg_fmts(sc, IS_ERR(sc->tp_format) ?
|
|
- RAW_SYSCALL_ARGS_NUM : sc->tp_format->format.nr_fields))
|
|
+ RAW_SYSCALL_ARGS_NUM : sc->tp_format->format.nr_fields - 1))
|
|
return -ENOMEM;
|
|
|
|
sc->args = sc->tp_format->format.fields;
|
|
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
|
|
index b00b5a2634c3d1..b94b4f16a60a54 100644
|
|
--- a/tools/perf/util/bpf-event.c
|
|
+++ b/tools/perf/util/bpf-event.c
|
|
@@ -288,7 +288,10 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,
|
|
}
|
|
|
|
info_node->info_linear = info_linear;
|
|
- perf_env__insert_bpf_prog_info(env, info_node);
|
|
+ if (!perf_env__insert_bpf_prog_info(env, info_node)) {
|
|
+ free(info_linear);
|
|
+ free(info_node);
|
|
+ }
|
|
info_linear = NULL;
|
|
|
|
/*
|
|
@@ -476,7 +479,10 @@ static void perf_env__add_bpf_info(struct perf_env *env, u32 id)
|
|
info_node = malloc(sizeof(struct bpf_prog_info_node));
|
|
if (info_node) {
|
|
info_node->info_linear = info_linear;
|
|
- perf_env__insert_bpf_prog_info(env, info_node);
|
|
+ if (!perf_env__insert_bpf_prog_info(env, info_node)) {
|
|
+ free(info_linear);
|
|
+ free(info_node);
|
|
+ }
|
|
} else
|
|
free(info_linear);
|
|
|
|
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
|
|
index d2c7b6e6eae51b..cea15c568602b1 100644
|
|
--- a/tools/perf/util/env.c
|
|
+++ b/tools/perf/util/env.c
|
|
@@ -20,15 +20,19 @@ struct perf_env perf_env;
|
|
#include "bpf-utils.h"
|
|
#include <bpf/libbpf.h>
|
|
|
|
-void perf_env__insert_bpf_prog_info(struct perf_env *env,
|
|
+bool perf_env__insert_bpf_prog_info(struct perf_env *env,
|
|
struct bpf_prog_info_node *info_node)
|
|
{
|
|
+ bool ret;
|
|
+
|
|
down_write(&env->bpf_progs.lock);
|
|
- __perf_env__insert_bpf_prog_info(env, info_node);
|
|
+ ret = __perf_env__insert_bpf_prog_info(env, info_node);
|
|
up_write(&env->bpf_progs.lock);
|
|
+
|
|
+ return ret;
|
|
}
|
|
|
|
-void __perf_env__insert_bpf_prog_info(struct perf_env *env, struct bpf_prog_info_node *info_node)
|
|
+bool __perf_env__insert_bpf_prog_info(struct perf_env *env, struct bpf_prog_info_node *info_node)
|
|
{
|
|
__u32 prog_id = info_node->info_linear->info.id;
|
|
struct bpf_prog_info_node *node;
|
|
@@ -46,13 +50,14 @@ void __perf_env__insert_bpf_prog_info(struct perf_env *env, struct bpf_prog_info
|
|
p = &(*p)->rb_right;
|
|
} else {
|
|
pr_debug("duplicated bpf prog info %u\n", prog_id);
|
|
- return;
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
rb_link_node(&info_node->rb_node, parent, p);
|
|
rb_insert_color(&info_node->rb_node, &env->bpf_progs.infos);
|
|
env->bpf_progs.infos_cnt++;
|
|
+ return true;
|
|
}
|
|
|
|
struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env,
|
|
diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h
|
|
index 359eff51cb85b7..bc2d0ef3519978 100644
|
|
--- a/tools/perf/util/env.h
|
|
+++ b/tools/perf/util/env.h
|
|
@@ -164,9 +164,9 @@ const char *perf_env__raw_arch(struct perf_env *env);
|
|
int perf_env__nr_cpus_avail(struct perf_env *env);
|
|
|
|
void perf_env__init(struct perf_env *env);
|
|
-void __perf_env__insert_bpf_prog_info(struct perf_env *env,
|
|
+bool __perf_env__insert_bpf_prog_info(struct perf_env *env,
|
|
struct bpf_prog_info_node *info_node);
|
|
-void perf_env__insert_bpf_prog_info(struct perf_env *env,
|
|
+bool perf_env__insert_bpf_prog_info(struct perf_env *env,
|
|
struct bpf_prog_info_node *info_node);
|
|
struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env,
|
|
__u32 prog_id);
|
|
diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c
|
|
index b8875aac8f8709..fa0473f7a4ff45 100644
|
|
--- a/tools/perf/util/expr.c
|
|
+++ b/tools/perf/util/expr.c
|
|
@@ -292,7 +292,7 @@ struct expr_parse_ctx *expr__ctx_new(void)
|
|
{
|
|
struct expr_parse_ctx *ctx;
|
|
|
|
- ctx = malloc(sizeof(struct expr_parse_ctx));
|
|
+ ctx = calloc(1, sizeof(struct expr_parse_ctx));
|
|
if (!ctx)
|
|
return NULL;
|
|
|
|
@@ -301,9 +301,6 @@ struct expr_parse_ctx *expr__ctx_new(void)
|
|
free(ctx);
|
|
return NULL;
|
|
}
|
|
- ctx->sctx.user_requested_cpu_list = NULL;
|
|
- ctx->sctx.runtime = 0;
|
|
- ctx->sctx.system_wide = false;
|
|
|
|
return ctx;
|
|
}
|
|
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
|
|
index 1482567e5ac1a7..0b44176826bfd9 100644
|
|
--- a/tools/perf/util/header.c
|
|
+++ b/tools/perf/util/header.c
|
|
@@ -3177,7 +3177,10 @@ static int process_bpf_prog_info(struct feat_fd *ff, void *data __maybe_unused)
|
|
/* after reading from file, translate offset to address */
|
|
bpil_offs_to_addr(info_linear);
|
|
info_node->info_linear = info_linear;
|
|
- __perf_env__insert_bpf_prog_info(env, info_node);
|
|
+ if (!__perf_env__insert_bpf_prog_info(env, info_node)) {
|
|
+ free(info_linear);
|
|
+ free(info_node);
|
|
+ }
|
|
}
|
|
|
|
up_write(&env->bpf_progs.lock);
|
|
@@ -3224,7 +3227,8 @@ static int process_bpf_btf(struct feat_fd *ff, void *data __maybe_unused)
|
|
if (__do_read(ff, node->data, data_size))
|
|
goto out;
|
|
|
|
- __perf_env__insert_btf(env, node);
|
|
+ if (!__perf_env__insert_btf(env, node))
|
|
+ free(node);
|
|
node = NULL;
|
|
}
|
|
|
|
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
|
|
index 7c6874804660eb..e2a6facd1c4e2a 100644
|
|
--- a/tools/perf/util/machine.c
|
|
+++ b/tools/perf/util/machine.c
|
|
@@ -1217,7 +1217,7 @@ static int machine__get_running_kernel_start(struct machine *machine,
|
|
|
|
err = kallsyms__get_symbol_start(filename, "_edata", &addr);
|
|
if (err)
|
|
- err = kallsyms__get_function_start(filename, "_etext", &addr);
|
|
+ err = kallsyms__get_symbol_start(filename, "_etext", &addr);
|
|
if (!err)
|
|
*end = addr;
|
|
|
|
diff --git a/tools/perf/util/namespaces.c b/tools/perf/util/namespaces.c
|
|
index cb185c5659d6b3..68f5de2d79c72c 100644
|
|
--- a/tools/perf/util/namespaces.c
|
|
+++ b/tools/perf/util/namespaces.c
|
|
@@ -266,11 +266,16 @@ pid_t nsinfo__pid(const struct nsinfo *nsi)
|
|
return RC_CHK_ACCESS(nsi)->pid;
|
|
}
|
|
|
|
-pid_t nsinfo__in_pidns(const struct nsinfo *nsi)
|
|
+bool nsinfo__in_pidns(const struct nsinfo *nsi)
|
|
{
|
|
return RC_CHK_ACCESS(nsi)->in_pidns;
|
|
}
|
|
|
|
+void nsinfo__set_in_pidns(struct nsinfo *nsi)
|
|
+{
|
|
+ RC_CHK_ACCESS(nsi)->in_pidns = true;
|
|
+}
|
|
+
|
|
void nsinfo__mountns_enter(struct nsinfo *nsi,
|
|
struct nscookie *nc)
|
|
{
|
|
diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h
|
|
index 8c0731c6cbb7ee..e95c79b80e27c8 100644
|
|
--- a/tools/perf/util/namespaces.h
|
|
+++ b/tools/perf/util/namespaces.h
|
|
@@ -58,7 +58,8 @@ void nsinfo__clear_need_setns(struct nsinfo *nsi);
|
|
pid_t nsinfo__tgid(const struct nsinfo *nsi);
|
|
pid_t nsinfo__nstgid(const struct nsinfo *nsi);
|
|
pid_t nsinfo__pid(const struct nsinfo *nsi);
|
|
-pid_t nsinfo__in_pidns(const struct nsinfo *nsi);
|
|
+bool nsinfo__in_pidns(const struct nsinfo *nsi);
|
|
+void nsinfo__set_in_pidns(struct nsinfo *nsi);
|
|
|
|
void nsinfo__mountns_enter(struct nsinfo *nsi, struct nscookie *nc);
|
|
void nsinfo__mountns_exit(struct nscookie *nc);
|
|
diff --git a/tools/power/cpupower/utils/idle_monitor/mperf_monitor.c b/tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
|
|
index ae6af354a81db5..08a399b0be286c 100644
|
|
--- a/tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
|
|
+++ b/tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
|
|
@@ -33,7 +33,7 @@ static int mperf_get_count_percent(unsigned int self_id, double *percent,
|
|
unsigned int cpu);
|
|
static int mperf_get_count_freq(unsigned int id, unsigned long long *count,
|
|
unsigned int cpu);
|
|
-static struct timespec time_start, time_end;
|
|
+static struct timespec *time_start, *time_end;
|
|
|
|
static cstate_t mperf_cstates[MPERF_CSTATE_COUNT] = {
|
|
{
|
|
@@ -174,7 +174,7 @@ static int mperf_get_count_percent(unsigned int id, double *percent,
|
|
dprint("%s: TSC Ref - mperf_diff: %llu, tsc_diff: %llu\n",
|
|
mperf_cstates[id].name, mperf_diff, tsc_diff);
|
|
} else if (max_freq_mode == MAX_FREQ_SYSFS) {
|
|
- timediff = max_frequency * timespec_diff_us(time_start, time_end);
|
|
+ timediff = max_frequency * timespec_diff_us(time_start[cpu], time_end[cpu]);
|
|
*percent = 100.0 * mperf_diff / timediff;
|
|
dprint("%s: MAXFREQ - mperf_diff: %llu, time_diff: %llu\n",
|
|
mperf_cstates[id].name, mperf_diff, timediff);
|
|
@@ -207,7 +207,7 @@ static int mperf_get_count_freq(unsigned int id, unsigned long long *count,
|
|
if (max_freq_mode == MAX_FREQ_TSC_REF) {
|
|
/* Calculate max_freq from TSC count */
|
|
tsc_diff = tsc_at_measure_end[cpu] - tsc_at_measure_start[cpu];
|
|
- time_diff = timespec_diff_us(time_start, time_end);
|
|
+ time_diff = timespec_diff_us(time_start[cpu], time_end[cpu]);
|
|
max_frequency = tsc_diff / time_diff;
|
|
}
|
|
|
|
@@ -226,9 +226,8 @@ static int mperf_start(void)
|
|
{
|
|
int cpu;
|
|
|
|
- clock_gettime(CLOCK_REALTIME, &time_start);
|
|
-
|
|
for (cpu = 0; cpu < cpu_count; cpu++) {
|
|
+ clock_gettime(CLOCK_REALTIME, &time_start[cpu]);
|
|
mperf_get_tsc(&tsc_at_measure_start[cpu]);
|
|
mperf_init_stats(cpu);
|
|
}
|
|
@@ -243,9 +242,9 @@ static int mperf_stop(void)
|
|
for (cpu = 0; cpu < cpu_count; cpu++) {
|
|
mperf_measure_stats(cpu);
|
|
mperf_get_tsc(&tsc_at_measure_end[cpu]);
|
|
+ clock_gettime(CLOCK_REALTIME, &time_end[cpu]);
|
|
}
|
|
|
|
- clock_gettime(CLOCK_REALTIME, &time_end);
|
|
return 0;
|
|
}
|
|
|
|
@@ -349,6 +348,8 @@ struct cpuidle_monitor *mperf_register(void)
|
|
aperf_current_count = calloc(cpu_count, sizeof(unsigned long long));
|
|
tsc_at_measure_start = calloc(cpu_count, sizeof(unsigned long long));
|
|
tsc_at_measure_end = calloc(cpu_count, sizeof(unsigned long long));
|
|
+ time_start = calloc(cpu_count, sizeof(struct timespec));
|
|
+ time_end = calloc(cpu_count, sizeof(struct timespec));
|
|
mperf_monitor.name_len = strlen(mperf_monitor.name);
|
|
return &mperf_monitor;
|
|
}
|
|
@@ -361,6 +362,8 @@ void mperf_unregister(void)
|
|
free(aperf_current_count);
|
|
free(tsc_at_measure_start);
|
|
free(tsc_at_measure_end);
|
|
+ free(time_start);
|
|
+ free(time_end);
|
|
free(is_valid);
|
|
}
|
|
|
|
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
|
|
index 045090085ac5bd..83d65c2abaf010 100755
|
|
--- a/tools/testing/ktest/ktest.pl
|
|
+++ b/tools/testing/ktest/ktest.pl
|
|
@@ -2406,6 +2406,11 @@ sub get_version {
|
|
return if ($have_version);
|
|
doprint "$make kernelrelease ... ";
|
|
$version = `$make -s kernelrelease | tail -1`;
|
|
+ if (!length($version)) {
|
|
+ run_command "$make allnoconfig" or return 0;
|
|
+ doprint "$make kernelrelease ... ";
|
|
+ $version = `$make -s kernelrelease | tail -1`;
|
|
+ }
|
|
chomp($version);
|
|
doprint "$version\n";
|
|
$have_version = 1;
|
|
@@ -2946,8 +2951,6 @@ sub run_bisect_test {
|
|
|
|
my $failed = 0;
|
|
my $result;
|
|
- my $output;
|
|
- my $ret;
|
|
|
|
$in_bisect = 1;
|
|
|
|
diff --git a/tools/testing/selftests/bpf/prog_tests/fill_link_info.c b/tools/testing/selftests/bpf/prog_tests/fill_link_info.c
|
|
index 5b0c6a04cdbfe0..e0208b0e53f162 100644
|
|
--- a/tools/testing/selftests/bpf/prog_tests/fill_link_info.c
|
|
+++ b/tools/testing/selftests/bpf/prog_tests/fill_link_info.c
|
|
@@ -164,6 +164,10 @@ static void test_kprobe_fill_link_info(struct test_fill_link_info *skel,
|
|
/* See also arch_adjust_kprobe_addr(). */
|
|
if (skel->kconfig->CONFIG_X86_KERNEL_IBT)
|
|
entry_offset = 4;
|
|
+ if (skel->kconfig->CONFIG_PPC64 &&
|
|
+ skel->kconfig->CONFIG_KPROBES_ON_FTRACE &&
|
|
+ !skel->kconfig->CONFIG_PPC_FTRACE_OUT_OF_LINE)
|
|
+ entry_offset = 4;
|
|
err = verify_perf_link_info(link_fd, type, kprobe_addr, 0, entry_offset);
|
|
ASSERT_OK(err, "verify_perf_link_info");
|
|
} else {
|
|
diff --git a/tools/testing/selftests/bpf/progs/test_fill_link_info.c b/tools/testing/selftests/bpf/progs/test_fill_link_info.c
|
|
index 564f402d56fef7..54b53ad05339df 100644
|
|
--- a/tools/testing/selftests/bpf/progs/test_fill_link_info.c
|
|
+++ b/tools/testing/selftests/bpf/progs/test_fill_link_info.c
|
|
@@ -6,13 +6,20 @@
|
|
#include <stdbool.h>
|
|
|
|
extern bool CONFIG_X86_KERNEL_IBT __kconfig __weak;
|
|
+extern bool CONFIG_PPC_FTRACE_OUT_OF_LINE __kconfig __weak;
|
|
+extern bool CONFIG_KPROBES_ON_FTRACE __kconfig __weak;
|
|
+extern bool CONFIG_PPC64 __kconfig __weak;
|
|
|
|
-/* This function is here to have CONFIG_X86_KERNEL_IBT
|
|
- * used and added to object BTF.
|
|
+/* This function is here to have CONFIG_X86_KERNEL_IBT,
|
|
+ * CONFIG_PPC_FTRACE_OUT_OF_LINE, CONFIG_KPROBES_ON_FTRACE,
|
|
+ * CONFIG_PPC6 used and added to object BTF.
|
|
*/
|
|
int unused(void)
|
|
{
|
|
- return CONFIG_X86_KERNEL_IBT ? 0 : 1;
|
|
+ return CONFIG_X86_KERNEL_IBT ||
|
|
+ CONFIG_PPC_FTRACE_OUT_OF_LINE ||
|
|
+ CONFIG_KPROBES_ON_FTRACE ||
|
|
+ CONFIG_PPC64 ? 0 : 1;
|
|
}
|
|
|
|
SEC("kprobe")
|
|
diff --git a/tools/testing/selftests/bpf/test_tc_tunnel.sh b/tools/testing/selftests/bpf/test_tc_tunnel.sh
|
|
index 7989ec60845455..cb55a908bb0d70 100755
|
|
--- a/tools/testing/selftests/bpf/test_tc_tunnel.sh
|
|
+++ b/tools/testing/selftests/bpf/test_tc_tunnel.sh
|
|
@@ -305,6 +305,7 @@ else
|
|
client_connect
|
|
verify_data
|
|
server_listen
|
|
+ wait_for_port ${port} ${netcat_opt}
|
|
fi
|
|
|
|
# serverside, use BPF for decap
|
|
diff --git a/tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh b/tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh
|
|
index 185b02d2d4cd14..7af78990b5bb60 100755
|
|
--- a/tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh
|
|
+++ b/tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh
|
|
@@ -142,7 +142,7 @@ function pre_ethtool {
|
|
}
|
|
|
|
function check_table {
|
|
- local path=$NSIM_DEV_DFS/ports/$port/udp_ports_table$1
|
|
+ local path=$NSIM_DEV_DFS/ports/$port/udp_ports/table$1
|
|
local -n expected=$2
|
|
local last=$3
|
|
|
|
@@ -212,7 +212,7 @@ function check_tables {
|
|
}
|
|
|
|
function print_table {
|
|
- local path=$NSIM_DEV_DFS/ports/$port/udp_ports_table$1
|
|
+ local path=$NSIM_DEV_DFS/ports/$port/udp_ports/table$1
|
|
read -a have < $path
|
|
|
|
tree $NSIM_DEV_DFS/
|
|
@@ -640,7 +640,7 @@ for port in 0 1; do
|
|
NSIM_NETDEV=`get_netdev_name old_netdevs`
|
|
ifconfig $NSIM_NETDEV up
|
|
|
|
- echo 110 > $NSIM_DEV_DFS/ports/$port/udp_ports_inject_error
|
|
+ echo 110 > $NSIM_DEV_DFS/ports/$port/udp_ports/inject_error
|
|
|
|
msg="1 - create VxLANs v6"
|
|
exp0=( 0 0 0 0 )
|
|
@@ -662,7 +662,7 @@ for port in 0 1; do
|
|
new_geneve gnv0 20000
|
|
|
|
msg="2 - destroy GENEVE"
|
|
- echo 2 > $NSIM_DEV_DFS/ports/$port/udp_ports_inject_error
|
|
+ echo 2 > $NSIM_DEV_DFS/ports/$port/udp_ports/inject_error
|
|
exp1=( `mke 20000 2` 0 0 0 )
|
|
del_dev gnv0
|
|
|
|
@@ -763,7 +763,7 @@ for port in 0 1; do
|
|
msg="create VxLANs v4"
|
|
new_vxlan vxlan0 10000 $NSIM_NETDEV
|
|
|
|
- echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports_reset
|
|
+ echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports/reset
|
|
check_tables
|
|
|
|
msg="NIC device goes down"
|
|
@@ -774,7 +774,7 @@ for port in 0 1; do
|
|
fi
|
|
check_tables
|
|
|
|
- echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports_reset
|
|
+ echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports/reset
|
|
check_tables
|
|
|
|
msg="NIC device goes up again"
|
|
@@ -788,7 +788,7 @@ for port in 0 1; do
|
|
del_dev vxlan0
|
|
check_tables
|
|
|
|
- echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports_reset
|
|
+ echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports/reset
|
|
check_tables
|
|
|
|
msg="destroy NIC"
|
|
@@ -895,7 +895,7 @@ msg="vacate VxLAN in overflow table"
|
|
exp0=( `mke 10000 1` `mke 10004 1` 0 `mke 10003 1` )
|
|
del_dev vxlan2
|
|
|
|
-echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports_reset
|
|
+echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports/reset
|
|
check_tables
|
|
|
|
msg="tunnels destroyed 2"
|
|
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
|
|
index e05ac826104678..878aac3b5ed543 100644
|
|
--- a/tools/testing/selftests/kselftest_harness.h
|
|
+++ b/tools/testing/selftests/kselftest_harness.h
|
|
@@ -710,33 +710,33 @@
|
|
/* Report with actual signedness to avoid weird output. */ \
|
|
switch (is_signed_type(__exp) * 2 + is_signed_type(__seen)) { \
|
|
case 0: { \
|
|
- unsigned long long __exp_print = (uintptr_t)__exp; \
|
|
- unsigned long long __seen_print = (uintptr_t)__seen; \
|
|
- __TH_LOG("Expected %s (%llu) %s %s (%llu)", \
|
|
+ uintmax_t __exp_print = (uintmax_t)__exp; \
|
|
+ uintmax_t __seen_print = (uintmax_t)__seen; \
|
|
+ __TH_LOG("Expected %s (%ju) %s %s (%ju)", \
|
|
_expected_str, __exp_print, #_t, \
|
|
_seen_str, __seen_print); \
|
|
break; \
|
|
} \
|
|
case 1: { \
|
|
- unsigned long long __exp_print = (uintptr_t)__exp; \
|
|
- long long __seen_print = (intptr_t)__seen; \
|
|
- __TH_LOG("Expected %s (%llu) %s %s (%lld)", \
|
|
+ uintmax_t __exp_print = (uintmax_t)__exp; \
|
|
+ intmax_t __seen_print = (intmax_t)__seen; \
|
|
+ __TH_LOG("Expected %s (%ju) %s %s (%jd)", \
|
|
_expected_str, __exp_print, #_t, \
|
|
_seen_str, __seen_print); \
|
|
break; \
|
|
} \
|
|
case 2: { \
|
|
- long long __exp_print = (intptr_t)__exp; \
|
|
- unsigned long long __seen_print = (uintptr_t)__seen; \
|
|
- __TH_LOG("Expected %s (%lld) %s %s (%llu)", \
|
|
+ intmax_t __exp_print = (intmax_t)__exp; \
|
|
+ uintmax_t __seen_print = (uintmax_t)__seen; \
|
|
+ __TH_LOG("Expected %s (%jd) %s %s (%ju)", \
|
|
_expected_str, __exp_print, #_t, \
|
|
_seen_str, __seen_print); \
|
|
break; \
|
|
} \
|
|
case 3: { \
|
|
- long long __exp_print = (intptr_t)__exp; \
|
|
- long long __seen_print = (intptr_t)__seen; \
|
|
- __TH_LOG("Expected %s (%lld) %s %s (%lld)", \
|
|
+ intmax_t __exp_print = (intmax_t)__exp; \
|
|
+ intmax_t __seen_print = (intmax_t)__seen; \
|
|
+ __TH_LOG("Expected %s (%jd) %s %s (%jd)", \
|
|
_expected_str, __exp_print, #_t, \
|
|
_seen_str, __seen_print); \
|
|
break; \
|
|
diff --git a/tools/testing/selftests/landlock/fs_test.c b/tools/testing/selftests/landlock/fs_test.c
|
|
index 720bafa0f87be2..c239838c796a47 100644
|
|
--- a/tools/testing/selftests/landlock/fs_test.c
|
|
+++ b/tools/testing/selftests/landlock/fs_test.c
|
|
@@ -1861,8 +1861,7 @@ static void test_execute(struct __test_metadata *const _metadata, const int err,
|
|
ASSERT_EQ(1, WIFEXITED(status));
|
|
ASSERT_EQ(err ? 2 : 0, WEXITSTATUS(status))
|
|
{
|
|
- TH_LOG("Unexpected return code for \"%s\": %s", path,
|
|
- strerror(errno));
|
|
+ TH_LOG("Unexpected return code for \"%s\"", path);
|
|
};
|
|
}
|
|
|
|
diff --git a/tools/testing/selftests/powerpc/benchmarks/gettimeofday.c b/tools/testing/selftests/powerpc/benchmarks/gettimeofday.c
|
|
index 580fcac0a09f31..b71ef8a493ed1a 100644
|
|
--- a/tools/testing/selftests/powerpc/benchmarks/gettimeofday.c
|
|
+++ b/tools/testing/selftests/powerpc/benchmarks/gettimeofday.c
|
|
@@ -20,7 +20,7 @@ static int test_gettimeofday(void)
|
|
gettimeofday(&tv_end, NULL);
|
|
}
|
|
|
|
- timersub(&tv_start, &tv_end, &tv_diff);
|
|
+ timersub(&tv_end, &tv_start, &tv_diff);
|
|
|
|
printf("time = %.6f\n", tv_diff.tv_sec + (tv_diff.tv_usec) * 1e-6);
|
|
|
|
diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c
|
|
index 5b9772cdf2651b..f6156790c3b4df 100644
|
|
--- a/tools/testing/selftests/rseq/rseq.c
|
|
+++ b/tools/testing/selftests/rseq/rseq.c
|
|
@@ -61,7 +61,6 @@ unsigned int rseq_size = -1U;
|
|
unsigned int rseq_flags;
|
|
|
|
static int rseq_ownership;
|
|
-static int rseq_reg_success; /* At least one rseq registration has succeded. */
|
|
|
|
/* Allocate a large area for the TLS. */
|
|
#define RSEQ_THREAD_AREA_ALLOC_SIZE 1024
|
|
@@ -152,14 +151,27 @@ int rseq_register_current_thread(void)
|
|
}
|
|
rc = sys_rseq(&__rseq_abi, get_rseq_min_alloc_size(), 0, RSEQ_SIG);
|
|
if (rc) {
|
|
- if (RSEQ_READ_ONCE(rseq_reg_success)) {
|
|
+ /*
|
|
+ * After at least one thread has registered successfully
|
|
+ * (rseq_size > 0), the registration of other threads should
|
|
+ * never fail.
|
|
+ */
|
|
+ if (RSEQ_READ_ONCE(rseq_size) > 0) {
|
|
/* Incoherent success/failure within process. */
|
|
abort();
|
|
}
|
|
return -1;
|
|
}
|
|
assert(rseq_current_cpu_raw() >= 0);
|
|
- RSEQ_WRITE_ONCE(rseq_reg_success, 1);
|
|
+
|
|
+ /*
|
|
+ * The first thread to register sets the rseq_size to mimic the libc
|
|
+ * behavior.
|
|
+ */
|
|
+ if (RSEQ_READ_ONCE(rseq_size) == 0) {
|
|
+ RSEQ_WRITE_ONCE(rseq_size, get_rseq_kernel_feature_size());
|
|
+ }
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
@@ -235,12 +247,18 @@ void rseq_init(void)
|
|
return;
|
|
}
|
|
rseq_ownership = 1;
|
|
- if (!rseq_available()) {
|
|
- rseq_size = 0;
|
|
- return;
|
|
- }
|
|
+
|
|
+ /* Calculate the offset of the rseq area from the thread pointer. */
|
|
rseq_offset = (void *)&__rseq_abi - rseq_thread_pointer();
|
|
+
|
|
+ /* rseq flags are deprecated, always set to 0. */
|
|
rseq_flags = 0;
|
|
+
|
|
+ /*
|
|
+ * Set the size to 0 until at least one thread registers to mimic the
|
|
+ * libc behavior.
|
|
+ */
|
|
+ rseq_size = 0;
|
|
}
|
|
|
|
static __attribute__((destructor))
|
|
diff --git a/tools/testing/selftests/rseq/rseq.h b/tools/testing/selftests/rseq/rseq.h
|
|
index 4e217b620e0c7a..062d10925a1011 100644
|
|
--- a/tools/testing/selftests/rseq/rseq.h
|
|
+++ b/tools/testing/selftests/rseq/rseq.h
|
|
@@ -60,7 +60,14 @@
|
|
extern ptrdiff_t rseq_offset;
|
|
|
|
/*
|
|
- * Size of the registered rseq area. 0 if the registration was
|
|
+ * The rseq ABI is composed of extensible feature fields. The extensions
|
|
+ * are done by appending additional fields at the end of the structure.
|
|
+ * The rseq_size defines the size of the active feature set which can be
|
|
+ * used by the application for the current rseq registration. Features
|
|
+ * starting at offset >= rseq_size are inactive and should not be used.
|
|
+ *
|
|
+ * The rseq_size is the intersection between the available allocation
|
|
+ * size for the rseq area and the feature size supported by the kernel.
|
|
* unsuccessful.
|
|
*/
|
|
extern unsigned int rseq_size;
|
|
diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c
|
|
index c5264594064c85..83faa4e354e389 100644
|
|
--- a/tools/testing/selftests/timers/clocksource-switch.c
|
|
+++ b/tools/testing/selftests/timers/clocksource-switch.c
|
|
@@ -156,8 +156,8 @@ int main(int argc, char **argv)
|
|
/* Check everything is sane before we start switching asynchronously */
|
|
if (do_sanity_check) {
|
|
for (i = 0; i < count; i++) {
|
|
- printf("Validating clocksource %s\n",
|
|
- clocksource_list[i]);
|
|
+ ksft_print_msg("Validating clocksource %s\n",
|
|
+ clocksource_list[i]);
|
|
if (change_clocksource(clocksource_list[i])) {
|
|
status = -1;
|
|
goto out;
|
|
@@ -169,7 +169,7 @@ int main(int argc, char **argv)
|
|
}
|
|
}
|
|
|
|
- printf("Running Asynchronous Switching Tests...\n");
|
|
+ ksft_print_msg("Running Asynchronous Switching Tests...\n");
|
|
pid = fork();
|
|
if (!pid)
|
|
return run_tests(runtime);
|