Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kconfig issues with client modules #3768

Closed
plbossart opened this issue Jul 18, 2022 · 4 comments · Fixed by #3807
Closed

Kconfig issues with client modules #3768

plbossart opened this issue Jul 18, 2022 · 4 comments · Fixed by #3807
Assignees

Comments

@plbossart
Copy link
Member

Issue reported by kernel test robot lkp@intel.com

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c5fe7a97f20c7f3070ac870144515c0fabc6b999
commit: 6e9548cdb30e5d6724236dd7b89a79a270751485 ASoC: SOF: Convert the generic IPC flood test into SOF client
date:   5 months ago
config: arm64-buildonly-randconfig-r006-20220715 (https://download.01.org/0day-ci/archive/20220717/202207170529.CoaJYL8a-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6e9548cdb30e5d6724236dd7b89a79a270751485
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 6e9548cdb30e5d6724236dd7b89a79a270751485
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot [<lkp@intel.com>](mailto:lkp@intel.com)

All errors (new ones prefixed by >>):

   aarch64-linux-ld: Unexpected GOT/PLT entries detected!
   aarch64-linux-ld: Unexpected run-time procedure linkages detected!
   aarch64-linux-ld: sound/soc/sof/sof-client-ipc-flood-test.o: in function `sof_ipc_flood_dfs_open':
>> sof-client-ipc-flood-test.c:(.text+0xfc): undefined reference to `sof_client_get_fw_state'
   aarch64-linux-ld: sound/soc/sof/sof-client-ipc-flood-test.o: in function `sof_debug_ipc_flood_test':
>> sof-client-ipc-flood-test.c:(.text+0x254): undefined reference to `sof_client_ipc_tx_message'
   aarch64-linux-ld: sound/soc/sof/sof-client-ipc-flood-test.o: in function `sof_ipc_flood_probe':
>> sof-client-ipc-flood-test.c:(.text+0xa54): undefined reference to `sof_client_get_debugfs_root'

I was able to reproduce this problem on the latest topic/sof-dev code

COMPILER_INSTALL_PATH=/data/pbossart/0day COMPILER=gcc-12.1.0 ../make.cross W=1 ARCH=arm64 olddefconfig
COMPILER_INSTALL_PATH=/data/pbossart/0day COMPILER=gcc-12.1.0 ../make.cross W=1 ARCH=arm64

the problem is this:

# SOF client support
ifneq ($(CONFIG_SND_SOC_SOF_CLIENT),)
snd-sof-objs += sof-client.o
endif

we compile sof-client.c in the same way as the SOF core, but the clients can be built-in. That cannot possibly work.

@plbossart
Copy link
Member Author

@plbossart
Copy link
Member Author

@ujfalusi this is probably for you?

@ujfalusi
Copy link
Collaborator

ujfalusi commented Aug 9, 2022

@plbossart, I have taken a look and have a working solution, let me see if I can find more elegant way.

Basically adding depends on SND_SOC_SOF for both client driver. It will not allow built in for them if SND_SOC_SOF is module, but allows the clients to be modules if SND_SOC_SOF is built in.

@ujfalusi
Copy link
Collaborator

ujfalusi commented Aug 9, 2022

The other option is to convert the developer options to menu:

diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig
index e90f173d067c..fe01d6937098 100644
--- a/sound/soc/sof/Kconfig
+++ b/sound/soc/sof/Kconfig
@@ -69,18 +69,8 @@ config SND_SOC_SOF_CLIENT
 	  This option is not user-selectable but automagically handled by
 	  'select' statements at a higher level.
 
-config SND_SOC_SOF_DEVELOPER_SUPPORT
-	bool "SOF developer options support"
+menu "SOF developer options support"
 	depends on EXPERT && SND_SOC_SOF
-	help
-	  This option unlocks SOF developer options for debug/performance/
-	  code hardening.
-	  Distributions should not select this option, only SOF development
-	  teams should select it.
-	  Say Y if you are involved in SOF development and need this option.
-	  If not, select N.
-
-if SND_SOC_SOF_DEVELOPER_SUPPORT
 
 config SND_SOC_SOF_FORCE_PROBE_WORKQUEUE
 	bool "SOF force probe workqueue"
@@ -231,7 +223,7 @@ config SND_SOC_SOF_DEBUG_RETAIN_DSP_CONTEXT
 
 endif ## SND_SOC_SOF_DEBUG
 
-endif ## SND_SOC_SOF_DEVELOPER_SUPPORT
+endmenu ## "SOF developer options support"
 
 config SND_SOC_SOF
 	tristate

But this will drop the help section we used to have for SND_SOC_SOF_DEVELOPER_SUPPORT.
If the EXPERT is not enabled then the whole menu is hidden as well.
I think the explicit depends on SND_SOC_SOF is more intuitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants