]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: move initialisation of queues_to_use to stmmac_plat_dat_alloc()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 14 Nov 2025 15:28:54 +0000 (15:28 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 18 Nov 2025 03:47:58 +0000 (19:47 -0800)
Move the default initialisation of plat_dat->tx_queues_to_use and
plat_dat->rx_queues_to_use to 1 to stmmac_plat_dat_alloc(). This means
platform glue only needs to override this if different.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vJvjK-0000000EVk0-3qb2@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index de07cca2e6256163e7eb66fc2c720ec29a973ef2..55f97b2f4e04e7b634a9f54bdb77df5ff580bd28 100644 (file)
@@ -570,10 +570,6 @@ static void common_default_data(struct plat_stmmacenet_data *plat)
 
        plat->mdio_bus_data->needs_reset = true;
 
-       /* Set default number of RX and TX queues to use */
-       plat->tx_queues_to_use = 1;
-       plat->rx_queues_to_use = 1;
-
        /* Disable Priority config by default */
        plat->tx_queues_cfg[0].use_prio = false;
        plat->rx_queues_cfg[0].use_prio = false;
index 99b2d2deacebb24fcd8c8a2cb8579312e77835ab..ed5e9ca738bf7aa3189d54d50d9753a487b495a0 100644 (file)
@@ -131,8 +131,6 @@ static void loongson_default_data(struct pci_dev *pdev,
                break;
        default:
                ld->multichan = 0;
-               plat->tx_queues_to_use = 1;
-               plat->rx_queues_to_use = 1;
                break;
        }
 }
index 1d12835d14ce445d008b1909cbd665ea1e124fd6..c7763db011d65d1077175139af97f2d1838e3edb 100644 (file)
@@ -7576,6 +7576,10 @@ struct plat_stmmacenet_data *stmmac_plat_dat_alloc(struct device *dev)
        plat_dat->multicast_filter_bins = HASH_TABLE_SIZE;
        plat_dat->unicast_filter_entries = 1;
 
+       /* Set the mtl defaults */
+       plat_dat->tx_queues_to_use = 1;
+       plat_dat->rx_queues_to_use = 1;
+
        return plat_dat;
 }
 EXPORT_SYMBOL_GPL(stmmac_plat_dat_alloc);
index aea615e76dac07a69d4bd8c378b48dca2833e0e8..8c7188ff658be3081f3bd23240024ab4f13ee839 100644 (file)
@@ -28,10 +28,6 @@ static void common_default_data(struct plat_stmmacenet_data *plat)
 
        plat->mdio_bus_data->needs_reset = true;
 
-       /* Set default number of RX and TX queues to use */
-       plat->tx_queues_to_use = 1;
-       plat->rx_queues_to_use = 1;
-
        /* Disable Priority config by default */
        plat->tx_queues_cfg[0].use_prio = false;
        plat->rx_queues_cfg[0].use_prio = false;
index 314cb3e720fd56010609e2172086d9f60e5b9998..e1e23ee0b48efaefce7710c250d311e92928ffaf 100644 (file)
@@ -137,13 +137,6 @@ static int stmmac_mtl_setup(struct platform_device *pdev,
        u8 queue = 0;
        int ret = 0;
 
-       /* For backwards-compatibility with device trees that don't have any
-        * snps,mtl-rx-config or snps,mtl-tx-config properties, we fall back
-        * to one RX and TX queues each.
-        */
-       plat->rx_queues_to_use = 1;
-       plat->tx_queues_to_use = 1;
-
        /* First Queue must always be in DCB mode. As MTL_QUEUE_DCB = 1 we need
         * to always set this, otherwise Queue will be classified as AVB
         * (because MTL_QUEUE_AVB = 0).
@@ -162,9 +155,8 @@ static int stmmac_mtl_setup(struct platform_device *pdev,
        }
 
        /* Processing RX queues common config */
-       if (of_property_read_u32(rx_node, "snps,rx-queues-to-use",
-                                &plat->rx_queues_to_use))
-               plat->rx_queues_to_use = 1;
+       of_property_read_u32(rx_node, "snps,rx-queues-to-use",
+                            &plat->rx_queues_to_use);
 
        if (of_property_read_bool(rx_node, "snps,rx-sched-sp"))
                plat->rx_sched_algorithm = MTL_RX_ALGORITHM_SP;
@@ -221,9 +213,8 @@ static int stmmac_mtl_setup(struct platform_device *pdev,
        }
 
        /* Processing TX queues common config */
-       if (of_property_read_u32(tx_node, "snps,tx-queues-to-use",
-                                &plat->tx_queues_to_use))
-               plat->tx_queues_to_use = 1;
+       of_property_read_u32(tx_node, "snps,tx-queues-to-use",
+                            &plat->tx_queues_to_use);
 
        if (of_property_read_bool(tx_node, "snps,tx-sched-wrr"))
                plat->tx_sched_algorithm = MTL_TX_ALGORITHM_WRR;