* drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
@ 2020-11-02 19:47 kernel test robot
2020-11-05 3:32 ` Randy Dunlap
0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2020-11-02 19:47 UTC (permalink / raw)
To: Jonathan Marek; +Cc: kbuild-all, linux-kernel, Vinod Koul, Bjorn Andersson
[-- Attachment #1: Type: text/plain, Size: 10840 bytes --]
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
d1df23fe688b58e Jonathan Marek 2020-09-05 775 ctrl->reg_read = qcom_swrm_ahb_reg_read;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 776 ctrl->reg_write = qcom_swrm_ahb_reg_write;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 777 ctrl->regmap = dev_get_regmap(dev->parent, NULL);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 778 if (!ctrl->regmap)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 779 return -EINVAL;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 780 } else {
82f5c70c26511ba Jonathan Marek 2020-09-05 781 ctrl->reg_read = qcom_swrm_cpu_reg_read;
82f5c70c26511ba Jonathan Marek 2020-09-05 782 ctrl->reg_write = qcom_swrm_cpu_reg_write;
82f5c70c26511ba Jonathan Marek 2020-09-05 783 ctrl->mmio = devm_platform_ioremap_resource(pdev, 0);
82f5c70c26511ba Jonathan Marek 2020-09-05 784 if (IS_ERR(ctrl->mmio))
82f5c70c26511ba Jonathan Marek 2020-09-05 785 return PTR_ERR(ctrl->mmio);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 786 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 787
02efb49aa805cee Srinivas Kandagatla 2020-01-13 788 ctrl->irq = of_irq_get(dev->of_node, 0);
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 789 if (ctrl->irq < 0) {
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 790 ret = ctrl->irq;
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 791 goto err_init;
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 792 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 793
02efb49aa805cee Srinivas Kandagatla 2020-01-13 794 ctrl->hclk = devm_clk_get(dev, "iface");
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 795 if (IS_ERR(ctrl->hclk)) {
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 796 ret = PTR_ERR(ctrl->hclk);
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 797 goto err_init;
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 798 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 799
02efb49aa805cee Srinivas Kandagatla 2020-01-13 800 clk_prepare_enable(ctrl->hclk);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 801
02efb49aa805cee Srinivas Kandagatla 2020-01-13 802 ctrl->dev = dev;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 803 dev_set_drvdata(&pdev->dev, ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 804 spin_lock_init(&ctrl->comp_lock);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 805 mutex_init(&ctrl->port_lock);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 806 INIT_WORK(&ctrl->slave_work, qcom_swrm_slave_wq);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 807
02efb49aa805cee Srinivas Kandagatla 2020-01-13 808 ctrl->bus.ops = &qcom_swrm_ops;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 809 ctrl->bus.port_ops = &qcom_swrm_port_ops;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 810 ctrl->bus.compute_params = &qcom_swrm_compute_params;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 811
02efb49aa805cee Srinivas Kandagatla 2020-01-13 812 ret = qcom_swrm_get_port_config(ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 813 if (ret)
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 814 goto err_clk;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 815
02efb49aa805cee Srinivas Kandagatla 2020-01-13 816 params = &ctrl->bus.params;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 817 params->max_dr_freq = DEFAULT_CLK_FREQ;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 818 params->curr_dr_freq = DEFAULT_CLK_FREQ;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 819 params->col = SWRM_DEFAULT_COL;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 820 params->row = SWRM_DEFAULT_ROWS;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 821 ctrl->reg_read(ctrl, SWRM_MCP_STATUS, &val);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 822 params->curr_bank = val & SWRM_MCP_STATUS_BANK_NUM_MASK;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 823 params->next_bank = !params->curr_bank;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 824
02efb49aa805cee Srinivas Kandagatla 2020-01-13 825 prop = &ctrl->bus.prop;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 826 prop->max_clk_freq = DEFAULT_CLK_FREQ;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 827 prop->num_clk_gears = 0;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 828 prop->num_clk_freq = MAX_FREQ_NUM;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 829 prop->clk_freq = &qcom_swrm_freq_tbl[0];
02efb49aa805cee Srinivas Kandagatla 2020-01-13 830 prop->default_col = SWRM_DEFAULT_COL;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 831 prop->default_row = SWRM_DEFAULT_ROWS;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 832
02efb49aa805cee Srinivas Kandagatla 2020-01-13 833 ctrl->reg_read(ctrl, SWRM_COMP_HW_VERSION, &ctrl->version);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 834
02efb49aa805cee Srinivas Kandagatla 2020-01-13 835 ret = devm_request_threaded_irq(dev, ctrl->irq, NULL,
02efb49aa805cee Srinivas Kandagatla 2020-01-13 836 qcom_swrm_irq_handler,
4f1738f4c24b448 Samuel Zou 2020-05-06 837 IRQF_TRIGGER_RISING |
4f1738f4c24b448 Samuel Zou 2020-05-06 838 IRQF_ONESHOT,
02efb49aa805cee Srinivas Kandagatla 2020-01-13 839 "soundwire", ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 840 if (ret) {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 841 dev_err(dev, "Failed to request soundwire irq\n");
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 842 goto err_clk;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 843 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 844
5cab3ff2489ede5 Pierre-Louis Bossart 2020-05-19 845 ret = sdw_bus_master_add(&ctrl->bus, dev, dev->fwnode);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 846 if (ret) {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 847 dev_err(dev, "Failed to register Soundwire controller (%d)\n",
02efb49aa805cee Srinivas Kandagatla 2020-01-13 848 ret);
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 849 goto err_clk;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 850 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 851
02efb49aa805cee Srinivas Kandagatla 2020-01-13 852 qcom_swrm_init(ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 853 ret = qcom_swrm_register_dais(ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 854 if (ret)
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 855 goto err_master_add;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 856
02efb49aa805cee Srinivas Kandagatla 2020-01-13 857 dev_info(dev, "Qualcomm Soundwire controller v%x.%x.%x Registered\n",
02efb49aa805cee Srinivas Kandagatla 2020-01-13 858 (ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff,
02efb49aa805cee Srinivas Kandagatla 2020-01-13 859 ctrl->version & 0xffff);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 860
02efb49aa805cee Srinivas Kandagatla 2020-01-13 861 return 0;
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 862
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 863 err_master_add:
5cab3ff2489ede5 Pierre-Louis Bossart 2020-05-19 864 sdw_bus_master_delete(&ctrl->bus);
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 865 err_clk:
02efb49aa805cee Srinivas Kandagatla 2020-01-13 866 clk_disable_unprepare(ctrl->hclk);
91b5cfc0209b63b Pierre-Louis Bossart 2020-04-30 867 err_init:
02efb49aa805cee Srinivas Kandagatla 2020-01-13 868 return ret;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 869 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 870
:::::: 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>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23785 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
2020-11-02 19:47 drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus' kernel test robot
@ 2020-11-05 3:32 ` Randy Dunlap
2020-11-25 5:51 ` Vinod Koul
0 siblings, 1 reply; 6+ messages in thread
From: Randy Dunlap @ 2020-11-05 3:32 UTC (permalink / raw)
To: kernel test robot, Jonathan Marek
Cc: kbuild-all, linux-kernel, Vinod Koul, Bjorn Andersson, Bard Liao,
moderated for non-subscribers, Pierre-Louis Bossart
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] 6+ messages in thread
* Re: drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus'
2020-11-05 3:32 ` 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; 6+ messages in thread
From: Vinod Koul @ 2020-11-25 5:51 UTC (permalink / raw)
To: Randy Dunlap, Srinivas Kandagatla
Cc: kernel test robot, Jonathan Marek, kbuild-all, linux-kernel,
Bjorn Andersson, Bard Liao, moderated for non-subscribers,
Pierre-Louis Bossart
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] 6+ 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; 6+ messages in thread
From: Srinivas Kandagatla @ 2020-11-25 11:41 UTC (permalink / raw)
To: Vinod Koul, Randy Dunlap
Cc: kernel test robot, Jonathan Marek, kbuild-all, linux-kernel,
Bjorn Andersson, Bard Liao, moderated for non-subscribers,
Pierre-Louis Bossart
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] 6+ 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; 6+ messages in thread
From: Randy Dunlap @ 2020-11-25 17:31 UTC (permalink / raw)
To: Vinod Koul, Srinivas Kandagatla
Cc: kernel test robot, Jonathan Marek, kbuild-all, linux-kernel,
Bjorn Andersson, Bard Liao, moderated for non-subscribers,
Pierre-Louis Bossart
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] 6+ 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; 6+ messages in thread
From: Vinod Koul @ 2020-11-26 4:26 UTC (permalink / raw)
To: Randy Dunlap
Cc: Srinivas Kandagatla, kernel test robot, Jonathan Marek,
kbuild-all, linux-kernel, Bjorn Andersson, Bard Liao,
moderated for non-subscribers, Pierre-Louis Bossart
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] 6+ messages in thread
end of thread, other threads:[~2020-11-26 4:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 19:47 drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus' kernel test robot
2020-11-05 3:32 ` 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;
as well as URLs for NNTP newsgroup(s).