Skip to contentSkip to conversation

Ethernet common fault IRQ support

PATCH Applied Suraj Jaiswal 2 participants 4 messages Feb 9, 2024 – Feb 12, 2024

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v13 cover Ethernet common fault IRQ support

Changes since v13:
- Update correct sender email

Changes since v12:
- Update correct sender email

Changes since v11:
- Update debug message print

Changes since v10:
- Update commit message

Changes since v9:
- prevent race condition of safety IRQ handling

Changes since v8:
- Use shared IRQ for sfty
- update error message

Changes since v7:
- Add support of common sfty irq on stmmac_request_irq_multi_msi.
- Remove uncecessary blank line.

Changes since v6:
- use name sfty_irq instead of safety_common_irq.

Changes since v5:
- Add description of ECC, DPP, FSM

Changes since v4:
- Fix DT_CHECKER warning
- use name safety for the IRQ.

Suraj Jaiswal (2):
dt-bindings: net: qcom,ethqos: add binding doc for safety IRQ for

    sa8775p

net: stmmac: Add driver support for common safety IRQ

 .../devicetree/bindings/net/qcom,ethqos.yaml  |  9 ++--
 .../devicetree/bindings/net/snps,dwmac.yaml   |  6 ++-
 drivers/net/ethernet/stmicro/stmmac/common.h  |  1 +
 drivers/net/ethernet/stmicro/stmmac/stmmac.h  |  3 ++
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 41 ++++++++++++++++++-
 .../ethernet/stmicro/stmmac/stmmac_platform.c |  8 ++++
 6 files changed, 61 insertions(+), 7 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v13 1/2 dt-bindings: net: qcom,ethqos: add binding doc for safety IRQ for sa8775p

Add binding doc for safety IRQ. The safety IRQ will be triggered for ECC(error correction code), DPP(data path parity), FSM(finite state machine) error.

---
 Documentation/devicetree/bindings/net/qcom,ethqos.yaml | 9 ++++++---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml  | 6 ++++--
 2 files changed, 10 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/net/qcom,ethqos.yaml +6 -3
index 7bdb412a0185..69a337c7e345 100644
@@ -37,12 +37,14 @@ properties:
     items:
       - description: Combined signal for various interrupt events
       - description: The interrupt that occurs when Rx exits the LPI state
+      - description: The interrupt that occurs when HW safety error triggered
 
   interrupt-names:
     minItems: 1
     items:
       - const: macirq
-      - const: eth_lpi
+      - enum: [eth_lpi, sfty]
+      - const: sfty
 
   clocks:
     maxItems: 4
@@ -89,8 +91,9 @@ examples:
                <&gcc GCC_ETH_PTP_CLK>,
                <&gcc GCC_ETH_RGMII_CLK>;
       interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
-                   <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
-      interrupt-names = "macirq", "eth_lpi";
+                   <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
+                   <GIC_SPI 782 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-names = "macirq", "eth_lpi", "sfty";
 
       rx-fifo-depth = <4096>;
       tx-fifo-depth = <4096>;
Documentation/devicetree/bindings/net/snps,dwmac.yaml +4 -2
index 90c4db178c67..6b0341a8e0ea 100644
@@ -108,13 +108,15 @@ properties:
       - description: Combined signal for various interrupt events
       - description: The interrupt to manage the remote wake-up packet detection
       - description: The interrupt that occurs when Rx exits the LPI state
+      - description: The interrupt that occurs when HW safety error triggered
 
   interrupt-names:
     minItems: 1
     items:
       - const: macirq
-      - enum: [eth_wake_irq, eth_lpi]
-      - const: eth_lpi
+      - enum: [eth_wake_irq, eth_lpi, sfty]
+      - enum: [eth_wake_irq, eth_lpi, sfty]
+      - enum: [eth_wake_irq, eth_lpi, sfty]
 
   clocks:
     minItems: 1
Signature · 1 line
2.25.1
#2 lore raw

PATCH v13 2/2 net: stmmac: Add driver support for common safety IRQ

In reply to Suraj Jaiswal

Add support to listen HW safety IRQ like ECC(error correction code), DPP(data path parity), FSM(finite state machine) fault in common IRQ line.

---
 drivers/net/ethernet/stmicro/stmmac/common.h  |  1 +
 drivers/net/ethernet/stmicro/stmmac/stmmac.h  |  3 ++
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 41 ++++++++++++++++++-
 .../ethernet/stmicro/stmmac/stmmac_platform.c |  8 ++++
 4 files changed, 51 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/common.h +1 -0
index 07fe852001a0..a6fefe675ef1 100644
@@ -371,6 +371,7 @@ enum request_irq_err {
 	REQ_IRQ_ERR_ALL,
 	REQ_IRQ_ERR_TX,
 	REQ_IRQ_ERR_RX,
+	REQ_IRQ_ERR_SFTY,
 	REQ_IRQ_ERR_SFTY_UE,
 	REQ_IRQ_ERR_SFTY_CE,
 	REQ_IRQ_ERR_LPI,
drivers/net/ethernet/stmicro/stmmac/stmmac.h +3 -0
index f155e4841c62..dddcaa9220cc 100644
@@ -31,6 +31,7 @@ struct stmmac_resources {
 	int wol_irq;
 	int lpi_irq;
 	int irq;
+	int sfty_irq;
 	int sfty_ce_irq;
 	int sfty_ue_irq;
 	int rx_irq[MTL_MAX_RX_QUEUES];
@@ -298,6 +299,7 @@ struct stmmac_priv {
 	void __iomem *ptpaddr;
 	void __iomem *estaddr;
 	unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
+	int sfty_irq;
 	int sfty_ce_irq;
 	int sfty_ue_irq;
 	int rx_irq[MTL_MAX_RX_QUEUES];
@@ -306,6 +308,7 @@ struct stmmac_priv {
 	char int_name_mac[IFNAMSIZ + 9];
 	char int_name_wol[IFNAMSIZ + 9];
 	char int_name_lpi[IFNAMSIZ + 9];
+	char int_name_sfty[IFNAMSIZ + 10];
 	char int_name_sfty_ce[IFNAMSIZ + 10];
 	char int_name_sfty_ue[IFNAMSIZ + 10];
 	char int_name_rx_irq[MTL_MAX_TX_QUEUES][IFNAMSIZ + 14];
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +39 -2

71 lines not on this page · raw message

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +8 -0
index 70eadc83ca68..54797edc9b38 100644
@@ -743,6 +743,14 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
 		dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
 	}
 
+	stmmac_res->sfty_irq =
+		platform_get_irq_byname_optional(pdev, "sfty");
+	if (stmmac_res->sfty_irq < 0) {
+		if (stmmac_res->sfty_irq == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+		dev_info(&pdev->dev, "IRQ sfty not found\n");
+	}
+
 	stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
 
 	return PTR_ERR_OR_ZERO(stmmac_res->addr);
Signature · 1 line
2.25.1
#3 lore raw
In reply to Suraj Jaiswal
This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

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

Quoted 10 lines · On Fri, 9 Feb 2024 14:20:10 +0530 you wrote:

Changes since v13:
- Update correct sender email

Changes since v12:
- Update correct sender email

Changes since v11:
- Update debug message print

[...]

Here is the summary with links:
- [net-next,v13,1/2] dt-bindings: net: qcom,ethqos: add binding doc for safety IRQ for sa8775p

    https://git.kernel.org/netdev/net-next/c/1963e65b3dfe
  - [net-next,v13,2/2] net: stmmac: Add driver support for common safety IRQ
    https://git.kernel.org/netdev/net-next/c/5c2215167d12

You are awesome, thank you!

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