linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names
@ 2021-07-14 19:48 Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 02/10] ARM: dts: BCM63xx: Fix " Sasha Levin
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Rafał Miłecki, Florian Fainelli, Sasha Levin,
	linux-arm-kernel, devicetree

From: Rafał Miłecki <rafal@milecki.pl>

[ Upstream commit 9a800ce1aada6e0f56b78e4713f4858c8990c1f7 ]

This matches nand-controller.yaml requirements.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/bcm7445-bcm97445svmb.dts | 4 ++--
 arch/arm/boot/dts/bcm7445.dtsi             | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts b/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts
index 0bb8d17e4c2d..e51c9b079432 100644
--- a/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts
+++ b/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts
@@ -13,10 +13,10 @@ memory {
 	};
 };
 
-&nand {
+&nand_controller {
 	status = "okay";
 
-	nandcs@1 {
+	nand@1 {
 		compatible = "brcm,nandcs";
 		reg = <1>;
 		nand-ecc-step-size = <512>;
diff --git a/arch/arm/boot/dts/bcm7445.dtsi b/arch/arm/boot/dts/bcm7445.dtsi
index 4791321969b3..3f002f2047f1 100644
--- a/arch/arm/boot/dts/bcm7445.dtsi
+++ b/arch/arm/boot/dts/bcm7445.dtsi
@@ -149,7 +149,7 @@ aon-ctrl@410000 {
 			reg-names = "aon-ctrl", "aon-sram";
 		};
 
-		nand: nand@3e2800 {
+		nand_controller: nand-controller@3e2800 {
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH AUTOSEL 4.4 02/10] ARM: dts: BCM63xx: Fix NAND nodes names
  2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
@ 2021-07-14 19:48 ` Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 03/10] ARM: dts: imx6: phyFLEX: Fix UART hardware flow control Sasha Levin
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Rafał Miłecki, Florian Fainelli, Sasha Levin, devicetree

From: Rafał Miłecki <rafal@milecki.pl>

[ Upstream commit 75e2f012f6e34b93124d1d86eaa8f27df48e9ea0 ]

This matches nand-controller.yaml requirements.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/bcm63138.dtsi    | 2 +-
 arch/arm/boot/dts/bcm963138dvt.dts | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi
index 34cd64051250..84efc3d16f58 100644
--- a/arch/arm/boot/dts/bcm63138.dtsi
+++ b/arch/arm/boot/dts/bcm63138.dtsi
@@ -152,7 +152,7 @@ serial1: serial@620 {
 			status = "disabled";
 		};
 
-		nand: nand@2000 {
+		nand_controller: nand-controller@2000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.0", "brcm,brcmnand";
diff --git a/arch/arm/boot/dts/bcm963138dvt.dts b/arch/arm/boot/dts/bcm963138dvt.dts
index 370aa2cfddf2..439cff69e948 100644
--- a/arch/arm/boot/dts/bcm963138dvt.dts
+++ b/arch/arm/boot/dts/bcm963138dvt.dts
@@ -29,10 +29,10 @@ &serial1 {
 	status = "okay";
 };
 
-&nand {
+&nand_controller {
 	status = "okay";
 
-	nandcs@0 {
+	nand@0 {
 		compatible = "brcm,nandcs";
 		reg = <0>;
 		nand-ecc-strength = <4>;
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH AUTOSEL 4.4 03/10] ARM: dts: imx6: phyFLEX: Fix UART hardware flow control
  2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 02/10] ARM: dts: BCM63xx: Fix " Sasha Levin
@ 2021-07-14 19:48 ` Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 04/10] ARM: imx: pm-imx5: Fix references to imx5_cpu_suspend_info Sasha Levin
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Primoz Fiser, Shawn Guo, Sasha Levin, devicetree, linux-arm-kernel

From: Primoz Fiser <primoz.fiser@norik.com>

[ Upstream commit 14cdc1f243d79e0b46be150502b7dba9c5a6bdfd ]

Serial interface uart3 on phyFLEX board is capable of 5-wire connection
including signals RTS and CTS for hardware flow control.

Fix signals UART3_CTS_B and UART3_RTS_B padmux assignments and add
missing property "uart-has-rtscts" to allow serial interface to be
configured and used with the hardware flow control.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
index cae04e806036..e3e3a7a08d08 100644
--- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
@@ -307,8 +307,8 @@ pinctrl_uart3: uart3grp {
 			fsl,pins = <
 				MX6QDL_PAD_EIM_D24__UART3_TX_DATA	0x1b0b1
 				MX6QDL_PAD_EIM_D25__UART3_RX_DATA	0x1b0b1
-				MX6QDL_PAD_EIM_D30__UART3_RTS_B		0x1b0b1
-				MX6QDL_PAD_EIM_D31__UART3_CTS_B		0x1b0b1
+				MX6QDL_PAD_EIM_D31__UART3_RTS_B		0x1b0b1
+				MX6QDL_PAD_EIM_D30__UART3_CTS_B		0x1b0b1
 			>;
 		};
 
@@ -383,6 +383,7 @@ &pcie {
 &uart3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart3>;
+	uart-has-rtscts;
 	status = "disabled";
 };
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH AUTOSEL 4.4 04/10] ARM: imx: pm-imx5: Fix references to imx5_cpu_suspend_info
  2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 02/10] ARM: dts: BCM63xx: Fix " Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 03/10] ARM: dts: imx6: phyFLEX: Fix UART hardware flow control Sasha Levin
@ 2021-07-14 19:48 ` Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 05/10] ARM: dts: am437x: align gpio hog names with dt-schema Sasha Levin
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jonathan Neuschäfer, Fabio Estevam, Shawn Guo, Sasha Levin,
	linux-arm-kernel

From: Jonathan Neuschäfer <j.neuschaefer@gmx.net>

[ Upstream commit 89b759469d525f4d5f9c29cd3b1f490311c67f85 ]

The name of the struct, as defined in arch/arm/mach-imx/pm-imx5.c,
is imx5_cpu_suspend_info.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/mach-imx/suspend-imx53.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/suspend-imx53.S b/arch/arm/mach-imx/suspend-imx53.S
index 5ed078ad110a..f12d24104075 100644
--- a/arch/arm/mach-imx/suspend-imx53.S
+++ b/arch/arm/mach-imx/suspend-imx53.S
@@ -33,11 +33,11 @@
  *                              ^
  *                              ^
  *                      imx53_suspend code
- *              PM_INFO structure(imx53_suspend_info)
+ *              PM_INFO structure(imx5_cpu_suspend_info)
  * ======================== low address =======================
  */
 
-/* Offsets of members of struct imx53_suspend_info */
+/* Offsets of members of struct imx5_cpu_suspend_info */
 #define SUSPEND_INFO_MX53_M4IF_V_OFFSET		0x0
 #define SUSPEND_INFO_MX53_IOMUXC_V_OFFSET	0x4
 #define SUSPEND_INFO_MX53_IO_COUNT_OFFSET	0x8
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH AUTOSEL 4.4 05/10] ARM: dts: am437x: align gpio hog names with dt-schema
  2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
                   ` (2 preceding siblings ...)
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 04/10] ARM: imx: pm-imx5: Fix references to imx5_cpu_suspend_info Sasha Levin
@ 2021-07-14 19:48 ` Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 06/10] ARM: dts: omap5-board-common: " Sasha Levin
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Grygorii Strashko, Tony Lindgren, Sasha Levin, linux-omap, devicetree

From: Grygorii Strashko <grygorii.strashko@ti.com>

[ Upstream commit bd551acdde3ad40da1a97391abd6e0db7852bf66 ]

The GPIO Hog dt-schema node naming convention expect GPIO hogs node names
to end with a 'hog' suffix.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/am437x-gp-evm.dts  | 4 ++--
 arch/arm/boot/dts/am43x-epos-evm.dts | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts
index 3293484028ad..b5863cc13cfd 100644
--- a/arch/arm/boot/dts/am437x-gp-evm.dts
+++ b/arch/arm/boot/dts/am437x-gp-evm.dts
@@ -660,7 +660,7 @@ &gpio0 {
 	pinctrl-0 = <&gpio0_pins>;
 	status = "okay";
 
-	p23 {
+	sel-emmc-nand-hog {
 		gpio-hog;
 		gpios = <23 GPIO_ACTIVE_HIGH>;
 		/* SelEMMCorNAND selects between eMMC and NAND:
@@ -693,7 +693,7 @@ &gpio5 {
 	status = "okay";
 	ti,no-reset-on-init;
 
-	p8 {
+	sel-lcd-hdmi-hog {
 		/*
 		 * SelLCDorHDMI selects between display and audio paths:
 		 * Low: HDMI display with audio via HDMI
diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts b/arch/arm/boot/dts/am43x-epos-evm.dts
index a74b09f17a1a..b61feb994526 100644
--- a/arch/arm/boot/dts/am43x-epos-evm.dts
+++ b/arch/arm/boot/dts/am43x-epos-evm.dts
@@ -536,7 +536,7 @@ &gpio2 {
 	pinctrl-0 = <&display_mux_pins>;
 	status = "okay";
 
-	p1 {
+	sel-lcd-hdmi-hog {
 		/*
 		 * SelLCDorHDMI selects between display and audio paths:
 		 * Low: HDMI display with audio via HDMI
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH AUTOSEL 4.4 06/10] ARM: dts: omap5-board-common: align gpio hog names with dt-schema
  2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
                   ` (3 preceding siblings ...)
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 05/10] ARM: dts: am437x: align gpio hog names with dt-schema Sasha Levin
@ 2021-07-14 19:48 ` Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 07/10] thermal/core: Correct function name thermal_zone_device_unregister() Sasha Levin
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Grygorii Strashko, Tony Lindgren, Sasha Levin, linux-omap, devicetree

From: Grygorii Strashko <grygorii.strashko@ti.com>

[ Upstream commit 4823117cb80eedf31ddbc126b9bd92e707bd9a26 ]

The GPIO Hog dt-schema node naming convention expect GPIO hogs node names
to end with a 'hog' suffix.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/omap5-board-common.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap5-board-common.dtsi b/arch/arm/boot/dts/omap5-board-common.dtsi
index 41e80e7f20be..282d393b63b6 100644
--- a/arch/arm/boot/dts/omap5-board-common.dtsi
+++ b/arch/arm/boot/dts/omap5-board-common.dtsi
@@ -132,7 +132,7 @@ sound: sound {
 
 &gpio8 {
 	/* TI trees use GPIO instead of msecure, see also muxing */
-	p234 {
+	msecure-hog {
 		gpio-hog;
 		gpios = <10 GPIO_ACTIVE_HIGH>;
 		output-high;
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH AUTOSEL 4.4 07/10] thermal/core: Correct function name thermal_zone_device_unregister()
  2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
                   ` (4 preceding siblings ...)
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 06/10] ARM: dts: omap5-board-common: " Sasha Levin
@ 2021-07-14 19:48 ` Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 08/10] kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set Sasha Levin
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Yang Yingliang, Daniel Lezcano, Sasha Levin, linux-pm

From: Yang Yingliang <yangyingliang@huawei.com>

[ Upstream commit a052b5118f13febac1bd901fe0b7a807b9d6b51c ]

Fix the following make W=1 kernel build warning:

  drivers/thermal/thermal_core.c:1376: warning: expecting prototype for thermal_device_unregister(). Prototype was for thermal_zone_device_unregister() instead

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210517051020.3463536-1-yangyingliang@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/thermal/thermal_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index a6df07786362..94497787a076 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1956,7 +1956,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
 EXPORT_SYMBOL_GPL(thermal_zone_device_register);
 
 /**
- * thermal_device_unregister - removes the registered thermal zone device
+ * thermal_zone_device_unregister - removes the registered thermal zone device
  * @tz: the thermal zone device to remove
  */
 void thermal_zone_device_unregister(struct thermal_zone_device *tz)
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH AUTOSEL 4.4 08/10] kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set
  2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
                   ` (5 preceding siblings ...)
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 07/10] thermal/core: Correct function name thermal_zone_device_unregister() Sasha Levin
@ 2021-07-14 19:48 ` Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 09/10] scsi: aic7xxx: Fix unintentional sign extension issue on left shift of u8 Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 10/10] sched/fair: Fix CFS bandwidth hrtimer expiry type Sasha Levin
  8 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Matthias Maennich, Masahiro Yamada, Sasha Levin, linux-kbuild

From: Matthias Maennich <maennich@google.com>

[ Upstream commit a979522a1a88556e42a22ce61bccc58e304cb361 ]

To avoid unnecessary recompilations, mkcompile_h does not regenerate
compile.h if just the timestamp changed.
Though, if KBUILD_BUILD_TIMESTAMP is set, an explicit timestamp for the
build was requested, in which case we should not ignore it.

If a user follows the documentation for reproducible builds [1] and
defines KBUILD_BUILD_TIMESTAMP as the git commit timestamp, a clean
build will have the correct timestamp. A subsequent cherry-pick (or
amend) changes the commit timestamp and if an incremental build is done
with a different KBUILD_BUILD_TIMESTAMP now, that new value is not taken
into consideration. But it should for reproducibility.

Hence, whenever KBUILD_BUILD_TIMESTAMP is explicitly set, do not ignore
UTS_VERSION when making a decision about whether the regenerated version
of compile.h should be moved into place.

[1] https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html

Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 scripts/mkcompile_h | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index 6fdc97ef6023..cb73747002ed 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -82,15 +82,23 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
 # Only replace the real compile.h if the new one is different,
 # in order to preserve the timestamp and avoid unnecessary
 # recompilations.
-# We don't consider the file changed if only the date/time changed.
+# We don't consider the file changed if only the date/time changed,
+# unless KBUILD_BUILD_TIMESTAMP was explicitly set (e.g. for
+# reproducible builds with that value referring to a commit timestamp).
 # A kernel config change will increase the generation number, thus
 # causing compile.h to be updated (including date/time) due to the
 # changed comment in the
 # first line.
 
+if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
+   IGNORE_PATTERN="UTS_VERSION"
+else
+   IGNORE_PATTERN="NOT_A_PATTERN_TO_BE_MATCHED"
+fi
+
 if [ -r $TARGET ] && \
-      grep -v 'UTS_VERSION' $TARGET > .tmpver.1 && \
-      grep -v 'UTS_VERSION' .tmpcompile > .tmpver.2 && \
+      grep -v $IGNORE_PATTERN $TARGET > .tmpver.1 && \
+      grep -v $IGNORE_PATTERN .tmpcompile > .tmpver.2 && \
       cmp -s .tmpver.1 .tmpver.2; then
    rm -f .tmpcompile
 else
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH AUTOSEL 4.4 09/10] scsi: aic7xxx: Fix unintentional sign extension issue on left shift of u8
  2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
                   ` (6 preceding siblings ...)
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 08/10] kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set Sasha Levin
@ 2021-07-14 19:48 ` Sasha Levin
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 10/10] sched/fair: Fix CFS bandwidth hrtimer expiry type Sasha Levin
  8 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Colin Ian King, Martin K . Petersen, Sasha Levin, linux-scsi

From: Colin Ian King <colin.king@canonical.com>

[ Upstream commit 332a9dd1d86f1e7203fc7f0fd7e82f0b304200fe ]

The shifting of the u8 integer returned fom ahc_inb(ahc, port+3) by 24 bits
to the left will be promoted to a 32 bit signed int and then sign-extended
to a u64. In the event that the top bit of the u8 is set then all then all
the upper 32 bits of the u64 end up as also being set because of the
sign-extension. Fix this by casting the u8 values to a u64 before the 24
bit left shift.

[ This dates back to 2002, I found the offending commit from the git
history git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git,
commit f58eb66c0b0a ("Update aic7xxx driver to 6.2.10...") ]

Link: https://lore.kernel.org/r/20210621151727.20667-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Unintended sign extension")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index def3208dd290..9b5832b46dec 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -500,7 +500,7 @@ ahc_inq(struct ahc_softc *ahc, u_int port)
 	return ((ahc_inb(ahc, port))
 	      | (ahc_inb(ahc, port+1) << 8)
 	      | (ahc_inb(ahc, port+2) << 16)
-	      | (ahc_inb(ahc, port+3) << 24)
+	      | (((uint64_t)ahc_inb(ahc, port+3)) << 24)
 	      | (((uint64_t)ahc_inb(ahc, port+4)) << 32)
 	      | (((uint64_t)ahc_inb(ahc, port+5)) << 40)
 	      | (((uint64_t)ahc_inb(ahc, port+6)) << 48)
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH AUTOSEL 4.4 10/10] sched/fair: Fix CFS bandwidth hrtimer expiry type
  2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
                   ` (7 preceding siblings ...)
  2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 09/10] scsi: aic7xxx: Fix unintentional sign extension issue on left shift of u8 Sasha Levin
