Skip to contentSkip to conversation

Some bug fixes

PATCH Applied Yanteng Si 3 participants 6 messages Dec 11, 2023 – Dec 13, 2023

Subsystems (7)
lore
Share & tools
lore

Yanteng Si

author
#0 lore raw

cover Some bug fixes

* Put Krzysztof's patch into my thread, pick Conor's Reviewed-by tag and Jiaxun's Acked-by tag.(prev version is RFC patch)

* I fixed an Oops related to mdio, mainly to ensure that mdio is initialized before use, because it will be used in a series of patches I am working on.

see <https://lore.kernel.org/loongarch/[email protected]/T/#t>

Krzysztof Kozlowski (2):
stmmac: dwmac-loongson: drop useless check for compatible fallback
MIPS: dts: loongson: drop incorrect dwmac fallback compatible

Yanteng Si (1):
stmmac: dwmac-loongson: Make sure MDIO is initialized before use

 .../boot/dts/loongson/loongson64-2k1000.dtsi  |  3 +--
 arch/mips/boot/dts/loongson/ls7a-pch.dtsi     |  3 +--
 .../ethernet/stmicro/stmmac/dwmac-loongson.c  | 19 ++++++-------------
 3 files changed, 8 insertions(+), 17 deletions(-)
Signature · 1 line
2.31.4
author
#1 lore raw

PATCH 1/3 stmmac: dwmac-loongson: Make sure MDIO is initialized before use

Generic code will use mdio. If it is not initialized before use, the kernel will Oops.

Fixes 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson")
---
 .../net/ethernet/stmicro/stmmac/dwmac-loongson.c   | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +6 -8
index 2cd6fce5c993..e7701326adc6 100644
@@ -68,17 +68,15 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
 	if (!plat)
 		return -ENOMEM;
 
+	plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
+					   sizeof(*plat->mdio_bus_data),
+					   GFP_KERNEL);
+	if (!plat->mdio_bus_data)
+		return -ENOMEM;
+
 	plat->mdio_node = of_get_child_by_name(np, "mdio");
 	if (plat->mdio_node) {
 		dev_info(&pdev->dev, "Found MDIO subnode\n");
-
-		plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
-						   sizeof(*plat->mdio_bus_data),
-						   GFP_KERNEL);
-		if (!plat->mdio_bus_data) {
-			ret = -ENOMEM;
-			goto err_put_node;
-		}
 		plat->mdio_bus_data->needs_reset = true;
 	}
 
Signature · 1 line
2.31.4
author
#3 lore raw

PATCH 2/3 stmmac: dwmac-loongson: drop useless check for compatible fallback

In reply to Yanteng Si

From: Krzysztof Kozlowski <[email protected]>

Device binds to proper PCI ID (LOONGSON, 0x7a03), already listed in DTS, so checking for some other compatible does not make sense. It cannot be bound to unsupported platform.

Drop useless, incorrect (space in between) and undocumented compatible.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +0 -5
index e7701326adc6..9e40c28d453a 100644
@@ -59,11 +59,6 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
 		return -ENODEV;
 	}
 
-	if (!of_device_is_compatible(np, "loongson, pci-gmac")) {
-		pr_info("dwmac_loongson_pci: Incompatible OF node\n");
-		return -ENODEV;
-	}
-
 	plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
 	if (!plat)
 		return -ENOMEM;
Signature · 1 line
2.31.4
author
#4 lore raw

PATCH 3/3 MIPS: dts: loongson: drop incorrect dwmac fallback compatible

In reply to Yanteng Si

From: Krzysztof Kozlowski <[email protected]>

Device binds to proper PCI ID (LOONGSON, 0x7a03), already listed in DTS, so checking for some other compatible does not make sense. It cannot be bound to unsupported platform.

Drop useless, incorrect (space in between) and undocumented compatible.

---
 arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi | 3 +--
 arch/mips/boot/dts/loongson/ls7a-pch.dtsi          | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi +1 -2
index f878f47e4501..ee3e2153dd13 100644
@@ -130,8 +130,7 @@ gmac@3,0 {
 				compatible = "pci0014,7a03.0",
 						   "pci0014,7a03",
 						   "pciclass0c0320",
-						   "pciclass0c03",
-						   "loongson, pci-gmac";
+						   "pciclass0c03";
 
 				reg = <0x1800 0x0 0x0 0x0 0x0>;
 				interrupts = <12 IRQ_TYPE_LEVEL_LOW>,
arch/mips/boot/dts/loongson/ls7a-pch.dtsi +1 -2
index 7c69e8245c2f..cce9428afc41 100644
@@ -193,8 +193,7 @@ gmac@3,0 {
 				compatible = "pci0014,7a03.0",
 						   "pci0014,7a03",
 						   "pciclass020000",
-						   "pciclass0200",
-						   "loongson, pci-gmac";
+						   "pciclass0200";
 
 				reg = <0x1800 0x0 0x0 0x0 0x0>;
 				interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.31.4
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH v1 net 1/3] stmmac: dwmac-loongson: Make sure MDIO is initialized before use

In reply to Yanteng Si
Quoted 6 lines · Yanteng Si

Generic code will use mdio. If it is not initialized before use, the kernel will Oops.

Fixes 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson")

Andrew

#5 lore raw
In reply to Yanteng Si
This series was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Mon, 11 Dec 2023 18:20:32 +0800 you wrote:

* Put Krzysztof's patch into my thread, pick Conor's Reviewed-by tag and Jiaxun's Acked-by tag.(prev version is RFC patch)

* I fixed an Oops related to mdio, mainly to ensure that mdio is initialized before use, because it will be used in a series of patches I am working on.

[...]

Here is the summary with links:
- [v1,net,1/3] stmmac: dwmac-loongson: Make sure MDIO is initialized before use

    https://git.kernel.org/netdev/net/c/e87d3a1370ce
  - [v1,net,2/3] stmmac: dwmac-loongson: drop useless check for compatible fallback
    https://git.kernel.org/netdev/net/c/31fea092c6f9
  - [v1,net,3/3] MIPS: dts: loongson: drop incorrect dwmac fallback compatible
    https://git.kernel.org/netdev/net/c/4907a3f54b12

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html