From: Tomasz Maciej Nowak <tmn505(a)gmail.com>
commit 5253cb8c00a6f4356760efb38bca0e0393aa06de upstream.
The maker of this board and its variants, stores MAC address in U-Boot
environment. Add alias for bootloader to recognise, to which ethernet
node inject the factory MAC address.
Signed-off-by: Tomasz Maciej Nowak <tmn505(a)gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement(a)bootlin.com>
[pali: Backported to 4.14]
Signed-off-by: Pali Rohár <pali(a)kernel.org>
---
This patch is backport for 4.14 stable release. From original patch were
removed aliases for uarts as they are not defined in 4.14 kernel version.
Stable releases 4.19 and 5.4 already contain backport of this patch.
---
arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
index 2ce52ba74f73..13c0ec053ada 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
@@ -52,6 +52,10 @@
model = "Globalscale Marvell ESPRESSOBin Board";
compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
+ aliases {
+ ethernet0 = ð0;
+ };
+
chosen {
stdout-path = "serial0:115200n8";
};
--
2.20.1
commit b64d814257b027e29a474bcd660f6372490138c7 upstream.
Espressobin boards have 3 ethernet ports and some of them got assigned more
then one MAC address. MAC addresses are stored in U-Boot environment.
Since commit a2c7023f7075c ("net: dsa: read mac address from DT for slave
device") kernel can use MAC addresses from DT for particular DSA port.
Currently Espressobin DTS file contains alias just for ethernet0.
This patch defines additional ethernet aliases in Espressobin DTS files, so
bootloader can fill correct MAC address for DSA switch ports if more MAC
addresses were specified.
DT alias ethernet1 is used for wan port, DT aliases ethernet2 and ethernet3
are used for lan ports for both Espressobin revisions (V5 and V7).
Fixes: 5253cb8c00a6f ("arm64: dts: marvell: espressobin: add ethernet alias")
Cc: <stable(a)vger.kernel.org> # a2c7023f7075c: dsa: read mac address
Signed-off-by: Pali Rohár <pali(a)kernel.org>
Reviewed-by: Andrew Lunn <andrew(a)lunn.ch>
Reviewed-by: Andre Heider <a.heider(a)gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement(a)bootlin.com>
[pali: Backported Espressobin rev V5 changes to 5.4 and 4.19 versions]
---
This patch is backport for 5.4 and 4.19 stable releases. From original
patch were removed changes for Espressobin revision V7 as these older
kernel versions have DTS files only for Espressobin revision V5.
Note that this patch depends on commit a2c7023f7075c ("dsa: read mac
address") as stated on Cc: line and for 4.19 release needs to be
backported first.
---
.../boot/dts/marvell/armada-3720-espressobin.dts | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
index 05dc58c13fa4..6226e7e80980 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
@@ -21,6 +21,10 @@
aliases {
ethernet0 = ð0;
+ /* for dsa slave device */
+ ethernet1 = &switch0port1;
+ ethernet2 = &switch0port2;
+ ethernet3 = &switch0port3;
serial0 = &uart0;
serial1 = &uart1;
};
@@ -147,7 +151,7 @@
#address-cells = <1>;
#size-cells = <0>;
- port@0 {
+ switch0port0: port@0 {
reg = <0>;
label = "cpu";
ethernet = <ð0>;
@@ -158,19 +162,19 @@
};
};
- port@1 {
+ switch0port1: port@1 {
reg = <1>;
label = "wan";
phy-handle = <&switch0phy0>;
};
- port@2 {
+ switch0port2: port@2 {
reg = <2>;
label = "lan0";
phy-handle = <&switch0phy1>;
};
- port@3 {
+ switch0port3: port@3 {
reg = <3>;
label = "lan1";
phy-handle = <&switch0phy2>;
--
2.20.1
perf may fail to build in v4.19.y with the following error.
util/evsel.c: In function ‘perf_evsel__exit’:
util/util.h:25:28: error:
passing argument 1 of ‘free’ discards ‘const’ qualifier from pointer target type
This is observed (at least) with gcc v6.5.0. The underlying problem is
the following statement.
zfree(&evsel->pmu_name);
evsel->pmu_name is decared 'const *'. zfree in turn is defined as
#define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
and thus passes the const * to free(). The problem is not seen
in the upstream kernel since zfree() has been rewritten there.
The problem has been introduced into v4.19.y with the backport of upstream
commit d4953f7ef1a2 (perf parse-events: Fix 3 use after frees found with
clang ASAN).
One possible fix of this problem would be to not declare pmu_name
as const. This patch chooses to typecast the parameter of zfree()
to void *, following the guidance from the upstream kernel which
does the same since commit 7f7c536f23e6a ("tools lib: Adopt
zalloc()/zfree() from tools/perf")
Fixes: a0100a363098 ("perf parse-events: Fix 3 use after frees found with clang ASAN")
Signed-off-by: Guenter Roeck <linux(a)roeck-us.net>
---
This patch only applies to v4.19.y and has no upstream equivalent.
tools/perf/util/util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index dc58254a2b69..8c01b2cfdb1a 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -22,7 +22,7 @@ static inline void *zalloc(size_t size)
return calloc(1, size);
}
-#define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
+#define zfree(ptr) ({ free((void *)*ptr); *ptr = NULL; })
struct dirent;
struct nsinfo;
--
2.17.1
.. oh, and I suspect it should have been marked for stable.
I added Oleg's ack (implicit in an earlier thread), but didn't add a stable tag.
It's commit b4e00444cab4 ("fork: fix copy_process(CLONE_PARENT) race
with the exiting ->real_parent") in my tree.
I'm not sure how serious it is. Yeah, the race can cause the wrong
exit signal in theory, but I think you almost have to do it with
cooperating processes, at which point you could have just done it
intentionally in the first place.
But it does look like a real data race, and the fix looks small and
obvious enough that I think it's stable material.
Oleg?
Linus
On Sun, Nov 8, 2020 at 11:19 AM Linus Torvalds
<torvalds(a)linux-foundation.org> wrote:
>
> On Fri, Nov 6, 2020 at 10:47 PM Eddy Wu <itseddy0402(a)gmail.com> wrote:
> >
> > current->group_leader->exit_signal may change during copy_process() if
> > current->real_parent exits, move the assignment inside tasklist_lock to avoid
> > the race.
>
> Applied. Thanks,
>
> Linus