@ 2021-07-14 19:48 ` Sasha Levin
  8 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2021-07-14 19:48 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Odin Ugedal, Peter Zijlstra, Ben Segall, Sasha Levin

From: Odin Ugedal <odin@uged.al>

[ Upstream commit 72d0ad7cb5bad265adb2014dbe46c4ccb11afaba ]

The time remaining until expiry of the refresh_timer can be negative.
Casting the type to an unsigned 64-bit value will cause integer
underflow, making the runtime_refresh_within return false instead of
true. These situations are rare, but they do happen.

This does not cause user-facing issues or errors; other than
possibly unthrottling cfs_rq's using runtime from the previous period(s),
making the CFS bandwidth enforcement less strict in those (special)
situations.

Signed-off-by: Odin Ugedal <odin@uged.al>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ben Segall <bsegall@google.com>
Link: https://lore.kernel.org/r/20210629121452.18429-1-odin@uged.al
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/sched/fair.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 15952d0e340b..e00f17070cb2 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3852,7 +3852,7 @@ static const u64 cfs_bandwidth_slack_period = 5 * NSEC_PER_MSEC;
 static int runtime_refresh_within(struct cfs_bandwidth *cfs_b, u64 min_expire)
 {
 	struct hrtimer *refresh_timer = &cfs_b->period_timer;
-	u64 remaining;
+	s64 remaining;
 
 	/* if the call-back is running a quota refresh is already occurring */
 	if (hrtimer_callback_running(refresh_timer))
@@ -3860,7 +3860,7 @@ static int runtime_refresh_within(struct cfs_bandwidth *cfs_b, u64 min_expire)
 
 	/* is a quota refresh about to occur? */
 	remaining = ktime_to_ns(hrtimer_expires_remaining(refresh_timer));
-	if (remaining < min_expire)
+	if (remaining < (s64)min_expire)
 		return 1;
 
 	return 0;
-- 
2.30.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-14 20:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14 19:48 [PATCH AUTOSEL 4.4 01/10] ARM: brcmstb: dts: fix NAND nodes names Sasha Levin
2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 02/10] ARM: dts: BCM63xx: Fix " Sasha Levin
2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 03/10] ARM: dts: imx6: phyFLEX: Fix UART hardware flow control Sasha Levin
2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 04/10] ARM: imx: pm-imx5: Fix references to imx5_cpu_suspend_info Sasha Levin
2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 05/10] ARM: dts: am437x: align gpio hog names with dt-schema Sasha Levin
2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 06/10] ARM: dts: omap5-board-common: " Sasha Levin
2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 07/10] thermal/core: Correct function name thermal_zone_device_unregister() Sasha Levin
2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 08/10] kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set Sasha Levin
2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 09/10] scsi: aic7xxx: Fix unintentional sign extension issue on left shift of u8 Sasha Levin
2021-07-14 19:48 ` [PATCH AUTOSEL 4.4 10/10] sched/fair: Fix CFS bandwidth hrtimer expiry type Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).