* [PATCH 1/4] net: bcmasp: Use platform_get_irq() for IRQ lookup
2026-08-20 11:14 [PATCH 0/4] net: broadcom: Improve IRQ error handling phucduc.bui
@ 2026-08-20 11:14 ` phucduc.bui
2026-08-20 11:14 ` [PATCH 2/4] net: bcmasp: Propagate WoL IRQ errors from probe phucduc.bui
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: phucduc.bui @ 2026-08-20 11:14 UTC (permalink / raw)
To: Justin Chen, Florian Fainelli, Doug Berger
Cc: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Broadcom internal kernel review list, linux-kernel, netdev,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The platform_get_irq_optional() function currently returns all negative
error values without distinguishing between the case where no IRQ is
available and actual errors occurring during the IRQ lookup.
Use platform_get_irq() instead, as it matches the existing error handling
by propagating any error encountered during the IRQ lookup.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/net/ethernet/broadcom/asp2/bcmasp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
index 972474893a6b..d66a8bbd6e38 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
@@ -1094,7 +1094,7 @@ static int bcmasp_get_and_request_irq(struct bcmasp_priv *priv, int i)
struct platform_device *pdev = priv->pdev;
int irq, ret;
- irq = platform_get_irq_optional(pdev, i);
+ irq = platform_get_irq(pdev, i);
if (irq < 0)
return irq;
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 2/4] net: bcmasp: Propagate WoL IRQ errors from probe
2026-08-20 11:14 [PATCH 0/4] net: broadcom: Improve IRQ error handling phucduc.bui
2026-08-20 11:14 ` [PATCH 1/4] net: bcmasp: Use platform_get_irq() for IRQ lookup phucduc.bui
@ 2026-08-20 11:14 ` phucduc.bui
2026-08-20 11:14 ` [PATCH 3/4] net: systemport: Propagate IRQ lookup errors phucduc.bui
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: phucduc.bui @ 2026-08-20 11:14 UTC (permalink / raw)
To: Justin Chen, Florian Fainelli, Doug Berger
Cc: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Broadcom internal kernel review list, linux-kernel, netdev,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
bcmasp_init_wol() currently ignores errors returned by
bcmasp_get_and_request_irq() and allows the probe to continue.
Return the error from bcmasp_init_wol() and propagate it to the probe
function instead of silently ignoring the failure to initialize the
WoL IRQ.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/net/ethernet/broadcom/asp2/bcmasp.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
index d66a8bbd6e38..02e88adf4939 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
@@ -1106,21 +1106,20 @@ static int bcmasp_get_and_request_irq(struct bcmasp_priv *priv, int i)
return irq;
}
-static void bcmasp_init_wol(struct bcmasp_priv *priv)
+static int bcmasp_init_wol(struct bcmasp_priv *priv)
{
struct platform_device *pdev = priv->pdev;
- struct device *dev = &pdev->dev;
int irq;
irq = bcmasp_get_and_request_irq(priv, 1);
- if (irq < 0) {
- dev_warn(dev, "Failed to init WoL irq: %d\n", irq);
- return;
- }
+ if (irq < 0)
+ return irq;
priv->wol_irq = irq;
priv->wol_irq_enabled_mask = 0;
device_set_wakeup_capable(&pdev->dev, 1);
+
+ return 0;
}
void bcmasp_enable_wol(struct bcmasp_intf *intf, bool en)
@@ -1321,7 +1320,9 @@ static int bcmasp_probe(struct platform_device *pdev)
bcmasp_core_init_filters(priv);
- bcmasp_init_wol(priv);
+ ret = bcmasp_init_wol(priv);
+ if (ret)
+ goto err_clock_disable;
ports_node = of_find_node_by_name(dev->of_node, "ethernet-ports");
if (!ports_node) {
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 3/4] net: systemport: Propagate IRQ lookup errors
2026-08-20 11:14 [PATCH 0/4] net: broadcom: Improve IRQ error handling phucduc.bui
2026-08-20 11:14 ` [PATCH 1/4] net: bcmasp: Use platform_get_irq() for IRQ lookup phucduc.bui
2026-08-20 11:14 ` [PATCH 2/4] net: bcmasp: Propagate WoL IRQ errors from probe phucduc.bui
@ 2026-08-20 11:14 ` phucduc.bui
2026-08-20 11:14 ` [PATCH 4/4] net: bcmgenet: Propagate WoL IRQ errors phucduc.bui
2026-08-20 13:30 ` [PATCH 0/4] net: broadcom: Improve IRQ error handling Paolo Abeni
4 siblings, 0 replies; 12+ messages in thread
From: phucduc.bui @ 2026-08-20 11:14 UTC (permalink / raw)
To: Justin Chen, Florian Fainelli, Doug Berger
Cc: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Broadcom internal kernel review list, linux-kernel, netdev,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Propagate the error codes returned by platform_get_irq() and
platform_get_irq_optional() instead of converting them to -EINVAL.
For the optional WoL IRQ, allow -ENXIO to indicate that the IRQ is not
available, but propagate any other error returned by the IRQ lookup.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/net/ethernet/broadcom/bcmsysport.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 4d06c6ba6641..2acaffccdb08 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -2499,14 +2499,22 @@ static int bcm_sysport_probe(struct platform_device *pdev)
priv->num_rx_desc_words = params->num_rx_desc_words;
priv->irq0 = platform_get_irq(pdev, 0);
+ if (priv->irq0 < 0) {
+ ret = priv->irq0;
+ goto err_free_netdev;
+ }
if (!priv->is_lite) {
priv->irq1 = platform_get_irq(pdev, 1);
priv->wol_irq = platform_get_irq_optional(pdev, 2);
} else {
priv->wol_irq = platform_get_irq_optional(pdev, 1);
}
- if (priv->irq0 <= 0 || (priv->irq1 <= 0 && !priv->is_lite)) {
- ret = -EINVAL;
+ if (priv->irq1 < 0 && !priv->is_lite) {
+ ret = priv->irq1;
+ goto err_free_netdev;
+ }
+ if (priv->wol_irq < 0 && priv->wol_irq != -ENXIO) {
+ ret = priv->wol_irq;
goto err_free_netdev;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 4/4] net: bcmgenet: Propagate WoL IRQ errors
2026-08-20 11:14 [PATCH 0/4] net: broadcom: Improve IRQ error handling phucduc.bui
` (2 preceding siblings ...)
2026-08-20 11:14 ` [PATCH 3/4] net: systemport: Propagate IRQ lookup errors phucduc.bui
@ 2026-08-20 11:14 ` phucduc.bui
2026-08-20 13:30 ` [PATCH 0/4] net: broadcom: Improve IRQ error handling Paolo Abeni
4 siblings, 0 replies; 12+ messages in thread
From: phucduc.bui @ 2026-08-20 11:14 UTC (permalink / raw)
To: Justin Chen, Florian Fainelli, Doug Berger
Cc: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Broadcom internal kernel review list, linux-kernel, netdev,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Propagate errors from platform_get_irq_optional() instead of only
handling -EPROBE_DEFER. Allow -ENXIO to indicate that the optional
WoL IRQ is not available.
Also propagate errors from devm_request_irq() instead of continuing
the probe when the WoL IRQ cannot be requested.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index a2305e6428d1..c1c66a52efd0 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3993,7 +3993,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
goto err;
}
priv->wol_irq = platform_get_irq_optional(pdev, 2);
- if (priv->wol_irq == -EPROBE_DEFER) {
+ if (priv->wol_irq < 0 && priv->wol_irq != -ENXIO) {
err = priv->wol_irq;
goto err;
}
@@ -4033,8 +4033,10 @@ static int bcmgenet_probe(struct platform_device *pdev)
if (priv->wol_irq > 0) {
err = devm_request_irq(&pdev->dev, priv->wol_irq,
bcmgenet_wol_isr, 0, dev->name, priv);
- if (!err)
- device_set_wakeup_capable(&pdev->dev, 1);
+ if (err)
+ goto err;
+
+ device_set_wakeup_capable(&pdev->dev, 1);
}
/* Set the needed headroom to account for any possible
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 0/4] net: broadcom: Improve IRQ error handling
2026-08-20 11:14 [PATCH 0/4] net: broadcom: Improve IRQ error handling phucduc.bui
` (3 preceding siblings ...)
2026-08-20 11:14 ` [PATCH 4/4] net: bcmgenet: Propagate WoL IRQ errors phucduc.bui
@ 2026-08-20 13:30 ` Paolo Abeni
2026-08-20 16:45 ` Florian Fainelli
2026-08-21 2:06 ` Bui Duc Phuc
4 siblings, 2 replies; 12+ messages in thread
From: Paolo Abeni @ 2026-08-20 13:30 UTC (permalink / raw)
To: phucduc.bui, Justin Chen, Florian Fainelli, Doug Berger
Cc: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski,
Broadcom internal kernel review list, linux-kernel, netdev
On 8/20/26 1:14 PM, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Hi all,
>
> This series improves IRQ error handling in several Broadcom Ethernet
> drivers by propagating IRQ lookup and request errors instead of
> silently ignoring them.
>
> The changes were found by manual code inspection and compile-tested
> only.
## Form letter - net-next-closed
We have already submitted our pull request with net-next material for v7.3,
and therefore net-next is closed for new drivers, features, code refactoring
and optimizations. We are currently accepting bug fixes only.
Please repost when net-next reopens after Aug 31st.
RFC patches sent for review only are obviously welcome at any time.
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/4] net: broadcom: Improve IRQ error handling
2026-08-20 13:30 ` [PATCH 0/4] net: broadcom: Improve IRQ error handling Paolo Abeni
@ 2026-08-20 16:45 ` Florian Fainelli
2026-08-20 18:42 ` Justin Chen
2026-08-21 2:06 ` Bui Duc Phuc
1 sibling, 1 reply; 12+ messages in thread
From: Florian Fainelli @ 2026-08-20 16:45 UTC (permalink / raw)
To: Paolo Abeni, phucduc.bui, Justin Chen, Doug Berger
Cc: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski,
Broadcom internal kernel review list, linux-kernel, netdev
On 8/20/26 06:30, Paolo Abeni wrote:
> On 8/20/26 1:14 PM, phucduc.bui@gmail.com wrote:
>> From: bui duc phuc <phucduc.bui@gmail.com>
>>
>> Hi all,
>>
>> This series improves IRQ error handling in several Broadcom Ethernet
>> drivers by propagating IRQ lookup and request errors instead of
>> silently ignoring them.
>>
>> The changes were found by manual code inspection and compile-tested
>> only.
> ## Form letter - net-next-closed
>
> We have already submitted our pull request with net-next material for v7.3,
> and therefore net-next is closed for new drivers, features, code refactoring
> and optimizations. We are currently accepting bug fixes only.
>
> Please repost when net-next reopens after Aug 31st.
>
> RFC patches sent for review only are obviously welcome at any time.
>
> See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
>
Not seeing much value in these patches, to be honest.
--
Florian
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/4] net: broadcom: Improve IRQ error handling
2026-08-20 16:45 ` Florian Fainelli
@ 2026-08-20 18:42 ` Justin Chen
2026-08-21 2:38 ` Bui Duc Phuc
0 siblings, 1 reply; 12+ messages in thread
From: Justin Chen @ 2026-08-20 18:42 UTC (permalink / raw)
To: Florian Fainelli, Paolo Abeni, phucduc.bui, Doug Berger
Cc: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski,
Broadcom internal kernel review list, linux-kernel, netdev
On 8/20/26 9:45 AM, Florian Fainelli wrote:
> On 8/20/26 06:30, Paolo Abeni wrote:
>> On 8/20/26 1:14 PM, phucduc.bui@gmail.com wrote:
>>> From: bui duc phuc <phucduc.bui@gmail.com>
>>>
>>> Hi all,
>>>
>>> This series improves IRQ error handling in several Broadcom Ethernet
>>> drivers by propagating IRQ lookup and request errors instead of
>>> silently ignoring them.
>>>
>>> The changes were found by manual code inspection and compile-tested
>>> only.
>> ## Form letter - net-next-closed
>>
>> We have already submitted our pull request with net-next material for
>> v7.3,
>> and therefore net-next is closed for new drivers, features, code
>> refactoring
>> and optimizations. We are currently accepting bug fixes only.
>>
>> Please repost when net-next reopens after Aug 31st.
>>
>> RFC patches sent for review only are obviously welcome at any time.
>>
>> See: https://www.kernel.org/doc/html/next/process/maintainer-
>> netdev.html#development-cycle
>>
>
> Not seeing much value in these patches, to be honest.
Agreed. I prefer the current behavior. Even if the optional WoL IRQ
exist, but fails to initialize correctly, the rest of the network
functions will still work. No need to take down everything in this case.
Thanks,
Justin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/4] net: broadcom: Improve IRQ error handling
2026-08-20 18:42 ` Justin Chen
@ 2026-08-21 2:38 ` Bui Duc Phuc
2026-08-21 2:57 ` Andrew Lunn
0 siblings, 1 reply; 12+ messages in thread
From: Bui Duc Phuc @ 2026-08-21 2:38 UTC (permalink / raw)
To: Justin Chen
Cc: Florian Fainelli, Paolo Abeni, Doug Berger, Andrew Lunn, davem,
Eric Dumazet, Jakub Kicinski,
Broadcom internal kernel review list, linux-kernel, netdev
Hi Florian, Chen,
Thank you for your feedback.
> >
> > Not seeing much value in these patches, to be honest.
>
I was looking at how platform_get_irq_optional() is handled in other
network drivers, such as the Xilinx and TI drivers:
Xilinx :
https://elixir.bootlin.com/linux/v7.2/source/drivers/net/ethernet/xilinx/xilinx_axienet_main.c#L3020
TI :
https://elixir.bootlin.com/linux/v7.2/source/drivers/net/ethernet/ti/davinci_emac.c#L1444
Both drivers explicitly handle errors returned by
platform_get_irq_optional() rather than treating every negative value
as "no IRQ".
I wonder if they handled it this way because their hardware and software
are already solid. I used these implementations as references when
considering the error handling in these patches.
> Agreed. I prefer the current behavior. Even if the optional WoL IRQ
> exist, but fails to initialize correctly, the rest of the network
> functions will still work. No need to take down everything in this case.
>
What about -EPROBE_DEFER? Do you also want to ignore it and not
give the driver a chance to probe again?
Best regards,
Phuc
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/4] net: broadcom: Improve IRQ error handling
2026-08-21 2:38 ` Bui Duc Phuc
@ 2026-08-21 2:57 ` Andrew Lunn
2026-08-21 4:49 ` Bui Duc Phuc
0 siblings, 1 reply; 12+ messages in thread
From: Andrew Lunn @ 2026-08-21 2:57 UTC (permalink / raw)
To: Bui Duc Phuc
Cc: Justin Chen, Florian Fainelli, Paolo Abeni, Doug Berger,
Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski,
Broadcom internal kernel review list, linux-kernel, netdev
> What about -EPROBE_DEFER? Do you also want to ignore it and not
> give the driver a chance to probe again?
Please do some git research. How long has the code been this way?
If -EPROBE_DEFER was a problem, why has nobody reported it?
Andrew
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/4] net: broadcom: Improve IRQ error handling
2026-08-21 2:57 ` Andrew Lunn
@ 2026-08-21 4:49 ` Bui Duc Phuc
0 siblings, 0 replies; 12+ messages in thread
From: Bui Duc Phuc @ 2026-08-21 4:49 UTC (permalink / raw)
To: Andrew Lunn
Cc: Justin Chen, Florian Fainelli, Paolo Abeni, Doug Berger,
Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski,
Broadcom internal kernel review list, linux-kernel, netdev
Hi Andrew,
Thank you for your feedback.
>
> > What about -EPROBE_DEFER? Do you also want to ignore it and not
> > give the driver a chance to probe again?
>
> Please do some git research. How long has the code been this way?
>
> If -EPROBE_DEFER was a problem, why has nobody reported it?
>
I did some git research as suggested and found commit 6b77c06655b8
("net: bcmgenet: Check for Wake-on-LAN interrupt probe deferral") written
by Florian back in 2022:
https://lore.kernel.org/r/20220511031752.2245566-1-f.fainelli@gmail.com
In that commit, Florian specifically highlighted that the interrupt
controller (irq-bcm7038-l1.c) might be probed after the Ethernet driver,
requiring an explicit check for -EPROBE_DEFER to ensure the interrupt is
eventually fetched.
This commit clearly shows that probe deferral and IRQ lookup issues on these
Broadcom controllers are real-world problems rather than theoretical edge cases.
Best regards,
Phuc
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/4] net: broadcom: Improve IRQ error handling
2026-08-20 13:30 ` [PATCH 0/4] net: broadcom: Improve IRQ error handling Paolo Abeni
2026-08-20 16:45 ` Florian Fainelli
@ 2026-08-21 2:06 ` Bui Duc Phuc
1 sibling, 0 replies; 12+ messages in thread
From: Bui Duc Phuc @ 2026-08-21 2:06 UTC (permalink / raw)
To: Paolo Abeni
Cc: Justin Chen, Florian Fainelli, Doug Berger, Andrew Lunn, davem,
Eric Dumazet, Jakub Kicinski,
Broadcom internal kernel review list, linux-kernel, netdev
Hi Paolo,
> ## Form letter - net-next-closed
>
> We have already submitted our pull request with net-next material for v7.3,
> and therefore net-next is closed for new drivers, features, code refactoring
> and optimizations. We are currently accepting bug fixes only.
>
> Please repost when net-next reopens after Aug 31st.
>
> RFC patches sent for review only are obviously welcome at any time.
>
> See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
>
Thanks for clarifying this.
I wasn't aware of this process and only knew that patches could be
sent for review.
I may send the patches as RFCs for now, in line with the guidelines.
Best regards,
Phuc
^ permalink raw reply [flat|nested] 12+ messages in thread