From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 849E4C5519F for ; Wed, 25 Nov 2020 05:52:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A56D208C3 for ; Wed, 25 Nov 2020 05:52:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ozmQ4UeK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727380AbgKYFwA (ORCPT ); Wed, 25 Nov 2020 00:52:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:38012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbgKYFwA (ORCPT ); Wed, 25 Nov 2020 00:52:00 -0500 Received: from localhost (unknown [122.179.120.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8D646208C3; Wed, 25 Nov 2020 05:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606283519; bh=3TsnI28YOrBSLpojTzDR4uEaUM9Fo2k4e+hHZUS++hE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ozmQ4UeKydkeEsVKXsDHXAXgDLyMhdyo9hbJSW57EA4T2JFAxGgfIfHSc0AO9+0nv HN7EfuvDo1Swl83LcA+xeGveMXmbBpo5SfotKOoB3RsgXdmG8pRYaBHsfo9ncof989 X5WxCc2e3ci6W+SjH0Ilc1bHmTjIk7ACFPTIDdfM= Date: Wed, 25 Nov 2020 11:21:55 +0530 From: Vinod Koul To: Randy Dunlap , Srinivas Kandagatla Cc: kernel test robot , Jonathan Marek , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Bard Liao , moderated for non-subscribers , Pierre-Louis Bossart Subject: Re: drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus' Message-ID: <20201125055155.GD8403@vkoul-mobl> References: <202011030351.iq9CBMO3-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 Signed-off-by: Vinod Koul --- 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