The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Justin Chen <justin.chen@broadcom.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Doug Berger <opendmb@gmail.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 4/4] net: bcmgenet: Propagate WoL IRQ errors
Date: Thu, 20 Aug 2026 18:14:56 +0700	[thread overview]
Message-ID: <20260820111456.97947-5-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260820111456.97947-1-phucduc.bui@gmail.com>

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


  parent reply	other threads:[~2026-08-20 11:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` [PATCH 3/4] net: systemport: Propagate IRQ lookup errors phucduc.bui
2026-08-20 11:14 ` phucduc.bui [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260820111456.97947-5-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=justin.chen@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox