Skip to contentSkip to conversation

hisi_lpc: Improve build test coverage

PATCH Superseded John Garry 3 participants 8 messages Oct 28, 2019 – Nov 1, 2019

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

John Garry

author
#0 lore raw

v2 cover hisi_lpc: Improve build test coverage

This series aims to improve the build test cover of the driver by supporting building under COMPILE_TEST.

I also included "lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration" as it was never picked up for 5.4.

Two new patches are also included since v1:
- clean issues detected by sparse
- build logic_pio.o into /lib library

John Garry (5):
lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at
registration
logic_pio: Define PIO_INDIRECT_SIZE for !CONFIG_INDIRECT_PIO
bus: hisi_lpc: Clean some types
bus: hisi_lpc: Expand build test coverage
logic_pio: Build into a library

 drivers/bus/Kconfig       |  4 ++--
 drivers/bus/hisi_lpc.c    |  9 ++++-----
 include/linux/logic_pio.h |  4 ++--
 lib/Makefile              |  2 +-
 lib/logic_pio.c           | 14 ++++++++------
 5 files changed, 17 insertions(+), 16 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH v2 1/5 lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration

Since the only LOGIC_PIO_INDIRECT host (hisi-lpc) now sets the ops prior to registration, enforce this check for accessors ops at registration instead of in the IO port accessors to simplify and marginally optimise the code.

A slight misalignment is also tidied.

Also add myself as an author.

---
 lib/logic_pio.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
lib/logic_pio.c +8 -6
index 905027574e5d..f511a99bb389 100644
@@ -3,6 +3,7 @@
  * Copyright (C) 2017 HiSilicon Limited, All Rights Reserved.
  * Author: Gabriele Paoloni <[email protected]>
  * Author: Zhichang Yuan <[email protected]>
+ * Author: John Garry <[email protected]>
  */
 
 #define pr_fmt(fmt)	"LOGIC PIO: " fmt
@@ -39,7 +40,8 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range)
 	resource_size_t iio_sz = MMIO_UPPER_LIMIT;
 	int ret = 0;
 
-	if (!new_range || !new_range->fwnode || !new_range->size)
+	if (!new_range || !new_range->fwnode || !new_range->size ||
+	    (new_range->flags == LOGIC_PIO_INDIRECT && !new_range->ops))
 		return -EINVAL;
 
 	start = new_range->hw_start;
@@ -237,7 +239,7 @@ type logic_in##bw(unsigned long addr)					\
 	} else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) { \
 		struct logic_pio_hwaddr *entry = find_io_range(addr);	\
 									\
-		if (entry && entry->ops)				\
+		if (entry)						\
 			ret = entry->ops->in(entry->hostdata,		\
 					addr, sizeof(type));		\
 		else							\
@@ -253,7 +255,7 @@ void logic_out##bw(type value, unsigned long addr)			\
 	} else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) {	\
 		struct logic_pio_hwaddr *entry = find_io_range(addr);	\
 									\
-		if (entry && entry->ops)				\
+		if (entry)						\
 			entry->ops->out(entry->hostdata,		\
 					addr, value, sizeof(type));	\
 		else							\
@@ -261,7 +263,7 @@ void logic_out##bw(type value, unsigned long addr)			\
 	}								\
 }									\
 									\
-void logic_ins##bw(unsigned long addr, void *buffer,		\
+void logic_ins##bw(unsigned long addr, void *buffer,			\
 		   unsigned int count)					\
 {									\
 	if (addr < MMIO_UPPER_LIMIT) {					\
@@ -269,7 +271,7 @@ void logic_ins##bw(unsigned long addr, void *buffer,		\
 	} else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) {	\
 		struct logic_pio_hwaddr *entry = find_io_range(addr);	\
 									\
-		if (entry && entry->ops)				\
+		if (entry)						\
 			entry->ops->ins(entry->hostdata,		\
 				addr, buffer, sizeof(type), count);	\
 		else							\
@@ -286,7 +288,7 @@ void logic_outs##bw(unsigned long addr, const void *buffer,		\
 	} else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) {	\
 		struct logic_pio_hwaddr *entry = find_io_range(addr);	\
 									\
-		if (entry && entry->ops)				\
+		if (entry)						\
 			entry->ops->outs(entry->hostdata,		\
 				addr, buffer, sizeof(type), count);	\
 		else							\
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH v2 2/5 logic_pio: Define PIO_INDIRECT_SIZE for !CONFIG_INDIRECT_PIO

In reply to John Garry

With the goal of expanding the test coverage of the HiSi LPC driver to !ARM64, define a dummy PIO_INDIRECT_SIZE for !CONFIG_INDIRECT_PIO, which is required by the named driver.

---
 include/linux/logic_pio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/logic_pio.h +2 -2
index 88e1e6304a71..54945aa824b4 100644
@@ -108,10 +108,10 @@ void logic_outsl(unsigned long addr, const void *buffer, unsigned int count);
  * area by redefining the macro below.
  */
 #define PIO_INDIRECT_SIZE 0x4000
-#define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE)
 #else
-#define MMIO_UPPER_LIMIT IO_SPACE_LIMIT
+#define PIO_INDIRECT_SIZE 0
 #endif /* CONFIG_INDIRECT_PIO */
+#define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE)
 
 struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode);
 unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
Signature · 1 line
2.17.1
author
#3 lore raw

PATCH v2 3/5 bus: hisi_lpc: Clean some types

In reply to John Garry

Sparse complains of these:
drivers/bus/hisi_lpc.c:82:38: warning: incorrect type in argument 1 (different address spaces)
drivers/bus/hisi_lpc.c:82:38: expected void const volatile [noderef] <asn:2>*addr
drivers/bus/hisi_lpc.c:82:38: got unsigned char *
drivers/bus/hisi_lpc.c:131:35: warning: incorrect type in argument 1 (different address spaces)
drivers/bus/hisi_lpc.c:131:35: expected unsigned char *mbase
drivers/bus/hisi_lpc.c:131:35: got void [noderef] <asn:2>*membase
drivers/bus/hisi_lpc.c:186:35: warning: incorrect type in argument 1 (different address spaces)
drivers/bus/hisi_lpc.c:186:35: expected unsigned char *mbase
drivers/bus/hisi_lpc.c:186:35: got void [noderef] <asn:2>*membase
drivers/bus/hisi_lpc.c:228:16: warning: cast to restricted __le32 drivers/bus/hisi_lpc.c:251:13: warning: incorrect type in assignment (different base types)
drivers/bus/hisi_lpc.c:251:13: expected unsigned int [unsigned] [usertype] val
drivers/bus/hisi_lpc.c:251:13: got restricted __le32 [usertype] <noident>

Clean them up.

---
 drivers/bus/hisi_lpc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/bus/hisi_lpc.c +4 -5
