On Tue, 5 Aug 2025 at 23:28, Simon Horman horms@kernel.org wrote:
I have looked over the patch and it appears to me that it addresses a straightforward logic error: a check was added to turn the carrier on only if it is already on. Which seems a bit nonsensical. And presumably the intention was to add the check for the opposite case.
This patch addresses that problem.
So I agree that there was a logic error.
I'm not 100% sure about the "straightforward" part.
In particular, the whole *rest* of the code in that
if (!netif_carrier_ok(dev->net)) {
no longer makes sense after we've turned the link on with that
if (test_and_clear_bit(EVENT_LINK_CARRIER_ON, &dev->flags)) netif_carrier_on(dev->net);
sequence.
Put another way - once we've turned the carrier on, now that whole
/* kill URBs for reading packets to save bus bandwidth */ unlink_urbs(dev, &dev->rxq);
/* * tx_timeout will unlink URBs for sending packets and * tx queue is stopped by netcore after link becomes off */
thing makes no sense.
So my gut feel is that the
if (test_and_clear_bit(EVENT_LINK_CARRIER_ON, &dev->flags)) netif_carrier_on(dev->net);
should actually be done outside that if-statement entirely, because it literally ends up changing the thing that if-statement is testing.
And no, I didn't actually test that version, because I was hoping that somebody who actually knows this code better would pipe up.
Linus