Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
       [not found] <202011030351.iq9CBMO3-lkp@intel.com>
@ 2020-11-05  3:32 ` Randy Dunlap
  2020-11-25  5:51   ` Vinod Koul
  0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2020-11-05  3:32 UTC (permalink / raw)
  To: kernel test robot, Jonathan Marek
  Cc: Pierre-Louis Bossart, moderated for non-subscribers, kbuild-all,
	linux-kernel, Bjorn Andersson, Vinod Koul, Bard Liao

On 11/2/20 11:47 AM, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   3cea11cd5e3b00d91caf0b4730194039b45c5891
> commit: 09309093d5e8f8774e4a3a0d42b73cf47e9421cf soundwire: qcom: fix SLIBMUS/SLIMBUS typo
> date:   8 weeks ago
> config: openrisc-randconfig-r005-20201102 (attached as .config)
> compiler: or1k-linux-gcc (GCC) 9.3.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=09309093d5e8f8774e4a3a0d42b73cf47e9421cf
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 09309093d5e8f8774e4a3a0d42b73cf47e9421cf
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    or1k-linux-ld: drivers/soundwire/qcom.o: in function `qcom_swrm_probe':
>>> drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
>>> or1k-linux-ld: drivers/soundwire/qcom.c:771: undefined reference to `slimbus_bus'
> 
> vim +767 drivers/soundwire/qcom.c
> 
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  756  
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  757  static int qcom_swrm_probe(struct platform_device *pdev)
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  758  {
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  759  	struct device *dev = &pdev->dev;
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  760  	struct sdw_master_prop *prop;
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  761  	struct sdw_bus_params *params;
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  762  	struct qcom_swrm_ctrl *ctrl;
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  763  	int ret;
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  764  	u32 val;
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  765  
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  766  	ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13 @767  	if (!ctrl)
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  768  		return -ENOMEM;
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13  769  
> 09309093d5e8f87 Jonathan Marek       2020-09-08  770  #if IS_ENABLED(CONFIG_SLIMBUS)
> 02efb49aa805cee Srinivas Kandagatla  2020-01-13 @771  	if (dev->parent->bus == &slimbus_bus) {
> 5bd773242f75da3 Jonathan Marek       2020-09-05  772  #else
> 5bd773242f75da3 Jonathan Marek       2020-09-05  773  	if (false) {
> 5bd773242f75da3 Jonathan Marek       2020-09-05  774  #endif

> :::::: The code at line 767 was first introduced by commit
> :::::: 02efb49aa805cee643a643ab61a1118c2fd08b80 soundwire: qcom: add support for SoundWire controller
> 
> :::::: TO: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> :::::: CC: Vinod Koul <vkoul@kernel.org>


config SOUNDWIRE_QCOM
	tristate "Qualcomm SoundWire Master driver"
	imply SLIMBUS
	depends on SND_SOC

The kernel config that was attached has:
CONFIG_SOUNDWIRE_QCOM=y
CONFIG_SLIMBUS=m

I expected that "imply" would make SLIMBUS=y since SOUNDWIRE_QCOM=y,
but I guess that's not the case. :(

Any ideas about what to do here?

-- 
~Randy


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
  2020-11-05  3:32 ` drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus' Randy Dunlap
@ 2020-11-25  5:51   ` Vinod Koul
  2020-11-25 11:41     ` Srinivas Kandagatla
  2020-11-25 17:31     ` Randy Dunlap
  0 siblings, 2 replies; 5+ messages in thread
From: Vinod Koul @ 2020-11-25  5:51 UTC (permalink / raw)
  To: Randy Dunlap, Srinivas Kandagatla
  Cc: Pierre-Louis Bossart, moderated for non-subscribers, kbuild-all,
	kernel test robot, Jonathan Marek, linux-kernel, Bjorn Andersson,
	Bard Liao

Hi Randy,

On 04-11-20, 19:32, Randy Dunlap wrote:
> On 11/2/20 11:47 AM, kernel test robot wrote:
> > All errors (new ones prefixed by >>):
> > 
> >    or1k-linux-ld: drivers/soundwire/qcom.o: in function `qcom_swrm_probe':
> >>> drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
> >>> or1k-linux-ld: drivers/soundwire/qcom.c:771: undefined reference to `slimbus_bus'
> > 
> > 09309093d5e8f87 Jonathan Marek       2020-09-08  770  #if IS_ENABLED(CONFIG_SLIMBUS)
> > 02efb49aa805cee Srinivas Kandagatla  2020-01-13 @771  	if (dev->parent->bus == &slimbus_bus) {
> > 5bd773242f75da3 Jonathan Marek       2020-09-05  772  #else
> > 5bd773242f75da3 Jonathan Marek       2020-09-05  773  	if (false) {
> > 5bd773242f75da3 Jonathan Marek       2020-09-05  774  #endif
> 
> config SOUNDWIRE_QCOM
> 	tristate "Qualcomm SoundWire Master driver"
> 	imply SLIMBUS
> 	depends on SND_SOC
> 
> The kernel config that was attached has:
> CONFIG_SOUNDWIRE_QCOM=y
> CONFIG_SLIMBUS=m
> 
> I expected that "imply" would make SLIMBUS=y since SOUNDWIRE_QCOM=y,
> but I guess that's not the case. :(
> 
> Any ideas about what to do here?

Sorry to have missed this earlier. I did some digging and found the
Kconfig code to be correct, but not the driver code. Per the
Documentation if we are using imply we should use IS_REACHABLE() rather
than IS_ENABLED.

This seems to take care of build failure for me on arm64 and x64 builds.

Can you confirm with below patch:

---><8---

From: Vinod Koul <vkoul@kernel.org>
Date: Wed, 25 Nov 2020 11:15:22 +0530
Subject: [PATCH] soundwire: qcom: Fix build failure when slimbus is module

Commit 5bd773242f75 ("soundwire: qcom: avoid dependency on
CONFIG_SLIMBUS") removed hard dependency on Slimbus for qcom driver but
it results in build failure when:
CONFIG_SOUNDWIRE_QCOM=y
CONFIG_SLIMBUS=m

drivers/soundwire/qcom.o: In function `qcom_swrm_probe':
qcom.c:(.text+0xf44): undefined reference to `slimbus_bus'

Fix this by using IS_REACHABLE() in driver which is recommended to be
sued with imply.

Fixes: 5bd773242f75 ("soundwire: qcom: avoid dependency on CONFIG_SLIMBUS")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/soundwire/qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index fbca4ebf63e9..6d22df01f354 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -799,7 +799,7 @@ static int qcom_swrm_probe(struct platform_device *pdev)
 	data = of_device_get_match_data(dev);
 	ctrl->rows_index = sdw_find_row_index(data->default_rows);
 	ctrl->cols_index = sdw_find_col_index(data->default_cols);
-#if IS_ENABLED(CONFIG_SLIMBUS)
+#if IS_REACHABLE(CONFIG_SLIMBUS)
 	if (dev->parent->bus == &slimbus_bus) {
 #else
 	if (false) {
-- 
2.26.2

-- 
~Vinod

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
  2020-11-25  5:51   ` Vinod Koul
@ 2020-11-25 11:41     ` Srinivas Kandagatla
  2020-11-25 17:31     ` Randy Dunlap
  1 sibling, 0 replies; 5+ messages in thread
From: Srinivas Kandagatla @ 2020-11-25 11:41 UTC (permalink / raw)
  To: Vinod Koul, Randy Dunlap
  Cc: Pierre-Louis Bossart, moderated for non-subscribers, kbuild-all,
	kernel test robot, Jonathan Marek, linux-kernel, Bjorn Andersson,
	Bard Liao



On 25/11/2020 05:51, Vinod Koul wrote:
> Hi Randy,
> 
> On 04-11-20, 19:32, Randy Dunlap wrote:
>> On 11/2/20 11:47 AM, kernel test robot wrote:
>>> All errors (new ones prefixed by >>):
>>>
>>>     or1k-linux-ld: drivers/soundwire/qcom.o: in function `qcom_swrm_probe':
>>>>> drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
>>>>> or1k-linux-ld: drivers/soundwire/qcom.c:771: undefined reference to `slimbus_bus'
>>>
>>> 09309093d5e8f87 Jonathan Marek       2020-09-08  770  #if IS_ENABLED(CONFIG_SLIMBUS)
>>> 02efb49aa805cee Srinivas Kandagatla  2020-01-13 @771  	if (dev->parent->bus == &slimbus_bus) {
>>> 5bd773242f75da3 Jonathan Marek       2020-09-05  772  #else
>>> 5bd773242f75da3 Jonathan Marek       2020-09-05  773  	if (false) {
>>> 5bd773242f75da3 Jonathan Marek       2020-09-05  774  #endif
>>
>> config SOUNDWIRE_QCOM
>> 	tristate "Qualcomm SoundWire Master driver"
>> 	imply SLIMBUS
>> 	depends on SND_SOC
>>
>> The kernel config that was attached has:
>> CONFIG_SOUNDWIRE_QCOM=y
>> CONFIG_SLIMBUS=m
>>
>> I expected that "imply" would make SLIMBUS=y since SOUNDWIRE_QCOM=y,
>> but I guess that's not the case. :(
>>
>> Any ideas about what to do here?
> 
> Sorry to have missed this earlier. I did some digging and found the
> Kconfig code to be correct, but not the driver code. Per the
> Documentation if we are using imply we should use IS_REACHABLE() rather
> than IS_ENABLED.
> 
> This seems to take care of build failure for me on arm64 and x64 builds.
> 
> Can you confirm with below patch:
> 
> ---><8---
> 
> From: Vinod Koul <vkoul@kernel.org>
> Date: Wed, 25 Nov 2020 11:15:22 +0530
> Subject: [PATCH] soundwire: qcom: Fix build failure when slimbus is module
> 
> Commit 5bd773242f75 ("soundwire: qcom: avoid dependency on
> CONFIG_SLIMBUS") removed hard dependency on Slimbus for qcom driver but
> it results in build failure when:
> CONFIG_SOUNDWIRE_QCOM=y
> CONFIG_SLIMBUS=m
> 
> drivers/soundwire/qcom.o: In function `qcom_swrm_probe':
> qcom.c:(.text+0xf44): undefined reference to `slimbus_bus'
> 
> Fix this by using IS_REACHABLE() in driver which is recommended to be
> sued with imply.
> 
> Fixes: 5bd773242f75 ("soundwire: qcom: avoid dependency on CONFIG_SLIMBUS")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---

Thanks Vinod,

Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

--srini
>   drivers/soundwire/qcom.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index fbca4ebf63e9..6d22df01f354 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -799,7 +799,7 @@ static int qcom_swrm_probe(struct platform_device *pdev)
>   	data = of_device_get_match_data(dev);
>   	ctrl->rows_index = sdw_find_row_index(data->default_rows);
>   	ctrl->cols_index = sdw_find_col_index(data->default_cols);
> -#if IS_ENABLED(CONFIG_SLIMBUS)
> +#if IS_REACHABLE(CONFIG_SLIMBUS)
>   	if (dev->parent->bus == &slimbus_bus) {
>   #else
>   	if (false) {
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
  2020-11-25  5:51   ` Vinod Koul
  2020-11-25 11:41     ` Srinivas Kandagatla
@ 2020-11-25 17:31     ` Randy Dunlap
  2020-11-26  4:26       ` Vinod Koul
  1 sibling, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2020-11-25 17:31 UTC (permalink / raw)
  To: Vinod Koul, Srinivas Kandagatla
  Cc: Pierre-Louis Bossart, moderated for non-subscribers, kbuild-all,
	kernel test robot, Jonathan Marek, linux-kernel, Bjorn Andersson,
	Bard Liao

On 11/24/20 9:51 PM, Vinod Koul wrote:
> Hi Randy,
> 
> On 04-11-20, 19:32, Randy Dunlap wrote:
>> On 11/2/20 11:47 AM, kernel test robot wrote:
>>> All errors (new ones prefixed by >>):
>>>
>>>     or1k-linux-ld: drivers/soundwire/qcom.o: in function `qcom_swrm_probe':
>>>>> drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
>>>>> or1k-linux-ld: drivers/soundwire/qcom.c:771: undefined reference to `slimbus_bus'
>>>
>>> 09309093d5e8f87 Jonathan Marek       2020-09-08  770  #if IS_ENABLED(CONFIG_SLIMBUS)
>>> 02efb49aa805cee Srinivas Kandagatla  2020-01-13 @771  	if (dev->parent->bus == &slimbus_bus) {
>>> 5bd773242f75da3 Jonathan Marek       2020-09-05  772  #else
>>> 5bd773242f75da3 Jonathan Marek       2020-09-05  773  	if (false) {
>>> 5bd773242f75da3 Jonathan Marek       2020-09-05  774  #endif
>>
>> config SOUNDWIRE_QCOM
>> 	tristate "Qualcomm SoundWire Master driver"
>> 	imply SLIMBUS
>> 	depends on SND_SOC
>>
>> The kernel config that was attached has:
>> CONFIG_SOUNDWIRE_QCOM=y
>> CONFIG_SLIMBUS=m
>>
>> I expected that "imply" would make SLIMBUS=y since SOUNDWIRE_QCOM=y,
>> but I guess that's not the case. :(
>>
>> Any ideas about what to do here?
> 
> Sorry to have missed this earlier. I did some digging and found the
> Kconfig code to be correct, but not the driver code. Per the
> Documentation if we are using imply we should use IS_REACHABLE() rather
> than IS_ENABLED.
> 
> This seems to take care of build failure for me on arm64 and x64 builds.
> 
> Can you confirm with below patch:
> 
> ---><8---
> 
> From: Vinod Koul <vkoul@kernel.org>
> Date: Wed, 25 Nov 2020 11:15:22 +0530
> Subject: [PATCH] soundwire: qcom: Fix build failure when slimbus is module
> 
> Commit 5bd773242f75 ("soundwire: qcom: avoid dependency on
> CONFIG_SLIMBUS") removed hard dependency on Slimbus for qcom driver but
> it results in build failure when:
> CONFIG_SOUNDWIRE_QCOM=y
> CONFIG_SLIMBUS=m
> 
> drivers/soundwire/qcom.o: In function `qcom_swrm_probe':
> qcom.c:(.text+0xf44): undefined reference to `slimbus_bus'
> 
> Fix this by using IS_REACHABLE() in driver which is recommended to be
> sued with imply.

   used

> 
> Fixes: 5bd773242f75 ("soundwire: qcom: avoid dependency on CONFIG_SLIMBUS")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks.

> ---
>   drivers/soundwire/qcom.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index fbca4ebf63e9..6d22df01f354 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -799,7 +799,7 @@ static int qcom_swrm_probe(struct platform_device *pdev)
>   	data = of_device_get_match_data(dev);
>   	ctrl->rows_index = sdw_find_row_index(data->default_rows);
>   	ctrl->cols_index = sdw_find_col_index(data->default_cols);
> -#if IS_ENABLED(CONFIG_SLIMBUS)
> +#if IS_REACHABLE(CONFIG_SLIMBUS)
>   	if (dev->parent->bus == &slimbus_bus) {
>   #else
>   	if (false) {
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
  2020-11-25 17:31     ` Randy Dunlap
@ 2020-11-26  4:26       ` Vinod Koul
  0 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2020-11-26  4:26 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Pierre-Louis Bossart, moderated for non-subscribers, kbuild-all,
	kernel test robot, Jonathan Marek, linux-kernel, Bjorn Andersson,
	Srinivas Kandagatla, Bard Liao

On 25-11-20, 09:31, Randy Dunlap wrote:
> On 11/24/20 9:51 PM, Vinod Koul wrote:

> > From: Vinod Koul <vkoul@kernel.org>
> > Date: Wed, 25 Nov 2020 11:15:22 +0530
> > Subject: [PATCH] soundwire: qcom: Fix build failure when slimbus is module
> > 
> > Commit 5bd773242f75 ("soundwire: qcom: avoid dependency on
> > CONFIG_SLIMBUS") removed hard dependency on Slimbus for qcom driver but
> > it results in build failure when:
> > CONFIG_SOUNDWIRE_QCOM=y
> > CONFIG_SLIMBUS=m
> > 
> > drivers/soundwire/qcom.o: In function `qcom_swrm_probe':
> > qcom.c:(.text+0xf44): undefined reference to `slimbus_bus'
> > 
> > Fix this by using IS_REACHABLE() in driver which is recommended to be
> > sued with imply.
> 
>   used

right

> 
> > 
> > Fixes: 5bd773242f75 ("soundwire: qcom: avoid dependency on CONFIG_SLIMBUS")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Vinod Koul <vkoul@kernel.org>
> 
> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks I have added this and Srini's and pushed out now.

-- 
~Vinod

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-26  4:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <202011030351.iq9CBMO3-lkp@intel.com>
2020-11-05  3:32 ` drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus' Randy Dunlap
2020-11-25  5:51   ` Vinod Koul
2020-11-25 11:41     ` Srinivas Kandagatla
2020-11-25 17:31     ` Randy Dunlap
2020-11-26  4:26       ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox