From: Matti Vaittinen <mazziesaccount@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
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 15:44:16 +0300 [thread overview]
Message-ID: <ee0341fc-b621-b7c0-4312-be2ad3c29da6@gmail.com> (raw)
In-Reply-To: <ZMj7Cp3fhN7GmCZp@shell.armlinux.org.uk>
On 8/1/23 15:31, Russell King (Oracle) wrote:
> 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.
Don't be sorry.
>
>> @@ -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.
You're correct. Thanks for spotting this! Seems like I really overlooked
the behaviour of the of_irq_get_byname().
> 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.
>
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
next prev parent reply other threads:[~2023-08-01 12:44 UTC|newest]
Thread overview: 6+ 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: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)
2023-08-01 12:44 ` Matti Vaittinen [this message]
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=ee0341fc-b621-b7c0-4312-be2ad3c29da6@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=matti.vaittinen@fi.rohmeurope.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;
as well as URLs for NNTP newsgroup(s).