public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	Marcin Wojtas <mw@semihalf.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 7/8] net-next: mvpp2: relax return value check for IRQ get
Date: Tue, 1 Aug 2023 13:31:06 +0100	[thread overview]
Message-ID: <ZMj7Cp3fhN7GmCZp@shell.armlinux.org.uk> (raw)
In-Reply-To: <9738e169d83a96f18de417e62b3cf4c20f51f885.1690890774.git.mazziesaccount@gmail.com>

On Tue, Aug 01, 2023 at 03:04:24PM +0300, Matti Vaittinen wrote:
> fwnode_irq_get[_byname]() were changed to not return 0 anymore.
> 
> Drop check for return value 0.
> 
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>

Sorry, but I don't think you've properly considered the effects of your
patch.

> @@ -5833,7 +5833,7 @@ static int mvpp2_multi_queue_vectors_init(struct mvpp2_port *port,
>  			v->irq = of_irq_get_byname(port_node, irqname);
>  		else
>  			v->irq = fwnode_irq_get(port->fwnode, i);
> -		if (v->irq <= 0) {
> +		if (v->irq < 0) {

You're making this change based on the assumption that fwnode_irq_get()
has changed its return values, but I really don't think you've looked
at the code and considered the return value behaviour of the DT function
above. Reading it's documentation, it states that of_irq_get_byname()
may return 0 on IRQ mapping failure.

So, by making this change, you are allowing IRQ mapping failure in the
DT path to succeed rather than fail.

>  			ret = -EINVAL;
>  			goto err;
>  		}
> @@ -6764,7 +6764,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
>  		err = -EPROBE_DEFER;
>  		goto err_deinit_qvecs;
>  	}
> -	if (port->port_irq <= 0)
> +	if (port->port_irq < 0)

Exactly the same problem here, but...

>  		/* the link irq is optional */
>  		port->port_irq = 0;

this is less critical... but still wrong.

So, given that this patch is basically incorrect...

NAK.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2023-08-01 12:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 12:00 [PATCH v8 0/8] fix fwnode_irq_get[_byname()] returnvalue Matti Vaittinen
2023-08-01 12:02 ` [PATCH v8 1/8] iio: mb1232: relax return value check for IRQ get Matti Vaittinen
2023-08-01 17:53   ` Jonathan Cameron
2023-08-01 12:02 ` [PATCH v8 2/8] iio: cdc: ad7150: " Matti Vaittinen
2023-08-01 17:54   ` Jonathan Cameron
2023-08-01 12:03 ` [PATCH v8 3/8] pinctrl: wpcm450: " Matti Vaittinen
2023-08-01 12:03 ` [PATCH v8 4/8] pinctrl: ingenic: " Matti Vaittinen
2023-08-01 12:03 ` [PATCH v8 5/8] pinctrl: pistachio: " Matti Vaittinen
2023-08-01 12:04 ` [PATCH v8 6/8] i2c: i2c-smbus: fwnode_irq_get_byname() return value fix Matti Vaittinen
2023-08-01 12:04 ` [PATCH v8 7/8] net-next: mvpp2: relax return value check for IRQ get Matti Vaittinen
2023-08-01 12:31   ` Russell King (Oracle) [this message]
2023-08-01 12:44     ` Matti Vaittinen
2023-08-01 12:04 ` [PATCH v8 8/8] net-next: mvpp2: don't shadow error Matti Vaittinen
2023-08-01 12:31   ` Russell King (Oracle)

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=ZMj7Cp3fhN7GmCZp@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=mw@semihalf.com \
    --cc=netdev@vger.kernel.org \
    --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