* [PATCH v2] net: stmmac: Add support for TX/RX channel interrupt
@ 2026-05-05 2:44 muhammad.nazim.amirul.nazle.asmade
2026-05-05 12:40 ` Andrew Lunn
0 siblings, 1 reply; 3+ messages in thread
From: muhammad.nazim.amirul.nazle.asmade @ 2026-05-05 2:44 UTC (permalink / raw)
To: netdev; +Cc: davem, kuba, pabeni, edumazet, andrew+netdev, linux-kernel
From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
Enable TX/RX channel interrupt registration for MAC that interrupts CPU
through shared peripheral interrupt (SPI).
Per-channel interrupts and interrupt-names are registered as follows,
e.g. 4 TX and 4 RX channels:
interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "dma_tx0",
"dma_tx1",
"dma_tx2",
"dma_tx3",
"dma_rx0",
"dma_rx1",
"dma_rx2",
"dma_rx3";
Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
---
Changes in v2:
- Use -ENXIO to detect when interrupt name is not present,
and return any other negative error code to the caller.
---
.../ethernet/stmicro/stmmac/stmmac_platform.c | 27 +++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 5cae2aa72906..9039e207ddbd 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -732,6 +732,9 @@ static int stmmac_pltfr_get_irq_array(struct platform_device *pdev,
int stmmac_get_platform_resources(struct platform_device *pdev,
struct stmmac_resources *stmmac_res)
{
+ char irq_name[9];
+ int i;
+ int irq;
int ret;
memset(stmmac_res, 0, sizeof(*stmmac_res));
@@ -767,6 +770,30 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
dev_info(&pdev->dev, "IRQ sfty not found\n");
}
+ /* For RX Channel */
+ for (i = 0; i < MTL_MAX_RX_QUEUES; i++) {
+ snprintf(irq_name, sizeof(irq_name), "dma_rx%i", i);
+ irq = platform_get_irq_byname_optional(pdev, irq_name);
+ if (irq == -ENXIO)
+ break;
+ else if (irq < 0)
+ return irq;
+
+ stmmac_res->rx_irq[i] = irq;
+ }
+
+ /* For TX Channel */
+ for (i = 0; i < MTL_MAX_TX_QUEUES; i++) {
+ snprintf(irq_name, sizeof(irq_name), "dma_tx%i", i);
+ irq = platform_get_irq_byname_optional(pdev, irq_name);
+ if (irq == -ENXIO)
+ break;
+ else if (irq < 0)
+ return irq;
+
+ stmmac_res->tx_irq[i] = irq;
+ }
+
stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(stmmac_res->addr))
--
2.43.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] net: stmmac: Add support for TX/RX channel interrupt
2026-05-05 2:44 [PATCH v2] net: stmmac: Add support for TX/RX channel interrupt muhammad.nazim.amirul.nazle.asmade
@ 2026-05-05 12:40 ` Andrew Lunn
2026-05-06 2:00 ` Nazle Asmade, Muhammad Nazim Amirul
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2026-05-05 12:40 UTC (permalink / raw)
To: muhammad.nazim.amirul.nazle.asmade
Cc: netdev, davem, kuba, pabeni, edumazet, andrew+netdev,
linux-kernel
On Mon, May 04, 2026 at 07:44:59PM -0700, muhammad.nazim.amirul.nazle.asmade@altera.com wrote:
> From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
>
> Enable TX/RX channel interrupt registration for MAC that interrupts CPU
> through shared peripheral interrupt (SPI).
Please take a read on https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
The Subject line needs to indicate the tree.
> int stmmac_get_platform_resources(struct platform_device *pdev,
> struct stmmac_resources *stmmac_res)
> {
> + char irq_name[9];
> + int i;
> + int irq;
> int ret;
Reverse Christmas Tree.
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] net: stmmac: Add support for TX/RX channel interrupt
2026-05-05 12:40 ` Andrew Lunn
@ 2026-05-06 2:00 ` Nazle Asmade, Muhammad Nazim Amirul
0 siblings, 0 replies; 3+ messages in thread
From: Nazle Asmade, Muhammad Nazim Amirul @ 2026-05-06 2:00 UTC (permalink / raw)
To: Andrew Lunn
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, edumazet@google.com, andrew+netdev@lunn.ch,
linux-kernel@vger.kernel.org
On 5/5/2026 8:40 pm, Andrew Lunn wrote:
> [You don't often get email from andrew@lunn.ch. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> On Mon, May 04, 2026 at 07:44:59PM -0700, muhammad.nazim.amirul.nazle.asmade@altera.com wrote:
>> From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
>>
>> Enable TX/RX channel interrupt registration for MAC that interrupts CPU
>> through shared peripheral interrupt (SPI).
>
> Please take a read on https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
>
> The Subject line needs to indicate the tree.
>
>> int stmmac_get_platform_resources(struct platform_device *pdev,
>> struct stmmac_resources *stmmac_res)
>> {
>> + char irq_name[9];
>> + int i;
>> + int irq;
>> int ret;
>
> Reverse Christmas Tree.
>
> Andrew
>
> ---
> pw-bot: cr
Thanks Andrew for a quick response! really appreciate it. All comments
have been addressed and updated in v3.
Nazim
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-06 2:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 2:44 [PATCH v2] net: stmmac: Add support for TX/RX channel interrupt muhammad.nazim.amirul.nazle.asmade
2026-05-05 12:40 ` Andrew Lunn
2026-05-06 2:00 ` Nazle Asmade, Muhammad Nazim Amirul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox