kernel: refresh patches
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
This commit is contained in:
parent
af9044069d
commit
9ac71f1728
@ -1,58 +0,0 @@
|
||||
From 43aab4c0ef594c464167532c686f07a3d2aaa61c Mon Sep 17 00:00:00 2001
|
||||
From: Quentin Schulz <quentin.schulz@cherry.de>
|
||||
Date: Tue, 27 May 2025 13:56:23 +0200
|
||||
Subject: [PATCH] net: stmmac: platform: guarantee uniqueness of bus_id
|
||||
|
||||
bus_id is currently derived from the ethernetX alias. If one is missing
|
||||
for the device, 0 is used. If ethernet0 points to another stmmac device
|
||||
or if there are 2+ stmmac devices without an ethernet alias, then bus_id
|
||||
will be 0 for all of those.
|
||||
|
||||
This is an issue because the bus_id is used to generate the mdio bus id
|
||||
(new_bus->id in drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
|
||||
stmmac_mdio_register) and this needs to be unique.
|
||||
|
||||
This allows to avoid needing to define ethernet aliases for devices with
|
||||
multiple stmmac controllers (such as the Rockchip RK3588) for multiple
|
||||
stmmac devices to probe properly.
|
||||
|
||||
Obviously, the bus_id isn't guaranteed to be stable across reboots if no
|
||||
alias is set for the device but that is easily fixed by simply adding an
|
||||
alias if this is desired.
|
||||
|
||||
Fixes: 25c83b5c2e82 ("dt:net:stmmac: Add support to dwmac version 3.610 and 3.710")
|
||||
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
|
||||
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
|
||||
Link: https://patch.msgid.link/20250527-stmmac-mdio-bus_id-v2-1-a5ca78454e3c@cherry.de
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 11 +++++++++--
|
||||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
|
||||
@@ -419,6 +419,7 @@ stmmac_probe_config_dt(struct platform_d
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct plat_stmmacenet_data *plat;
|
||||
struct stmmac_dma_cfg *dma_cfg;
|
||||
+ static int bus_id = -ENODEV;
|
||||
int phy_mode;
|
||||
void *ret;
|
||||
int rc;
|
||||
@@ -454,8 +455,14 @@ stmmac_probe_config_dt(struct platform_d
|
||||
of_property_read_u32(np, "max-speed", &plat->max_speed);
|
||||
|
||||
plat->bus_id = of_alias_get_id(np, "ethernet");
|
||||
- if (plat->bus_id < 0)
|
||||
- plat->bus_id = 0;
|
||||
+ if (plat->bus_id < 0) {
|
||||
+ if (bus_id < 0)
|
||||
+ bus_id = of_alias_get_highest_id("ethernet");
|
||||
+ /* No ethernet alias found, init at -1 so first bus_id is 0 */
|
||||
+ if (bus_id < 0)
|
||||
+ bus_id = -1;
|
||||
+ plat->bus_id = ++bus_id;
|
||||
+ }
|
||||
|
||||
/* Default to phy auto-detection */
|
||||
plat->phy_addr = -1;
|
||||
@ -11,7 +11,7 @@ Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
|
||||
|
||||
--- a/drivers/leds/trigger/ledtrig-netdev.c
|
||||
+++ b/drivers/leds/trigger/ledtrig-netdev.c
|
||||
@@ -486,8 +486,9 @@ static int netdev_trig_notify(struct not
|
||||
@@ -476,8 +476,9 @@ static int netdev_trig_notify(struct not
|
||||
return NOTIFY_DONE;
|
||||
|
||||
if (!(dev == trigger_data->net_dev ||
|
||||
@ -23,7 +23,7 @@ Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
|
||||
return NOTIFY_DONE;
|
||||
|
||||
cancel_delayed_work_sync(&trigger_data->work);
|
||||
@@ -507,8 +508,10 @@ static int netdev_trig_notify(struct not
|
||||
@@ -497,8 +498,10 @@ static int netdev_trig_notify(struct not
|
||||
get_device_state(trigger_data);
|
||||
break;
|
||||
case NETDEV_UNREGISTER:
|
||||
|
||||
@ -13,7 +13,7 @@ Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
|
||||
|
||||
--- a/drivers/leds/trigger/ledtrig-netdev.c
|
||||
+++ b/drivers/leds/trigger/ledtrig-netdev.c
|
||||
@@ -212,7 +212,7 @@ static void get_device_state(struct led_
|
||||
@@ -207,7 +207,7 @@ static void get_device_state(struct led_
|
||||
{
|
||||
struct ethtool_link_ksettings cmd;
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ for better compatible
|
||||
#define MODULE_ARCH_INIT {}
|
||||
--- a/kernel/module/main.c
|
||||
+++ b/kernel/module/main.c
|
||||
@@ -1550,6 +1550,16 @@ static void __layout_sections(struct mod
|
||||
@@ -1552,6 +1552,16 @@ static void __layout_sections(struct mod
|
||||
if (WARN_ON_ONCE(type == MOD_INVALID))
|
||||
continue;
|
||||
|
||||
@ -70,7 +70,7 @@ for better compatible
|
||||
s->sh_entsize = module_get_offset_and_type(mod, type, s, i);
|
||||
pr_debug("\t%s\n", sname);
|
||||
}
|
||||
@@ -1870,11 +1880,19 @@ static int elf_validity_cache_copy(struc
|
||||
@@ -1872,11 +1882,19 @@ static int elf_validity_cache_copy(struc
|
||||
goto no_exec;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ for better compatible
|
||||
|
||||
info->index.mod = mod_idx;
|
||||
|
||||
@@ -2277,11 +2295,19 @@ static int move_module(struct module *mo
|
||||
@@ -2279,11 +2297,19 @@ static int move_module(struct module *mo
|
||||
* end up copying over all modifications made to the
|
||||
* userspace copy of the entire struct module.
|
||||
*/
|
||||
@ -110,7 +110,7 @@ for better compatible
|
||||
memcpy(dest, (void *)shdr->sh_addr, shdr->sh_size);
|
||||
}
|
||||
/*
|
||||
@@ -2291,6 +2317,11 @@ static int move_module(struct module *mo
|
||||
@@ -2293,6 +2319,11 @@ static int move_module(struct module *mo
|
||||
* minted official memory area.
|
||||
*/
|
||||
shdr->sh_addr = (unsigned long)dest;
|
||||
|
||||
@ -128,7 +128,7 @@ linux/sched.h: move tracing to the end of struct
|
||||
struct mod_kallsyms __rcu *kallsyms;
|
||||
--- a/include/linux/sched.h
|
||||
+++ b/include/linux/sched.h
|
||||
@@ -1407,11 +1407,6 @@ struct task_struct {
|
||||
@@ -1405,11 +1405,6 @@ struct task_struct {
|
||||
atomic_t tracing_graph_pause;
|
||||
#endif
|
||||
|
||||
@ -140,7 +140,7 @@ linux/sched.h: move tracing to the end of struct
|
||||
#ifdef CONFIG_KCOV
|
||||
/* See kernel/kcov.c for more details. */
|
||||
|
||||
@@ -1511,13 +1506,6 @@ struct task_struct {
|
||||
@@ -1509,13 +1504,6 @@ struct task_struct {
|
||||
int mce_count;
|
||||
#endif
|
||||
|
||||
@ -154,7 +154,7 @@ linux/sched.h: move tracing to the end of struct
|
||||
#ifdef CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH
|
||||
/*
|
||||
* If L1D flush is supported on mm context switch
|
||||
@@ -1542,6 +1530,18 @@ struct task_struct {
|
||||
@@ -1540,6 +1528,18 @@ struct task_struct {
|
||||
struct user_event_mm *user_event_mm;
|
||||
#endif
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ Signed-off-by: jjm2473 <jjm2473@gmail.com>
|
||||
|
||||
--- a/include/linux/sched.h
|
||||
+++ b/include/linux/sched.h
|
||||
@@ -943,10 +943,6 @@ struct task_struct {
|
||||
@@ -941,10 +941,6 @@ struct task_struct {
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
unsigned use_memdelay:1;
|
||||
#endif
|
||||
@ -21,7 +21,7 @@ Signed-off-by: jjm2473 <jjm2473@gmail.com>
|
||||
#ifdef CONFIG_PAGE_OWNER
|
||||
/* Used by page_owner=on to detect recursion in page tracking. */
|
||||
unsigned in_page_owner:1;
|
||||
@@ -1206,10 +1202,6 @@ struct task_struct {
|
||||
@@ -1204,10 +1200,6 @@ struct task_struct {
|
||||
kernel_siginfo_t *last_siginfo;
|
||||
|
||||
struct task_io_accounting ioac;
|
||||
@ -32,7 +32,7 @@ Signed-off-by: jjm2473 <jjm2473@gmail.com>
|
||||
#ifdef CONFIG_TASK_XACCT
|
||||
/* Accumulated RSS usage: */
|
||||
u64 acct_rss_mem1;
|
||||
@@ -1530,6 +1522,13 @@ struct task_struct {
|
||||
@@ -1528,6 +1520,13 @@ struct task_struct {
|
||||
struct user_event_mm *user_event_mm;
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user