diff mbox series

[v3,6/6] soc: qcom: Allow COMPILE_TEST of qcom SoC Kconfigs

Message ID 20180703072034.20213-7-niklas.cassel@linaro.org
State Superseded
Headers show
Series soc: qcom: Allow COMPILE_TEST of qcom SoC Kconfigs | expand

Commit Message

Niklas Cassel July 3, 2018, 7:20 a.m. UTC
Since commit cab673583d96 ("soc: Unconditionally include qcom Makefile"),
we unconditionally include the soc/qcom/Makefile.

This opens up the possibility to compile test the code even when building
for other architectures.

Allow COMPILE_TEST for all qcom SoC Kconfigs, except for two Kconfigs
that depend on QCOM_SCM, since that triggers lots of build errors in
qcom_scm.

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>

---
 drivers/soc/qcom/Kconfig | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

-- 
2.17.1

Comments

kernel test robot July 3, 2018, 3:10 p.m. UTC | #1
Hi Niklas,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on agross/for-next]
[also build test ERROR on next-20180702]
[cannot apply to v4.18-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Niklas-Cassel/soc-qcom-Allow-COMPILE_TEST-of-qcom-SoC-Kconfigs/20180703-173055
base:   https://git.kernel.org/pub/scm/linux/kernel/git/agross/linux.git for-next
config: parisc-allmodconfig (attached as .config)
compiler: hppa-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=parisc 

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/interrupt.h:6:0,
                    from drivers//rpmsg/qcom_smd.c:7:
   drivers//rpmsg/qcom_smd.c: In function 'qcom_smd_channel_open':
>> drivers//rpmsg/qcom_smd.c:817:36: error: 'SZ_4K' undeclared (first use in this function)

     bb_size = min(channel->fifo_size, SZ_4K);
                                       ^
   include/linux/kernel.h:812:40: note: in definition of macro '__typecheck'
      (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                                           ^
   include/linux/kernel.h:836:24: note: in expansion of macro '__safe_cmp'
     __builtin_choose_expr(__safe_cmp(x, y), \
                           ^~~~~~~~~~
   include/linux/kernel.h:845:19: note: in expansion of macro '__careful_cmp'
    #define min(x, y) __careful_cmp(x, y, <)
                      ^~~~~~~~~~~~~
>> drivers//rpmsg/qcom_smd.c:817:12: note: in expansion of macro 'min'

     bb_size = min(channel->fifo_size, SZ_4K);
               ^~~
   drivers//rpmsg/qcom_smd.c:817:36: note: each undeclared identifier is reported only once for each function it appears in
     bb_size = min(channel->fifo_size, SZ_4K);
                                       ^
   include/linux/kernel.h:812:40: note: in definition of macro '__typecheck'
      (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                                           ^
   include/linux/kernel.h:836:24: note: in expansion of macro '__safe_cmp'
     __builtin_choose_expr(__safe_cmp(x, y), \
                           ^~~~~~~~~~
   include/linux/kernel.h:845:19: note: in expansion of macro '__careful_cmp'
    #define min(x, y) __careful_cmp(x, y, <)
                      ^~~~~~~~~~~~~
>> drivers//rpmsg/qcom_smd.c:817:12: note: in expansion of macro 'min'

     bb_size = min(channel->fifo_size, SZ_4K);
               ^~~
   include/linux/kernel.h:836:2: error: first argument to '__builtin_choose_expr' not a constant
     __builtin_choose_expr(__safe_cmp(x, y), \
     ^
   include/linux/kernel.h:845:19: note: in expansion of macro '__careful_cmp'
    #define min(x, y) __careful_cmp(x, y, <)
                      ^~~~~~~~~~~~~
>> drivers//rpmsg/qcom_smd.c:817:12: note: in expansion of macro 'min'

     bb_size = min(channel->fifo_size, SZ_4K);
               ^~~

vim +/SZ_4K +817 drivers//rpmsg/qcom_smd.c

53e2822e Bjorn Andersson 2016-09-01  803  
53e2822e Bjorn Andersson 2016-09-01  804  /*
53e2822e Bjorn Andersson 2016-09-01  805   * Helper for opening a channel
53e2822e Bjorn Andersson 2016-09-01  806   */
53e2822e Bjorn Andersson 2016-09-01  807  static int qcom_smd_channel_open(struct qcom_smd_channel *channel,
53e2822e Bjorn Andersson 2016-09-01  808  				 rpmsg_rx_cb_t cb)
53e2822e Bjorn Andersson 2016-09-01  809  {
268105fb Bjorn Andersson 2017-12-12  810  	struct qcom_smd_edge *edge = channel->edge;
53e2822e Bjorn Andersson 2016-09-01  811  	size_t bb_size;
268105fb Bjorn Andersson 2017-12-12  812  	int ret;
53e2822e Bjorn Andersson 2016-09-01  813  
53e2822e Bjorn Andersson 2016-09-01  814  	/*
53e2822e Bjorn Andersson 2016-09-01  815  	 * Packets are maximum 4k, but reduce if the fifo is smaller
53e2822e Bjorn Andersson 2016-09-01  816  	 */
53e2822e Bjorn Andersson 2016-09-01 @817  	bb_size = min(channel->fifo_size, SZ_4K);
53e2822e Bjorn Andersson 2016-09-01  818  	channel->bounce_buffer = kmalloc(bb_size, GFP_KERNEL);
53e2822e Bjorn Andersson 2016-09-01  819  	if (!channel->bounce_buffer)
53e2822e Bjorn Andersson 2016-09-01  820  		return -ENOMEM;
53e2822e Bjorn Andersson 2016-09-01  821  
53e2822e Bjorn Andersson 2016-09-01  822  	qcom_smd_channel_set_callback(channel, cb);
53e2822e Bjorn Andersson 2016-09-01  823  	qcom_smd_channel_set_state(channel, SMD_CHANNEL_OPENING);
268105fb Bjorn Andersson 2017-12-12  824  
268105fb Bjorn Andersson 2017-12-12  825  	/* Wait for remote to enter opening or opened */
268105fb Bjorn Andersson 2017-12-12  826  	ret = wait_event_interruptible_timeout(channel->state_change_event,
268105fb Bjorn Andersson 2017-12-12  827  			channel->remote_state == SMD_CHANNEL_OPENING ||
268105fb Bjorn Andersson 2017-12-12  828  			channel->remote_state == SMD_CHANNEL_OPENED,
268105fb Bjorn Andersson 2017-12-12  829  			HZ);
268105fb Bjorn Andersson 2017-12-12  830  	if (!ret) {
268105fb Bjorn Andersson 2017-12-12  831  		dev_err(&edge->dev, "remote side did not enter opening state\n");
268105fb Bjorn Andersson 2017-12-12  832  		goto out_close_timeout;
268105fb Bjorn Andersson 2017-12-12  833  	}
268105fb Bjorn Andersson 2017-12-12  834  
53e2822e Bjorn Andersson 2016-09-01  835  	qcom_smd_channel_set_state(channel, SMD_CHANNEL_OPENED);
53e2822e Bjorn Andersson 2016-09-01  836  
268105fb Bjorn Andersson 2017-12-12  837  	/* Wait for remote to enter opened */
268105fb Bjorn Andersson 2017-12-12  838  	ret = wait_event_interruptible_timeout(channel->state_change_event,
268105fb Bjorn Andersson 2017-12-12  839  			channel->remote_state == SMD_CHANNEL_OPENED,
268105fb Bjorn Andersson 2017-12-12  840  			HZ);
268105fb Bjorn Andersson 2017-12-12  841  	if (!ret) {
268105fb Bjorn Andersson 2017-12-12  842  		dev_err(&edge->dev, "remote side did not enter open state\n");
268105fb Bjorn Andersson 2017-12-12  843  		goto out_close_timeout;
268105fb Bjorn Andersson 2017-12-12  844  	}
268105fb Bjorn Andersson 2017-12-12  845  
53e2822e Bjorn Andersson 2016-09-01  846  	return 0;
268105fb Bjorn Andersson 2017-12-12  847  
268105fb Bjorn Andersson 2017-12-12  848  out_close_timeout:
268105fb Bjorn Andersson 2017-12-12  849  	qcom_smd_channel_set_state(channel, SMD_CHANNEL_CLOSED);
268105fb Bjorn Andersson 2017-12-12  850  	return -ETIMEDOUT;
53e2822e Bjorn Andersson 2016-09-01  851  }
53e2822e Bjorn Andersson 2016-09-01  852  

:::::: The code at line 817 was first introduced by commit
:::::: 53e2822e56c7bc67e5dc19acb1e5fbb8ebff8614 rpmsg: Introduce Qualcomm SMD backend

:::::: TO: Bjorn Andersson <bjorn.andersson@linaro.org>
:::::: CC: Bjorn Andersson <bjorn.andersson@linaro.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Niklas Cassel July 3, 2018, 4:15 p.m. UTC | #2
On Tue, Jul 03, 2018 at 11:10:53PM +0800, kbuild test robot wrote:
> Hi Niklas,

> 

> Thank you for the patch! Yet something to improve:

> 

> [auto build test ERROR on agross/for-next]

> [also build test ERROR on next-20180702]

> [cannot apply to v4.18-rc3]

> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

> 

> url:    https://github.com/0day-ci/linux/commits/Niklas-Cassel/soc-qcom-Allow-COMPILE_TEST-of-qcom-SoC-Kconfigs/20180703-173055

> base:   https://git.kernel.org/pub/scm/linux/kernel/git/agross/linux.git for-next

> config: parisc-allmodconfig (attached as .config)

> compiler: hppa-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0

> reproduce:

>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross

>         chmod +x ~/bin/make.cross

>         # save the attached .config to linux build tree

>         GCC_VERSION=7.2.0 make.cross ARCH=parisc 

> 

> All error/warnings (new ones prefixed by >>):

> 

>    In file included from include/linux/interrupt.h:6:0,

>                     from drivers//rpmsg/qcom_smd.c:7:

>    drivers//rpmsg/qcom_smd.c: In function 'qcom_smd_channel_open':

> >> drivers//rpmsg/qcom_smd.c:817:36: error: 'SZ_4K' undeclared (first use in this function)

>      bb_size = min(channel->fifo_size, SZ_4K);

>                                        ^


Hi kbuild test robot,

Thank you for your suggestion! Yet something to improve:

This is already fixed in commit
67cd0eec5b62 ("rpmsg: smd: Add missing include of sizes.h")

which is part of the latest linux-next tag.

$ git tag --contains 67cd0eec5b62
next-20180703

This tag already existed before I sent my patch series.

A suggestion is that you use the latest linux-next tag when building.

Best regards,
Niklas
diff mbox series

Patch

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index ac657164a136..fd09b95be0ba 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -33,7 +33,7 @@  config QCOM_GLINK_SSR
 
 config QCOM_GSBI
         tristate "QCOM General Serial Bus Interface"
-        depends on ARCH_QCOM
+        depends on ARCH_QCOM || COMPILE_TEST
         select MFD_SYSCON
         help
           Say y here to enable GSBI support.  The GSBI provides control
@@ -42,7 +42,7 @@  config QCOM_GSBI
 
 config QCOM_LLCC
 	tristate "Qualcomm Technologies, Inc. LLCC driver"
-	depends on ARCH_QCOM
+	depends on ARCH_QCOM || COMPILE_TEST
 	help
 	  Qualcomm Technologies, Inc. platform specific
 	  Last Level Cache Controller(LLCC) driver. This provides interfaces
@@ -73,7 +73,8 @@  config QCOM_PM
 
 config QCOM_QMI_HELPERS
 	tristate
-	depends on ARCH_QCOM && NET
+	depends on ARCH_QCOM || COMPILE_TEST
+	depends on NET
 	help
 	  Helper library for handling QMI encoded messages.  QMI encoded
 	  messages are used in communication between the majority of QRTR
@@ -104,7 +105,7 @@  config QCOM_RPMH
 
 config QCOM_SMEM
 	tristate "Qualcomm Shared Memory Manager (SMEM)"
-	depends on ARCH_QCOM
+	depends on ARCH_QCOM || COMPILE_TEST
 	depends on HWSPINLOCK
 	help
 	  Say y here to enable support for the Qualcomm Shared Memory Manager.
@@ -113,7 +114,7 @@  config QCOM_SMEM
 
 config QCOM_SMD_RPM
 	tristate "Qualcomm Resource Power Manager (RPM) over SMD"
-	depends on ARCH_QCOM
+	depends on ARCH_QCOM || COMPILE_TEST
 	depends on RPMSG
 	help
 	  If you say yes to this option, support will be included for the
@@ -150,7 +151,7 @@  config QCOM_SMSM
 
 config QCOM_WCNSS_CTRL
 	tristate "Qualcomm WCNSS control driver"
-	depends on ARCH_QCOM
+	depends on ARCH_QCOM || COMPILE_TEST
 	depends on RPMSG
 	help
 	  Client driver for the WCNSS_CTRL SMD channel, used to download nv
@@ -158,7 +159,7 @@  config QCOM_WCNSS_CTRL
 
 config QCOM_APR
 	tristate "Qualcomm APR Bus (Asynchronous Packet Router)"
-	depends on ARCH_QCOM
+	depends on ARCH_QCOM || COMPILE_TEST
 	depends on RPMSG
 	help
           Enable APR IPC protocol support between