index 20c957185af2..8101df901830 100644
@@ -74,7 +74,7 @@ struct hisi_lpc_dev {
 /* About 10us. This is specific for single IO operations, such as inb */
 #define LPC_PEROP_WAITCNT	100
 
-static int wait_lpc_idle(unsigned char *mbase, unsigned int waitcnt)
+static int wait_lpc_idle(void __iomem *mbase, unsigned int waitcnt)
 {
 	u32 status;
 
@@ -209,7 +209,7 @@ static u32 hisi_lpc_comm_in(void *hostdata, unsigned long pio, size_t dwidth)
 	struct hisi_lpc_dev *lpcdev = hostdata;
 	struct lpc_cycle_para iopara;
 	unsigned long addr;
-	u32 rd_data = 0;
+	__le32 rd_data = 0;
 	int ret;
 
 	if (!lpcdev || !dwidth || dwidth > LPC_MAX_DWIDTH)
@@ -244,13 +244,12 @@ static void hisi_lpc_comm_out(void *hostdata, unsigned long pio,
 	struct lpc_cycle_para iopara;
 	const unsigned char *buf;
 	unsigned long addr;
+	__le32 _val = cpu_to_le32(val);
 
 	if (!lpcdev || !dwidth || dwidth > LPC_MAX_DWIDTH)
 		return;
 
-	val = cpu_to_le32(val);
-
-	buf = (const unsigned char *)&val;
+	buf = (const unsigned char *)&_val;
 	addr = hisi_lpc_pio_to_addr(lpcdev, pio);
 
 	iopara.opflags = FG_INCRADDR_LPC;
Signature · 1 line
2.17.1
author
#4 lore raw

PATCH v2 4/5 bus: hisi_lpc: Expand build test coverage

In reply to John Garry

Currently the driver will only ever be built for ARM64 because it selects CONFIG_INDIRECT_PIO, which itself depends on ARM64.

Expand build test coverage for the driver to other architectures by only selecting CONFIG_INDIRECT_PIO for ARM64, when we really want it.

---
 drivers/bus/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bus/Kconfig +2 -2
index 6b331061d34b..44cb4b6bea18 100644
@@ -41,8 +41,8 @@ config MOXTET
 
 config HISILICON_LPC
 	bool "Support for ISA I/O space on HiSilicon Hip06/7"
-	depends on ARM64 && (ARCH_HISI || COMPILE_TEST)
-	select INDIRECT_PIO
+	depends on (ARM64 && ARCH_HISI) || COMPILE_TEST
+	select INDIRECT_PIO if ARM64
 	help
 	  Driver to enable I/O access to devices attached to the Low Pin
 	  Count bus on the HiSilicon Hip06/7 SoC.
Signature · 1 line
2.17.1
#5 lore raw

Re: [PATCH v2 4/5] bus: hisi_lpc: Expand build test coverage

I love your patch! Yet something to improve:

Hi John,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.4-rc5 next-20191031]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/John-Garry/lib-logic_pio-Enforce-LOGIC_PIO_INDIRECT-region-ops-are-set-at-registration/20191030-081925
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 23fdb198ae81f47a574296dab5167c5e136a02ba
config: parisc-allmodconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.4.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.4.0 make.cross ARCH=parisc

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

drivers//bus/hisi_lpc.c: In function 'hisi_lpc_target_in':

>> drivers//bus/hisi_lpc.c:137:2: error: implicit declaration of function 'readsb'; did you mean 'readb'? [-Werror=implicit-function-declaration]
     readsb(lpcdev->membase + LPC_REG_RDATA, buf, opcnt);
     ^~~~~~
     readb
   drivers//bus/hisi_lpc.c: In function 'hisi_lpc_target_out':
>> drivers//bus/hisi_lpc.c:180:2: error: implicit declaration of function 'writesb'; did you mean 'writeb'? [-Werror=implicit-function-declaration]
     writesb(lpcdev->membase + LPC_REG_WDATA, buf, opcnt);
     ^~~~~~~
     writeb

cc1: some warnings being treated as errors

vim +137 drivers//bus/hisi_lpc.c

adf38bb0b5956a Zhichang Yuan 2018-03-21   90  
adf38bb0b5956a Zhichang Yuan 2018-03-21   91  /*
adf38bb0b5956a Zhichang Yuan 2018-03-21   92   * hisi_lpc_target_in - trigger a series of LPC cycles for read operation
adf38bb0b5956a Zhichang Yuan 2018-03-21   93   * @lpcdev: pointer to hisi lpc device
adf38bb0b5956a Zhichang Yuan 2018-03-21   94   * @para: some parameters used to control the lpc I/O operations
adf38bb0b5956a Zhichang Yuan 2018-03-21   95   * @addr: the lpc I/O target port address
adf38bb0b5956a Zhichang Yuan 2018-03-21   96   * @buf: where the read back data is stored
adf38bb0b5956a Zhichang Yuan 2018-03-21   97   * @opcnt: how many I/O operations required, i.e. data width
adf38bb0b5956a Zhichang Yuan 2018-03-21   98   *
adf38bb0b5956a Zhichang Yuan 2018-03-21   99   * Returns 0 on success, non-zero on fail.
adf38bb0b5956a Zhichang Yuan 2018-03-21  100   */
adf38bb0b5956a Zhichang Yuan 2018-03-21  101  static int hisi_lpc_target_in(struct hisi_lpc_dev *lpcdev,
adf38bb0b5956a Zhichang Yuan 2018-03-21  102  			      struct lpc_cycle_para *para, unsigned long addr,
adf38bb0b5956a Zhichang Yuan 2018-03-21  103  			      unsigned char *buf, unsigned long opcnt)
adf38bb0b5956a Zhichang Yuan 2018-03-21  104  {
adf38bb0b5956a Zhichang Yuan 2018-03-21  105  	unsigned int cmd_word;
adf38bb0b5956a Zhichang Yuan 2018-03-21  106  	unsigned int waitcnt;
adf38bb0b5956a Zhichang Yuan 2018-03-21  107  	unsigned long flags;
adf38bb0b5956a Zhichang Yuan 2018-03-21  108  	int ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21  109  
adf38bb0b5956a Zhichang Yuan 2018-03-21  110  	if (!buf || !opcnt || !para || !para->csize || !lpcdev)
adf38bb0b5956a Zhichang Yuan 2018-03-21  111  		return -EINVAL;
adf38bb0b5956a Zhichang Yuan 2018-03-21  112  
adf38bb0b5956a Zhichang Yuan 2018-03-21  113  	cmd_word = 0; /* IO mode, Read */
adf38bb0b5956a Zhichang Yuan 2018-03-21  114  	waitcnt = LPC_PEROP_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21  115  	if (!(para->opflags & FG_INCRADDR_LPC)) {
adf38bb0b5956a Zhichang Yuan 2018-03-21  116  		cmd_word |= LPC_REG_CMD_SAMEADDR;
adf38bb0b5956a Zhichang Yuan 2018-03-21  117  		waitcnt = LPC_MAX_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21  118  	}
adf38bb0b5956a Zhichang Yuan 2018-03-21  119  
adf38bb0b5956a Zhichang Yuan 2018-03-21  120  	/* whole operation must be atomic */
adf38bb0b5956a Zhichang Yuan 2018-03-21  121  	spin_lock_irqsave(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21  122  
adf38bb0b5956a Zhichang Yuan 2018-03-21  123  	writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
adf38bb0b5956a Zhichang Yuan 2018-03-21  124  	writel_relaxed(cmd_word, lpcdev->membase + LPC_REG_CMD);
adf38bb0b5956a Zhichang Yuan 2018-03-21  125  	writel_relaxed(addr, lpcdev->membase + LPC_REG_ADDR);
adf38bb0b5956a Zhichang Yuan 2018-03-21  126  
adf38bb0b5956a Zhichang Yuan 2018-03-21  127  	writel(LPC_REG_STARTUP_SIGNAL_START,
adf38bb0b5956a Zhichang Yuan 2018-03-21  128  	       lpcdev->membase + LPC_REG_STARTUP_SIGNAL);
adf38bb0b5956a Zhichang Yuan 2018-03-21  129  
adf38bb0b5956a Zhichang Yuan 2018-03-21  130  	/* whether the operation is finished */
adf38bb0b5956a Zhichang Yuan 2018-03-21  131  	ret = wait_lpc_idle(lpcdev->membase, waitcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21  132  	if (ret) {
adf38bb0b5956a Zhichang Yuan 2018-03-21  133  		spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21  134  		return ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21  135  	}
adf38bb0b5956a Zhichang Yuan 2018-03-21  136  
adf38bb0b5956a Zhichang Yuan 2018-03-21 @137  	readsb(lpcdev->membase + LPC_REG_RDATA, buf, opcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21  138  
adf38bb0b5956a Zhichang Yuan 2018-03-21  139  	spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21  140  
adf38bb0b5956a Zhichang Yuan 2018-03-21  141  	return 0;
adf38bb0b5956a Zhichang Yuan 2018-03-21  142  }
adf38bb0b5956a Zhichang Yuan 2018-03-21  143  
adf38bb0b5956a Zhichang Yuan 2018-03-21  144  /*
adf38bb0b5956a Zhichang Yuan 2018-03-21  145   * hisi_lpc_target_out - trigger a series of LPC cycles for write operation
adf38bb0b5956a Zhichang Yuan 2018-03-21  146   * @lpcdev: pointer to hisi lpc device
adf38bb0b5956a Zhichang Yuan 2018-03-21  147   * @para: some parameters used to control the lpc I/O operations
adf38bb0b5956a Zhichang Yuan 2018-03-21  148   * @addr: the lpc I/O target port address
adf38bb0b5956a Zhichang Yuan 2018-03-21  149   * @buf: where the data to be written is stored
adf38bb0b5956a Zhichang Yuan 2018-03-21  150   * @opcnt: how many I/O operations required, i.e. data width
adf38bb0b5956a Zhichang Yuan 2018-03-21  151   *
adf38bb0b5956a Zhichang Yuan 2018-03-21  152   * Returns 0 on success, non-zero on fail.
adf38bb0b5956a Zhichang Yuan 2018-03-21  153   */
adf38bb0b5956a Zhichang Yuan 2018-03-21  154  static int hisi_lpc_target_out(struct hisi_lpc_dev *lpcdev,
adf38bb0b5956a Zhichang Yuan 2018-03-21  155  			       struct lpc_cycle_para *para, unsigned long addr,
adf38bb0b5956a Zhichang Yuan 2018-03-21  156  			       const unsigned char *buf, unsigned long opcnt)
adf38bb0b5956a Zhichang Yuan 2018-03-21  157  {
adf38bb0b5956a Zhichang Yuan 2018-03-21  158  	unsigned int waitcnt;
adf38bb0b5956a Zhichang Yuan 2018-03-21  159  	unsigned long flags;
adf38bb0b5956a Zhichang Yuan 2018-03-21  160  	u32 cmd_word;
adf38bb0b5956a Zhichang Yuan 2018-03-21  161  	int ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21  162  
adf38bb0b5956a Zhichang Yuan 2018-03-21  163  	if (!buf || !opcnt || !para || !lpcdev)
adf38bb0b5956a Zhichang Yuan 2018-03-21  164  		return -EINVAL;
adf38bb0b5956a Zhichang Yuan 2018-03-21  165  
adf38bb0b5956a Zhichang Yuan 2018-03-21  166  	/* default is increasing address */
adf38bb0b5956a Zhichang Yuan 2018-03-21  167  	cmd_word = LPC_REG_CMD_OP; /* IO mode, write */
adf38bb0b5956a Zhichang Yuan 2018-03-21  168  	waitcnt = LPC_PEROP_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21  169  	if (!(para->opflags & FG_INCRADDR_LPC)) {
adf38bb0b5956a Zhichang Yuan 2018-03-21  170  		cmd_word |= LPC_REG_CMD_SAMEADDR;
adf38bb0b5956a Zhichang Yuan 2018-03-21  171  		waitcnt = LPC_MAX_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21  172  	}
adf38bb0b5956a Zhichang Yuan 2018-03-21  173  
adf38bb0b5956a Zhichang Yuan 2018-03-21  174  	spin_lock_irqsave(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21  175  
adf38bb0b5956a Zhichang Yuan 2018-03-21  176  	writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
adf38bb0b5956a Zhichang Yuan 2018-03-21  177  	writel_relaxed(cmd_word, lpcdev->membase + LPC_REG_CMD);
adf38bb0b5956a Zhichang Yuan 2018-03-21  178  	writel_relaxed(addr, lpcdev->membase + LPC_REG_ADDR);
adf38bb0b5956a Zhichang Yuan 2018-03-21  179  
adf38bb0b5956a Zhichang Yuan 2018-03-21 @180  	writesb(lpcdev->membase + LPC_REG_WDATA, buf, opcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21  181  
adf38bb0b5956a Zhichang Yuan 2018-03-21  182  	writel(LPC_REG_STARTUP_SIGNAL_START,
adf38bb0b5956a Zhichang Yuan 2018-03-21  183  	       lpcdev->membase + LPC_REG_STARTUP_SIGNAL);
adf38bb0b5956a Zhichang Yuan 2018-03-21  184  
adf38bb0b5956a Zhichang Yuan 2018-03-21  185  	/* whether the operation is finished */
adf38bb0b5956a Zhichang Yuan 2018-03-21  186  	ret = wait_lpc_idle(lpcdev->membase, waitcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21  187  
adf38bb0b5956a Zhichang Yuan 2018-03-21  188  	spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21  189  
adf38bb0b5956a Zhichang Yuan 2018-03-21  190  	return ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21  191  }
adf38bb0b5956a Zhichang Yuan 2018-03-21  192  

:::::: The code at line 137 was first introduced by commit
:::::: adf38bb0b5956ab5469acb1ca981a9287c7ad1d8 HISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings

:::::: TO: Zhichang Yuan <[email protected]> :::::: CC: Bjorn Helgaas <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

author
#6 lore raw

PATCH v2 5/5 logic_pio: Build into a library

In reply to John Garry

Object file logic_pio.o is always built.

Ideally the object file should only be built when required. This is tricky, as that would be for archs which define PCI_IOBASE, but no common config option exists for that.

For now, continue to always build but at least ensure the symbols are not included in the vmlinux when not referenced.

---
 lib/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Makefile +1 -1
index c5892807e06f..27645143d8bb 100644
@@ -108,7 +108,7 @@ obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o
 obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o
 obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
 
-obj-y += logic_pio.o
+lib-y += logic_pio.o
 
 obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
 
Signature · 1 line
2.17.1
#7 lore raw
In reply to John Garry
Quoted 18 lines · John Garry

This series aims to improve the build test cover of the driver by supporting building under COMPILE_TEST.

I also included "lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration" as it was never picked up for 5.4.

Two new patches are also included since v1:
- clean issues detected by sparse
- build logic_pio.o into /lib library

John Garry (5):
lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at
registration
logic_pio: Define PIO_INDIRECT_SIZE for !CONFIG_INDIRECT_PIO
bus: hisi_lpc: Clean some types
bus: hisi_lpc: Expand build test coverage
logic_pio: Build into a library

Quoted 7 lines
  drivers/bus/Kconfig       |  4 ++--
  drivers/bus/hisi_lpc.c    |  9 ++++-----
  include/linux/logic_pio.h |  4 ++--
  lib/Makefile              |  2 +-
  lib/logic_pio.c           | 14 ++++++++------
  5 files changed, 17 insertions(+), 16 deletions(-)

Thanks!
Series applied to the hisilicon driver tree.

Best Regards,
Wei