Netdev List
 help / color / mirror / Atom feed
From: "Gupta, Suraj" <suraj.gupta2@amd.com>
To: phucduc.bui@gmail.com,
	Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Michal Simek <michal.simek@amd.com>,
	Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v4 3/3] net: xilinx: axienet: Fix IRQ error handling
Date: Sat, 22 Aug 2026 20:23:29 +0530	[thread overview]
Message-ID: <e225c560-eae8-4487-be66-f624e5e215ee@amd.com> (raw)
In-Reply-To: <20260821123249.41527-4-phucduc.bui@gmail.com>



On 8/21/2026 6:02 PM, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
> 
> irq_of_parse_and_map() returns 0 when parsing or mapping an IRQ fails,
> while platform_get_irq() returns a negative error code on failure.
> Handle both cases and preserve the original IRQ lookup errors instead
> of returning -ENOMEM.
> 
> Fixes: 28ef9ebdb64c ("net: axienet: make use of axistream-connected attribute optional")
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
> 
> Changes in v4 :
>   - Add error handling for irq_of_parse_and_map()
> 
>   drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 3927ababf833..68b580191508 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -2971,10 +2971,14 @@ static int axienet_probe(struct platform_device *pdev)
>   			dev_err(&pdev->dev, "could not map DMA regs\n");
>   			return PTR_ERR(lp->dma_regs);
>   		}
> -		if (lp->rx_irq <= 0 || lp->tx_irq <= 0) {
> +		if (!lp->rx_irq || !lp->tx_irq) {
>   			dev_err(&pdev->dev, "could not determine irqs\n");
>   			return -ENOMEM;
>   		}

ENOMEM is a slightly misleading errno for "IRQ not found" on the OF path 
-EINVAL/-ENXIO would be more accurate. Since we are here, better to 
correct that also.

Regards,
Suraj


> +		if (lp->rx_irq < 0)
> +			return lp->rx_irq;
> +		if (lp->tx_irq < 0)
> +			return lp->tx_irq;
>   		if (lp->eth_irq < 0 && lp->eth_irq != -ENXIO)
>   			return lp->eth_irq;
>   


  reply	other threads:[~2026-08-22 14:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 12:32 [PATCH net v4 0/3] net: xilinx: axienet: Fix IRQ error handling phucduc.bui
2026-08-21 12:32 ` [PATCH net v4 1/3] net: xilinx: axienet: Propagate errors from optional IRQ lookup phucduc.bui
2026-08-21 12:32 ` [PATCH net v4 2/3] net: xilinx: axienet: Handle optional IRQ return value correctly phucduc.bui
2026-08-21 12:32 ` [PATCH net v4 3/3] net: xilinx: axienet: Fix IRQ error handling phucduc.bui
2026-08-22 14:53   ` Gupta, Suraj [this message]
2026-08-22 22:36     ` Bui Duc Phuc
2026-08-24  3:26       ` Bui Duc Phuc

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=e225c560-eae8-4487-be66-f624e5e215ee@amd.com \
    --to=suraj.gupta2@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phucduc.bui@gmail.com \
    --cc=radhey.shyam.pandey@amd.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