]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jun 2021 14:03:39 +0000 (16:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jun 2021 14:03:39 +0000 (16:03 +0200)
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

queue-5.4/net-fec_ptp-add-clock-rate-zero-check.patch [new file with mode: 0644]
queue-5.4/net-stmmac-disable-clocks-in-stmmac_remove_config_dt.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch [new file with mode: 0644]

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 (file)
index 0000000..530d341
--- /dev/null
@@ -0,0 +1,33 @@
+From cb3cefe3f3f8af27c6076ef7d1f00350f502055d Mon Sep 17 00:00:00 2001
+From: Fugang Duan <fugang.duan@nxp.com>
+Date: Wed, 16 Jun 2021 17:14:25 +0800
+Subject: net: fec_ptp: add clock rate zero check
+
+From: Fugang Duan <fugang.duan@nxp.com>
+
+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 <fugang.duan@nxp.com>
+Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..f548a69
--- /dev/null
@@ -0,0 +1,36 @@
+From 8f269102baf788aecfcbbc6313b6bceb54c9b990 Mon Sep 17 00:00:00 2001
+From: Joakim Zhang <qiangqing.zhang@nxp.com>
+Date: Wed, 16 Jun 2021 17:10:24 +0800
+Subject: net: stmmac: disable clocks in stmmac_remove_config_dt()
+
+From: Joakim Zhang <qiangqing.zhang@nxp.com>
+
+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 <qiangqing.zhang@nxp.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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);
+ }
index a8f19568affd03240b2fe3e0018b1a28de57a9a7..fe404a149621bf91acdeec47c63bf6ab7158f2dc 100644 (file)
@@ -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 (file)
index 0000000..1ad75be
--- /dev/null
@@ -0,0 +1,44 @@
+From 1792a59eab9593de2eae36c40c5a22d70f52c026 Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+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 <acme@redhat.com>
+
+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 <davem@davemloft.net>
+Cc: Toke Høiland-Jørgensen <toke@redhat.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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