[ 16.872475] Possible unsafe locking scenario:It looks like the whitespace got messed up here, and it should
[ 16.872475]
[ 16.872478] CPU0 CPU1
[ 16.872482] ---- ----
[ 16.872485] lock(&dev->lock);
[ 16.872495] lock(rtnl_mutex);
[ 16.872505] lock(&dev->lock);
actually be:
[ 16.872505] lock(&dev->lock);So if up calls open() which first takes rtnl and then the
[ 16.872513] lock(rtnl_mutex);
phydev->lock.
adjust link is called with phydev->lock already held and it then takes
the rtnl. Deadlock.
During the adjust_list callback, the phydev lock is held so the
contents of phydev are consistent. What you could do is make a copy of
what you need and then release phydev lock. You can then take rtnl and
do the reset. Once the reset is finished, program MAC with the copy
you took from phydev. Then lock phydev again, and return.
Andrew