linux/net/dsa
Vladimir Oltean 0184c07a11 net: dsa: autoload tag driver module on tagging protocol change
Issue a request_module() call when an attempt to change the tagging
protocol is made, either by sysfs or by device tree. In the case of
ocelot (the only driver for which the default and the alternative
tagging protocol are compiled as different modules), the user is now no
longer required to insert tag_ocelot_8021q.ko manually.

In the particular case of ocelot, this solves a problem where
tag_ocelot_8021q.ko is built as module, and this is present in the
device tree:

&mscc_felix_port4 {
	dsa-tag-protocol = "ocelot-8021q";
};

&mscc_felix_port5 {
	dsa-tag-protocol = "ocelot-8021q";
};

Because no one attempts to load the module into the kernel at boot time,
the switch driver will fail to probe (actually forever defer) until
someone manually inserts tag_ocelot_8021q.ko. This is now no longer
necessary and happens automatically.

Rename dsa_find_tagger_by_name() to denote the change in functionality:
there is now feature parity with dsa_tag_driver_get_by_id(), i.o.w. we
also load the module if it's missing.

Link: https://lore.kernel.org/lkml/20221027113248.420216-1-michael@walle.cc/
Suggested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Michael Walle <michael@walle.cc> # on kontron-sl28 w/ ocelot_8021q
Tested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-11-17 21:16:42 -08:00
..
dsa2.c net: dsa: autoload tag driver module on tagging protocol change 2022-11-17 21:16:42 -08:00
dsa_priv.h net: dsa: autoload tag driver module on tagging protocol change 2022-11-17 21:16:42 -08:00
dsa.c net: dsa: autoload tag driver module on tagging protocol change 2022-11-17 21:16:42 -08:00
Kconfig net: dsa: tag_ksz: add tag handling for Microchip LAN937x 2022-07-02 16:34:05 +01:00
Makefile net: dsa: allow the DSA master to be seen and changed through rtnetlink 2022-09-20 10:32:35 +02:00
master.c net: dsa: autoload tag driver module on tagging protocol change 2022-11-17 21:16:42 -08:00
netlink.c net: dsa: make user ports return to init_net on netns deletion 2022-09-26 11:28:57 -07:00
port.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-17 18:30:39 -08:00
slave.c net: dsa: set name_assign_type to NET_NAME_ENUM for enumerated user ports 2022-11-17 19:40:08 -08:00
switch.c net: dsa: allow masters to join a LAG 2022-09-20 10:32:36 +02:00
tag_8021q.c net: dsa: introduce dsa_port_get_master() 2022-09-20 10:32:35 +02:00
tag_ar9331.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_brcm.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_dsa.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_gswip.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_hellcreek.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_ksz.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_lan9303.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_mtk.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_ocelot_8021q.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_ocelot.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_qca.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_rtl4_a.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_rtl8_4.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_rzn1_a5psw.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_sja1105.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_trailer.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00
tag_xrs700x.c net: dsa: provide a second modalias to tag proto drivers based on their name 2022-11-17 21:16:41 -08:00