]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: dsa: Fix load order between DSA drivers and taggers
authorAndrew Lunn <andrew@lunn.ch>
Thu, 12 Sep 2019 13:16:45 +0000 (15:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Sep 2019 05:18:13 +0000 (07:18 +0200)
commit0d84424bdfcd15e9ce01cfcd28e5c9e2a599f8db
tree23e8bf6e2efea5b62c6477909c7d0418ef363b2a
parent7f4aa339581bf60abd8909e9cfbb04205c596615
net: dsa: Fix load order between DSA drivers and taggers

[ Upstream commit 23426a25e55a417dc104df08781b6eff95e65f3f ]

The DSA core, DSA taggers and DSA drivers all make use of
module_init(). Hence they get initialised at device_initcall() time.
The ordering is non-deterministic. It can be a DSA driver is bound to
a device before the needed tag driver has been initialised, resulting
in the message:

No tagger for this switch

Rather than have this be fatal, return -EPROBE_DEFER so that it is
tried again later once all the needed drivers have been loaded.

Fixes: d3b8c04988ca ("dsa: Add boilerplate helper to register DSA tag driver modules")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/dsa/dsa2.c