]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: setup default RX channel map in stmmac_plat_dat_alloc()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 14 Nov 2025 15:29:00 +0000 (15:29 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 18 Nov 2025 03:47:58 +0000 (19:47 -0800)
Setup the default 1:1 RX channel map in stmmac_plat_dat_alloc() and
remove 1:1 initialisations from platform glue drivers.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vJvjQ-0000000EVk6-05z7@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/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index 55f97b2f4e04e7b634a9f54bdb77df5ff580bd28..1fd6faa0c70caada20ebcbf033c4657464f837ee 100644 (file)
@@ -618,7 +618,6 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
 
        for (i = 0; i < plat->rx_queues_to_use; i++) {
                plat->rx_queues_cfg[i].mode_to_use = MTL_QUEUE_DCB;
-               plat->rx_queues_cfg[i].chan = i;
 
                /* Disable Priority config by default */
                plat->rx_queues_cfg[i].use_prio = false;
index c7763db011d65d1077175139af97f2d1838e3edb..d08ff8f5ff153717ed98c7b716016ef666706fa2 100644 (file)
@@ -7558,6 +7558,7 @@ static void stmmac_unregister_devlink(struct stmmac_priv *priv)
 struct plat_stmmacenet_data *stmmac_plat_dat_alloc(struct device *dev)
 {
        struct plat_stmmacenet_data *plat_dat;
+       int i;
 
        plat_dat = devm_kzalloc(dev, sizeof(*plat_dat), GFP_KERNEL);
        if (!plat_dat)
@@ -7580,6 +7581,10 @@ struct plat_stmmacenet_data *stmmac_plat_dat_alloc(struct device *dev)
        plat_dat->tx_queues_to_use = 1;
        plat_dat->rx_queues_to_use = 1;
 
+       /* Setup the default RX queue channel map */
+       for (i = 0; i < ARRAY_SIZE(plat_dat->rx_queues_cfg); i++)
+               plat_dat->rx_queues_cfg[i].chan = i;
+
        return plat_dat;
 }
 EXPORT_SYMBOL_GPL(stmmac_plat_dat_alloc);
index 8c7188ff658be3081f3bd23240024ab4f13ee839..ded44846f74aed96f651ee3f0c844119234caf40 100644 (file)
@@ -86,7 +86,6 @@ static int snps_gmac5_default_data(struct pci_dev *pdev,
                plat->rx_queues_cfg[i].use_prio = false;
                plat->rx_queues_cfg[i].mode_to_use = MTL_QUEUE_DCB;
                plat->rx_queues_cfg[i].pkt_route = 0x0;
-               plat->rx_queues_cfg[i].chan = i;
        }
 
        plat->bus_id = 1;
index e1e23ee0b48efaefce7710c250d311e92928ffaf..7eb22511acf594737c0376bb7bbcfd693c1e2a27 100644 (file)
@@ -177,9 +177,8 @@ static int stmmac_mtl_setup(struct platform_device *pdev,
                else
                        plat->rx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB;
 
-               if (of_property_read_u32(q_node, "snps,map-to-dma-channel",
-                                        &plat->rx_queues_cfg[queue].chan))
-                       plat->rx_queues_cfg[queue].chan = queue;
+               of_property_read_u32(q_node, "snps,map-to-dma-channel",
+                                    &plat->rx_queues_cfg[queue].chan);
                /* TODO: Dynamic mapping to be included in the future */
 
                if (of_property_read_u32(q_node, "snps,priority",