drivers/net/dsa/dsa_loop_bdinfo.c build problems

From: Stephen Langstaff
Date: Mon May 13 2024 - 10:44:18 EST


Hi there.

I have come across an issue in the Linux kernel (6.8.7 and others) and
wondered whether I am doing something wrong?

In trying to test the dsa_loop module, I have found that the
dsa_loop_bdinfo module is not built when the following combination of
configuration items is set:

CONFIG_NET_DSA=y
CONFIG_NET_DSA_LOOP=m
CONFIG_FIXED_PHY=y

This combination can easily be obtained using make menuconfig.

It seems that driver/net/Makefile’s inclusion of the dsa directory as
an obj-m precludes the building of dsa_loop_bdinfo.c (which is an
obj-y):

driver/net/Makefile:

obj-$(CONFIG_NET_DSA) += dsa/


driver/net/dsa/Makefile:

ifdef CONFIG_NET_DSA_LOOP
obj-$(CONFIG_FIXED_PHY) += dsa_loop_bdinfo.o
endif