From: Greg Kroah-Hartman Date: Mon, 21 Jun 2021 14:03:39 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v5.4.128~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35f60a3ba717fb2507fc5d314156ecbc1f72b996;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: net-fec_ptp-add-clock-rate-zero-check.patch net-stmmac-disable-clocks-in-stmmac_remove_config_dt.patch tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch --- diff --git a/queue-5.4/net-fec_ptp-add-clock-rate-zero-check.patch b/queue-5.4/net-fec_ptp-add-clock-rate-zero-check.patch new file mode 100644 index 00000000000..530d3413811 --- /dev/null +++ b/queue-5.4/net-fec_ptp-add-clock-rate-zero-check.patch @@ -0,0 +1,33 @@ +From cb3cefe3f3f8af27c6076ef7d1f00350f502055d Mon Sep 17 00:00:00 2001 +From: Fugang Duan +Date: Wed, 16 Jun 2021 17:14:25 +0800 +Subject: net: fec_ptp: add clock rate zero check + +From: Fugang Duan + +commit cb3cefe3f3f8af27c6076ef7d1f00350f502055d upstream. + +Add clock rate zero check to fix coverity issue of "divide by 0". + +Fixes: commit 85bd1798b24a ("net: fec: fix spin_lock dead lock") +Signed-off-by: Fugang Duan +Signed-off-by: Joakim Zhang +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/freescale/fec_ptp.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/net/ethernet/freescale/fec_ptp.c ++++ b/drivers/net/ethernet/freescale/fec_ptp.c +@@ -597,6 +597,10 @@ void fec_ptp_init(struct platform_device + fep->ptp_caps.enable = fec_ptp_enable; + + fep->cycle_speed = clk_get_rate(fep->clk_ptp); ++ if (!fep->cycle_speed) { ++ fep->cycle_speed = NSEC_PER_SEC; ++ dev_err(&fep->pdev->dev, "clk_ptp clock rate is zero\n"); ++ } + fep->ptp_inc = NSEC_PER_SEC / fep->cycle_speed; + + spin_lock_init(&fep->tmreg_lock); diff --git a/queue-5.4/net-stmmac-disable-clocks-in-stmmac_remove_config_dt.patch b/queue-5.4/net-stmmac-disable-clocks-in-stmmac_remove_config_dt.patch new file mode 100644 index 00000000000..f548a69d5e9 --- /dev/null +++ b/queue-5.4/net-stmmac-disable-clocks-in-stmmac_remove_config_dt.patch @@ -0,0 +1,36 @@ +From 8f269102baf788aecfcbbc6313b6bceb54c9b990 Mon Sep 17 00:00:00 2001 +From: Joakim Zhang +Date: Wed, 16 Jun 2021 17:10:24 +0800 +Subject: net: stmmac: disable clocks in stmmac_remove_config_dt() + +From: Joakim Zhang + +commit 8f269102baf788aecfcbbc6313b6bceb54c9b990 upstream. + +Platform drivers may call stmmac_probe_config_dt() to parse dt, could +call stmmac_remove_config_dt() in error handing after dt parsed, so need +disable clocks in stmmac_remove_config_dt(). + +Go through all platforms drivers which use stmmac_probe_config_dt(), +none of them disable clocks manually, so it's safe to disable them in +stmmac_remove_config_dt(). + +Fixes: commit d2ed0a7755fe ("net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks") +Signed-off-by: Joakim Zhang +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +@@ -624,6 +624,8 @@ error_pclk_get: + void stmmac_remove_config_dt(struct platform_device *pdev, + struct plat_stmmacenet_data *plat) + { ++ clk_disable_unprepare(plat->stmmac_clk); ++ clk_disable_unprepare(plat->pclk); + of_node_put(plat->phy_node); + of_node_put(plat->mdio_node); + } diff --git a/queue-5.4/series b/queue-5.4/series index a8f19568aff..fe404a14962 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -78,3 +78,6 @@ net-bridge-fix-vlan-tunnel-dst-refcnt-when-egressing.patch mm-slub-clarify-verification-reporting.patch mm-slub-fix-redzoning-for-small-allocations.patch mm-slub.c-include-swab.h.patch +net-stmmac-disable-clocks-in-stmmac_remove_config_dt.patch +net-fec_ptp-add-clock-rate-zero-check.patch +tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch diff --git a/queue-5.4/tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch b/queue-5.4/tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch new file mode 100644 index 00000000000..1ad75be697e --- /dev/null +++ b/queue-5.4/tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch @@ -0,0 +1,44 @@ +From 1792a59eab9593de2eae36c40c5a22d70f52c026 Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Sat, 19 Jun 2021 10:15:22 -0300 +Subject: tools headers UAPI: Sync linux/in.h copy with the kernel sources +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Arnaldo Carvalho de Melo + +commit 1792a59eab9593de2eae36c40c5a22d70f52c026 upstream. + +To pick the changes in: + + 321827477360934d ("icmp: don't send out ICMP messages with a source address of 0.0.0.0") + +That don't result in any change in tooling, as INADDR_ are not used to +generate id->string tables used by 'perf trace'. + +This addresses this build warning: + + Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h' + diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h + +Cc: David S. Miller +Cc: Toke Høiland-Jørgensen +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/include/uapi/linux/in.h | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/include/uapi/linux/in.h ++++ b/tools/include/uapi/linux/in.h +@@ -284,6 +284,9 @@ struct sockaddr_in { + /* Address indicating an error return. */ + #define INADDR_NONE ((unsigned long int) 0xffffffff) + ++/* Dummy address for src of ICMP replies if no real address is set (RFC7600). */ ++#define INADDR_DUMMY ((unsigned long int) 0xc0000008) ++ + /* Network number for local host loopback. */ + #define IN_LOOPBACKNET 127 +