On Fri, Dec 04, 2020 at 09:34:54AM -0800, Florian Fainelli wrote: > On 12/4/2020 9:09 AM, Vladimir Oltean wrote: > > Currently ocelot_set_rx_mode calls ocelot_mact_learn directly, which has > > a very nice ocelot_mact_wait_for_completion at the end. Introduced in > > commit 639c1b2625af ("net: mscc: ocelot: Register poll timeout should be > > wall time not attempts"), this function uses readx_poll_timeout which > > triggers a lot of lockdep warnings and is also dangerous to use from > > atomic context, leading to lockups and panics. > > > > Steen Hegelund added a poll timeout of 100 ms for checking the MAC > > table, a duration which is clearly absurd to poll in atomic context. > > So we need to defer the MAC table access to process context, which we do > > via a dynamically allocated workqueue which contains all there is to > > know about the MAC table operation it has to do. > > > > Signed-off-by: Vladimir Oltean <vladimir.olt...@nxp.com> > > Reviewed-by: Florian Fainelli <f.faine...@gmail.com> > > Did you want to have a Fixes tag to help identify how far back this > needs to be back ported?
I was on the fence about whether I should even target "net", considering that it's not a small patch. But the lockdep warnings are super annoying, I cannot do anything further on the ocelot switchdev driver with them. There's also a small concern I have that I should have taken a reference count on ocelot->dev using get_device, to avoid racing with the unbind. I think I'll send a v2 with this and a Fixes: tag.