Re: [PATCH net-next 1/2] net: ethernet: Allow disabling pause on panic
From: Andrew Lunn
Date: Mon Nov 03 2025 - 17:09:21 EST
> + /*
> + * In panic context, we're in atomic context and cannot sleep.
> + * We try to call set_pauseparam directly. If it would sleep,
> + * that's a driver bug, but we proceed anyway since we're panicking.
> + * The driver's set_pauseparam implementation should ideally handle
> + * atomic context, but if it doesn't, we can't do much about it
> + * during a panic.
> + */
> + ops->set_pauseparam(dev, &pause);
I'm not sure i like that. Many driver writers get pause wrong. I've
been encouraging them to use phylink, since it does all the business
logic for them. There are around 18 drivers doing this. They are
likely to first get a splat from ASSERT_RTNL() and then hit a
mutex_lock()/unlock.
Could you take a look at phylink_ethtool_set_pauseparam(), and if we
are in a panic context, at minimum turn it into a NOP?
Andrew