From: Simon Horman <horms@kernel.org>
To: Kory Maincent <kory.maincent@bootlin.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Kyle Swenson <kyle.swenson@est.tech>,
thomas.petazzoni@bootlin.com,
Oleksij Rempel <o.rempel@pengutronix.de>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net] net: pse-pd: tps23881: Fix boolean evaluation for bitmask checks
Date: Tue, 24 Sep 2024 09:26:12 +0100 [thread overview]
Message-ID: <20240924082612.GF4029621@kernel.org> (raw)
In-Reply-To: <20240924101529.0093994d@kmaincent-XPS-13-7390>
On Tue, Sep 24, 2024 at 10:15:29AM +0200, Kory Maincent wrote:
> On Tue, 24 Sep 2024 08:18:39 +0100
> Simon Horman <horms@kernel.org> wrote:
>
> > On Mon, Sep 23, 2024 at 05:34:26PM +0200, Kory Maincent wrote:
> > [...]
> >
> > Thanks Kory,
> >
> > I agree that these changes are correct.
> > But are they fixes; can this manifest in a bug?
>
> I didn't face it but I think yes.
> In case of a 4 pairs PoE ports without the fix:
>
> chan = priv->port[id].chan[0];
> if (chan < 4) {
> enabled = ret & BIT(chan);
> delivering = ret & BIT(chan + 4);
> ...
> }
>
> if (priv->port[id].is_4p) {
> chan = priv->port[id].chan[1];
> if (chan < 4) {
> enabled &= !!(ret & BIT(chan));
> delivering &= !!(ret & BIT(chan + 4));
>
> If enabled = 0x2 here, enabled would be assigned to 0 instead of 1.
> ...
>
> }
> }
>
> I have an issue using 4pairs PoE port with my board so I can't test it.
>
>
> > (If so, I suspect the Kernel is riddled with such bugs.)
>
> Don't know about it but if I can remove it from my driver it would be nice. :)
Right, no question from my side that this change is a good one.
I'm just wondering if it is best for net or net-next.
next prev parent reply other threads:[~2024-09-24 8:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 15:34 [PATCH net] net: pse-pd: tps23881: Fix boolean evaluation for bitmask checks Kory Maincent
2024-09-24 6:17 ` Oleksij Rempel
2024-09-24 7:18 ` Simon Horman
2024-09-24 8:15 ` Kory Maincent
2024-09-24 8:26 ` Simon Horman [this message]
2024-09-24 8:33 ` Kory Maincent
2024-09-24 8:44 ` Oleksij Rempel
2024-09-24 8:56 ` Simon Horman
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=20240924082612.GF4029621@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=kyle.swenson@est.tech \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=thomas.petazzoni@bootlin.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).