* [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c
[not found] <cover.1744964101.git.xiaopei01@kylinos.cn>
@ 2025-04-18 8:51 ` xiaopeitux
2025-04-19 8:01 ` kernel test robot
` (2 more replies)
2025-04-18 8:51 ` [PATCH 2/2] logic_pio: Add detailed comments for find_io_range() and logic_pio_trans_cpuaddr() xiaopeitux
1 sibling, 3 replies; 9+ messages in thread
From: xiaopeitux @ 2025-04-18 8:51 UTC (permalink / raw)
To: linux-kernel, f.fangjian, robh, john.g.garry, andriy.shevchenko,
xuwei5
Cc: Pei Xiao
From: Pei Xiao <xiaopei01@kylinos.cn>
linux/console.h,linux/io.h,linux/pci.h,linux/slab.h
are not used, this patch removes it.
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
---
drivers/bus/hisi_lpc.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c
index 53dd1573e323..1fcc3f51f9ca 100644
--- a/drivers/bus/hisi_lpc.c
+++ b/drivers/bus/hisi_lpc.c
@@ -7,17 +7,13 @@
*/
#include <linux/acpi.h>
-#include <linux/console.h>
#include <linux/delay.h>
-#include <linux/io.h>
#include <linux/logic_pio.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
-#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/serial_8250.h>
-#include <linux/slab.h>
#define DRV_NAME "hisi-lpc"
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] logic_pio: Add detailed comments for find_io_range() and logic_pio_trans_cpuaddr()
[not found] <cover.1744964101.git.xiaopei01@kylinos.cn>
2025-04-18 8:51 ` [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c xiaopeitux
@ 2025-04-18 8:51 ` xiaopeitux
2025-04-19 15:21 ` Andy Shevchenko
1 sibling, 1 reply; 9+ messages in thread
From: xiaopeitux @ 2025-04-18 8:51 UTC (permalink / raw)
To: linux-kernel, f.fangjian, robh, john.g.garry, andriy.shevchenko,
xuwei5
Cc: Pei Xiao
From: Pei Xiao <xiaopei01@kylinos.cn>
Add comments that we were previously overlooked for find_io_range()
and logic_pio_trans_cpuaddr().
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
---
lib/logic_pio.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/lib/logic_pio.c b/lib/logic_pio.c
index e29496a38d06..3a49f424acc0 100644
--- a/lib/logic_pio.c
+++ b/lib/logic_pio.c
@@ -138,7 +138,15 @@ struct logic_pio_hwaddr *find_io_range_by_fwnode(const struct fwnode_handle *fwn
return found_range;
}
-/* Return a registered range given an input PIO token */
+/**
+ * find_io_range - find a registered range by PIO
+ * @pio: logical PIO value
+ *
+ * Return a registered range, NULL otherwise.
+ *
+ * Traverse the io_range_list to find the registered node for @pio.
+ * The input PIO should be unique in the whole logical PIO space.
+ */
static struct logic_pio_hwaddr *find_io_range(unsigned long pio)
{
struct logic_pio_hwaddr *range, *found_range = NULL;
@@ -204,6 +212,12 @@ unsigned long logic_pio_trans_hwaddr(const struct fwnode_handle *fwnode,
return addr - range->hw_start + range->io_start;
}
+/**
+ * logic_pio_trans_cpuaddr - translate CPU address to logical PIO
+ * @addr: Host-relative CPU address
+ *
+ * Returns Logical PIO value if successful, ~0UL otherwise
+ */
unsigned long logic_pio_trans_cpuaddr(resource_size_t addr)
{
struct logic_pio_hwaddr *range;
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c
2025-04-18 8:51 ` [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c xiaopeitux
@ 2025-04-19 8:01 ` kernel test robot
2025-04-19 15:22 ` Andy Shevchenko
2025-04-21 11:34 ` kernel test robot
2 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2025-04-19 8:01 UTC (permalink / raw)
To: xiaopeitux, linux-kernel, f.fangjian, robh, john.g.garry,
andriy.shevchenko, xuwei5
Cc: llvm, oe-kbuild-all, Pei Xiao
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-nonmm-unstable]
[also build test ERROR on linus/master v6.15-rc2 next-20250417]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/xiaopeitux-foxmail-com/logic_pio-Add-detailed-comments-for-find_io_range-and-logic_pio_trans_cpuaddr/20250418-171121
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
patch link: https://lore.kernel.org/r/tencent_8024B8D7E209E31C8E2B5AC411B70C551106%40qq.com
patch subject: [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c
config: i386-buildonly-randconfig-004-20250419 (https://download.01.org/0day-ci/archive/20250419/202504191505.nkccQttS-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250419/202504191505.nkccQttS-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504191505.nkccQttS-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/bus/hisi_lpc.c:78:12: error: call to undeclared function 'readl'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
78 | status = readl(mbase + LPC_REG_OP_STATUS);
| ^
>> drivers/bus/hisi_lpc.c:119:2: error: call to undeclared function 'writel_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
119 | writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
| ^
>> drivers/bus/hisi_lpc.c:123:2: error: call to undeclared function 'writel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
123 | writel(LPC_REG_STARTUP_SIGNAL_START,
| ^
>> drivers/bus/hisi_lpc.c:133:2: error: call to undeclared function 'readsb'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
133 | readsb(lpcdev->membase + LPC_REG_RDATA, buf, opcnt);
| ^
drivers/bus/hisi_lpc.c:172:2: error: call to undeclared function 'writel_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
172 | writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
| ^
>> drivers/bus/hisi_lpc.c:176:2: error: call to undeclared function 'writesb'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
176 | writesb(lpcdev->membase + LPC_REG_WDATA, buf, opcnt);
| ^
drivers/bus/hisi_lpc.c:178:2: error: call to undeclared function 'writel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
178 | writel(LPC_REG_STARTUP_SIGNAL_START,
| ^
7 errors generated.
vim +/readl +78 drivers/bus/hisi_lpc.c
adf38bb0b5956a Zhichang Yuan 2018-03-21 72
663accf1872b22 John Garry 2019-11-05 73 static int wait_lpc_idle(void __iomem *mbase, unsigned int waitcnt)
adf38bb0b5956a Zhichang Yuan 2018-03-21 74 {
adf38bb0b5956a Zhichang Yuan 2018-03-21 75 u32 status;
adf38bb0b5956a Zhichang Yuan 2018-03-21 76
adf38bb0b5956a Zhichang Yuan 2018-03-21 77 do {
adf38bb0b5956a Zhichang Yuan 2018-03-21 @78 status = readl(mbase + LPC_REG_OP_STATUS);
adf38bb0b5956a Zhichang Yuan 2018-03-21 79 if (status & LPC_REG_OP_STATUS_IDLE)
adf38bb0b5956a Zhichang Yuan 2018-03-21 80 return (status & LPC_REG_OP_STATUS_FINISHED) ? 0 : -EIO;
adf38bb0b5956a Zhichang Yuan 2018-03-21 81 ndelay(LPC_NSEC_PERWAIT);
adf38bb0b5956a Zhichang Yuan 2018-03-21 82 } while (--waitcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21 83
5e3e70b8e1ae98 Andy Shevchenko 2022-09-05 84 return -ETIMEDOUT;
adf38bb0b5956a Zhichang Yuan 2018-03-21 85 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 86
adf38bb0b5956a Zhichang Yuan 2018-03-21 87 /*
adf38bb0b5956a Zhichang Yuan 2018-03-21 88 * hisi_lpc_target_in - trigger a series of LPC cycles for read operation
adf38bb0b5956a Zhichang Yuan 2018-03-21 89 * @lpcdev: pointer to hisi lpc device
adf38bb0b5956a Zhichang Yuan 2018-03-21 90 * @para: some parameters used to control the lpc I/O operations
adf38bb0b5956a Zhichang Yuan 2018-03-21 91 * @addr: the lpc I/O target port address
adf38bb0b5956a Zhichang Yuan 2018-03-21 92 * @buf: where the read back data is stored
adf38bb0b5956a Zhichang Yuan 2018-03-21 93 * @opcnt: how many I/O operations required, i.e. data width
adf38bb0b5956a Zhichang Yuan 2018-03-21 94 *
adf38bb0b5956a Zhichang Yuan 2018-03-21 95 * Returns 0 on success, non-zero on fail.
adf38bb0b5956a Zhichang Yuan 2018-03-21 96 */
adf38bb0b5956a Zhichang Yuan 2018-03-21 97 static int hisi_lpc_target_in(struct hisi_lpc_dev *lpcdev,
adf38bb0b5956a Zhichang Yuan 2018-03-21 98 struct lpc_cycle_para *para, unsigned long addr,
adf38bb0b5956a Zhichang Yuan 2018-03-21 99 unsigned char *buf, unsigned long opcnt)
adf38bb0b5956a Zhichang Yuan 2018-03-21 100 {
adf38bb0b5956a Zhichang Yuan 2018-03-21 101 unsigned int cmd_word;
adf38bb0b5956a Zhichang Yuan 2018-03-21 102 unsigned int waitcnt;
adf38bb0b5956a Zhichang Yuan 2018-03-21 103 unsigned long flags;
adf38bb0b5956a Zhichang Yuan 2018-03-21 104 int ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21 105
adf38bb0b5956a Zhichang Yuan 2018-03-21 106 if (!buf || !opcnt || !para || !para->csize || !lpcdev)
adf38bb0b5956a Zhichang Yuan 2018-03-21 107 return -EINVAL;
adf38bb0b5956a Zhichang Yuan 2018-03-21 108
adf38bb0b5956a Zhichang Yuan 2018-03-21 109 cmd_word = 0; /* IO mode, Read */
adf38bb0b5956a Zhichang Yuan 2018-03-21 110 waitcnt = LPC_PEROP_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21 111 if (!(para->opflags & FG_INCRADDR_LPC)) {
adf38bb0b5956a Zhichang Yuan 2018-03-21 112 cmd_word |= LPC_REG_CMD_SAMEADDR;
adf38bb0b5956a Zhichang Yuan 2018-03-21 113 waitcnt = LPC_MAX_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21 114 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 115
adf38bb0b5956a Zhichang Yuan 2018-03-21 116 /* whole operation must be atomic */
adf38bb0b5956a Zhichang Yuan 2018-03-21 117 spin_lock_irqsave(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 118
adf38bb0b5956a Zhichang Yuan 2018-03-21 @119 writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
adf38bb0b5956a Zhichang Yuan 2018-03-21 120 writel_relaxed(cmd_word, lpcdev->membase + LPC_REG_CMD);
adf38bb0b5956a Zhichang Yuan 2018-03-21 121 writel_relaxed(addr, lpcdev->membase + LPC_REG_ADDR);
adf38bb0b5956a Zhichang Yuan 2018-03-21 122
adf38bb0b5956a Zhichang Yuan 2018-03-21 @123 writel(LPC_REG_STARTUP_SIGNAL_START,
adf38bb0b5956a Zhichang Yuan 2018-03-21 124 lpcdev->membase + LPC_REG_STARTUP_SIGNAL);
adf38bb0b5956a Zhichang Yuan 2018-03-21 125
adf38bb0b5956a Zhichang Yuan 2018-03-21 126 /* whether the operation is finished */
adf38bb0b5956a Zhichang Yuan 2018-03-21 127 ret = wait_lpc_idle(lpcdev->membase, waitcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21 128 if (ret) {
adf38bb0b5956a Zhichang Yuan 2018-03-21 129 spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 130 return ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21 131 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 132
adf38bb0b5956a Zhichang Yuan 2018-03-21 @133 readsb(lpcdev->membase + LPC_REG_RDATA, buf, opcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21 134
adf38bb0b5956a Zhichang Yuan 2018-03-21 135 spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 136
adf38bb0b5956a Zhichang Yuan 2018-03-21 137 return 0;
adf38bb0b5956a Zhichang Yuan 2018-03-21 138 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 139
adf38bb0b5956a Zhichang Yuan 2018-03-21 140 /*
adf38bb0b5956a Zhichang Yuan 2018-03-21 141 * hisi_lpc_target_out - trigger a series of LPC cycles for write operation
adf38bb0b5956a Zhichang Yuan 2018-03-21 142 * @lpcdev: pointer to hisi lpc device
adf38bb0b5956a Zhichang Yuan 2018-03-21 143 * @para: some parameters used to control the lpc I/O operations
adf38bb0b5956a Zhichang Yuan 2018-03-21 144 * @addr: the lpc I/O target port address
adf38bb0b5956a Zhichang Yuan 2018-03-21 145 * @buf: where the data to be written is stored
adf38bb0b5956a Zhichang Yuan 2018-03-21 146 * @opcnt: how many I/O operations required, i.e. data width
adf38bb0b5956a Zhichang Yuan 2018-03-21 147 *
adf38bb0b5956a Zhichang Yuan 2018-03-21 148 * Returns 0 on success, non-zero on fail.
adf38bb0b5956a Zhichang Yuan 2018-03-21 149 */
adf38bb0b5956a Zhichang Yuan 2018-03-21 150 static int hisi_lpc_target_out(struct hisi_lpc_dev *lpcdev,
adf38bb0b5956a Zhichang Yuan 2018-03-21 151 struct lpc_cycle_para *para, unsigned long addr,
adf38bb0b5956a Zhichang Yuan 2018-03-21 152 const unsigned char *buf, unsigned long opcnt)
adf38bb0b5956a Zhichang Yuan 2018-03-21 153 {
adf38bb0b5956a Zhichang Yuan 2018-03-21 154 unsigned int waitcnt;
adf38bb0b5956a Zhichang Yuan 2018-03-21 155 unsigned long flags;
adf38bb0b5956a Zhichang Yuan 2018-03-21 156 u32 cmd_word;
adf38bb0b5956a Zhichang Yuan 2018-03-21 157 int ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21 158
adf38bb0b5956a Zhichang Yuan 2018-03-21 159 if (!buf || !opcnt || !para || !lpcdev)
adf38bb0b5956a Zhichang Yuan 2018-03-21 160 return -EINVAL;
adf38bb0b5956a Zhichang Yuan 2018-03-21 161
adf38bb0b5956a Zhichang Yuan 2018-03-21 162 /* default is increasing address */
adf38bb0b5956a Zhichang Yuan 2018-03-21 163 cmd_word = LPC_REG_CMD_OP; /* IO mode, write */
adf38bb0b5956a Zhichang Yuan 2018-03-21 164 waitcnt = LPC_PEROP_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21 165 if (!(para->opflags & FG_INCRADDR_LPC)) {
adf38bb0b5956a Zhichang Yuan 2018-03-21 166 cmd_word |= LPC_REG_CMD_SAMEADDR;
adf38bb0b5956a Zhichang Yuan 2018-03-21 167 waitcnt = LPC_MAX_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21 168 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 169
adf38bb0b5956a Zhichang Yuan 2018-03-21 170 spin_lock_irqsave(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 171
adf38bb0b5956a Zhichang Yuan 2018-03-21 172 writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
adf38bb0b5956a Zhichang Yuan 2018-03-21 173 writel_relaxed(cmd_word, lpcdev->membase + LPC_REG_CMD);
adf38bb0b5956a Zhichang Yuan 2018-03-21 174 writel_relaxed(addr, lpcdev->membase + LPC_REG_ADDR);
adf38bb0b5956a Zhichang Yuan 2018-03-21 175
adf38bb0b5956a Zhichang Yuan 2018-03-21 @176 writesb(lpcdev->membase + LPC_REG_WDATA, buf, opcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21 177
adf38bb0b5956a Zhichang Yuan 2018-03-21 178 writel(LPC_REG_STARTUP_SIGNAL_START,
adf38bb0b5956a Zhichang Yuan 2018-03-21 179 lpcdev->membase + LPC_REG_STARTUP_SIGNAL);
adf38bb0b5956a Zhichang Yuan 2018-03-21 180
adf38bb0b5956a Zhichang Yuan 2018-03-21 181 /* whether the operation is finished */
adf38bb0b5956a Zhichang Yuan 2018-03-21 182 ret = wait_lpc_idle(lpcdev->membase, waitcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21 183
adf38bb0b5956a Zhichang Yuan 2018-03-21 184 spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 185
adf38bb0b5956a Zhichang Yuan 2018-03-21 186 return ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21 187 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 188
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] logic_pio: Add detailed comments for find_io_range() and logic_pio_trans_cpuaddr()
2025-04-18 8:51 ` [PATCH 2/2] logic_pio: Add detailed comments for find_io_range() and logic_pio_trans_cpuaddr() xiaopeitux
@ 2025-04-19 15:21 ` Andy Shevchenko
0 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2025-04-19 15:21 UTC (permalink / raw)
To: xiaopeitux; +Cc: linux-kernel, f.fangjian, robh, john.g.garry, xuwei5, Pei Xiao
On Fri, Apr 18, 2025 at 04:51:45PM +0800, xiaopeitux@foxmail.com wrote:
> From: Pei Xiao <xiaopei01@kylinos.cn>
>
> Add comments that we were previously overlooked for find_io_range()
> and logic_pio_trans_cpuaddr().
You haven't run definitely the kernel-doc validator. There are missing Return
sections. And even style for returned value description differs in two...
Also, you have an issue with your tools, the cover letter is detached from the
patches. Please, take your time and fix that.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c
2025-04-18 8:51 ` [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c xiaopeitux
2025-04-19 8:01 ` kernel test robot
@ 2025-04-19 15:22 ` Andy Shevchenko
2025-04-21 2:06 ` Pei Xiao
2025-04-21 11:34 ` kernel test robot
2 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2025-04-19 15:22 UTC (permalink / raw)
To: xiaopeitux; +Cc: linux-kernel, f.fangjian, robh, john.g.garry, xuwei5, Pei Xiao
On Fri, Apr 18, 2025 at 04:51:23PM +0800, xiaopeitux@foxmail.com wrote:
> From: Pei Xiao <xiaopei01@kylinos.cn>
>
> linux/console.h,linux/io.h,linux/pci.h,linux/slab.h
> are not used, this patch removes it.
Definitely you haven't tested this...
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c
2025-04-19 15:22 ` Andy Shevchenko
@ 2025-04-21 2:06 ` Pei Xiao
2025-04-22 7:58 ` Andy Shevchenko
0 siblings, 1 reply; 9+ messages in thread
From: Pei Xiao @ 2025-04-21 2:06 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-kernel, f.fangjian, robh, john.g.garry, xuwei5, Pei Xiao
在 2025/4/19 23:22, Andy Shevchenko 写道:
> On Fri, Apr 18, 2025 at 04:51:23PM +0800, xiaopeitux@foxmail.com wrote:
>> From: Pei Xiao <xiaopei01@kylinos.cn>
>>
>> linux/console.h,linux/io.h,linux/pci.h,linux/slab.h
>> are not used, this patch removes it.
> Definitely you haven't tested this...
Sorry for that,I have tested in ARM64 platform, have no build problem,sorry for that!
Pei ,
thanks!
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c
2025-04-18 8:51 ` [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c xiaopeitux
2025-04-19 8:01 ` kernel test robot
2025-04-19 15:22 ` Andy Shevchenko
@ 2025-04-21 11:34 ` kernel test robot
2 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2025-04-21 11:34 UTC (permalink / raw)
To: xiaopeitux, linux-kernel, f.fangjian, robh, john.g.garry,
andriy.shevchenko, xuwei5
Cc: oe-kbuild-all, Pei Xiao
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-nonmm-unstable]
[also build test ERROR on linus/master v6.15-rc2 next-20250417]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/xiaopeitux-foxmail-com/logic_pio-Add-detailed-comments-for-find_io_range-and-logic_pio_trans_cpuaddr/20250418-171121
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
patch link: https://lore.kernel.org/r/tencent_8024B8D7E209E31C8E2B5AC411B70C551106%40qq.com
patch subject: [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c
config: sparc-allmodconfig (https://download.01.org/0day-ci/archive/20250421/202504211900.1fwfyPp3-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250421/202504211900.1fwfyPp3-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504211900.1fwfyPp3-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/bus/hisi_lpc.c: In function 'wait_lpc_idle':
>> drivers/bus/hisi_lpc.c:78:26: error: implicit declaration of function 'readl' [-Wimplicit-function-declaration]
78 | status = readl(mbase + LPC_REG_OP_STATUS);
| ^~~~~
drivers/bus/hisi_lpc.c: In function 'hisi_lpc_target_in':
>> drivers/bus/hisi_lpc.c:119:9: error: implicit declaration of function 'writel_relaxed' [-Wimplicit-function-declaration]
119 | writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
| ^~~~~~~~~~~~~~
>> drivers/bus/hisi_lpc.c:123:9: error: implicit declaration of function 'writel' [-Wimplicit-function-declaration]
123 | writel(LPC_REG_STARTUP_SIGNAL_START,
| ^~~~~~
>> drivers/bus/hisi_lpc.c:133:9: error: implicit declaration of function 'readsb' [-Wimplicit-function-declaration]
133 | readsb(lpcdev->membase + LPC_REG_RDATA, buf, opcnt);
| ^~~~~~
drivers/bus/hisi_lpc.c: In function 'hisi_lpc_target_out':
>> drivers/bus/hisi_lpc.c:176:9: error: implicit declaration of function 'writesb' [-Wimplicit-function-declaration]
176 | writesb(lpcdev->membase + LPC_REG_WDATA, buf, opcnt);
| ^~~~~~~
vim +/readl +78 drivers/bus/hisi_lpc.c
adf38bb0b5956ab Zhichang Yuan 2018-03-21 72
663accf1872b22c John Garry 2019-11-05 73 static int wait_lpc_idle(void __iomem *mbase, unsigned int waitcnt)
adf38bb0b5956ab Zhichang Yuan 2018-03-21 74 {
adf38bb0b5956ab Zhichang Yuan 2018-03-21 75 u32 status;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 76
adf38bb0b5956ab Zhichang Yuan 2018-03-21 77 do {
adf38bb0b5956ab Zhichang Yuan 2018-03-21 @78 status = readl(mbase + LPC_REG_OP_STATUS);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 79 if (status & LPC_REG_OP_STATUS_IDLE)
adf38bb0b5956ab Zhichang Yuan 2018-03-21 80 return (status & LPC_REG_OP_STATUS_FINISHED) ? 0 : -EIO;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 81 ndelay(LPC_NSEC_PERWAIT);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 82 } while (--waitcnt);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 83
5e3e70b8e1ae983 Andy Shevchenko 2022-09-05 84 return -ETIMEDOUT;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 85 }
adf38bb0b5956ab Zhichang Yuan 2018-03-21 86
adf38bb0b5956ab Zhichang Yuan 2018-03-21 87 /*
adf38bb0b5956ab Zhichang Yuan 2018-03-21 88 * hisi_lpc_target_in - trigger a series of LPC cycles for read operation
adf38bb0b5956ab Zhichang Yuan 2018-03-21 89 * @lpcdev: pointer to hisi lpc device
adf38bb0b5956ab Zhichang Yuan 2018-03-21 90 * @para: some parameters used to control the lpc I/O operations
adf38bb0b5956ab Zhichang Yuan 2018-03-21 91 * @addr: the lpc I/O target port address
adf38bb0b5956ab Zhichang Yuan 2018-03-21 92 * @buf: where the read back data is stored
adf38bb0b5956ab Zhichang Yuan 2018-03-21 93 * @opcnt: how many I/O operations required, i.e. data width
adf38bb0b5956ab Zhichang Yuan 2018-03-21 94 *
adf38bb0b5956ab Zhichang Yuan 2018-03-21 95 * Returns 0 on success, non-zero on fail.
adf38bb0b5956ab Zhichang Yuan 2018-03-21 96 */
adf38bb0b5956ab Zhichang Yuan 2018-03-21 97 static int hisi_lpc_target_in(struct hisi_lpc_dev *lpcdev,
adf38bb0b5956ab Zhichang Yuan 2018-03-21 98 struct lpc_cycle_para *para, unsigned long addr,
adf38bb0b5956ab Zhichang Yuan 2018-03-21 99 unsigned char *buf, unsigned long opcnt)
adf38bb0b5956ab Zhichang Yuan 2018-03-21 100 {
adf38bb0b5956ab Zhichang Yuan 2018-03-21 101 unsigned int cmd_word;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 102 unsigned int waitcnt;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 103 unsigned long flags;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 104 int ret;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 105
adf38bb0b5956ab Zhichang Yuan 2018-03-21 106 if (!buf || !opcnt || !para || !para->csize || !lpcdev)
adf38bb0b5956ab Zhichang Yuan 2018-03-21 107 return -EINVAL;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 108
adf38bb0b5956ab Zhichang Yuan 2018-03-21 109 cmd_word = 0; /* IO mode, Read */
adf38bb0b5956ab Zhichang Yuan 2018-03-21 110 waitcnt = LPC_PEROP_WAITCNT;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 111 if (!(para->opflags & FG_INCRADDR_LPC)) {
adf38bb0b5956ab Zhichang Yuan 2018-03-21 112 cmd_word |= LPC_REG_CMD_SAMEADDR;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 113 waitcnt = LPC_MAX_WAITCNT;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 114 }
adf38bb0b5956ab Zhichang Yuan 2018-03-21 115
adf38bb0b5956ab Zhichang Yuan 2018-03-21 116 /* whole operation must be atomic */
adf38bb0b5956ab Zhichang Yuan 2018-03-21 117 spin_lock_irqsave(&lpcdev->cycle_lock, flags);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 118
adf38bb0b5956ab Zhichang Yuan 2018-03-21 @119 writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 120 writel_relaxed(cmd_word, lpcdev->membase + LPC_REG_CMD);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 121 writel_relaxed(addr, lpcdev->membase + LPC_REG_ADDR);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 122
adf38bb0b5956ab Zhichang Yuan 2018-03-21 @123 writel(LPC_REG_STARTUP_SIGNAL_START,
adf38bb0b5956ab Zhichang Yuan 2018-03-21 124 lpcdev->membase + LPC_REG_STARTUP_SIGNAL);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 125
adf38bb0b5956ab Zhichang Yuan 2018-03-21 126 /* whether the operation is finished */
adf38bb0b5956ab Zhichang Yuan 2018-03-21 127 ret = wait_lpc_idle(lpcdev->membase, waitcnt);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 128 if (ret) {
adf38bb0b5956ab Zhichang Yuan 2018-03-21 129 spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 130 return ret;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 131 }
adf38bb0b5956ab Zhichang Yuan 2018-03-21 132
adf38bb0b5956ab Zhichang Yuan 2018-03-21 @133 readsb(lpcdev->membase + LPC_REG_RDATA, buf, opcnt);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 134
adf38bb0b5956ab Zhichang Yuan 2018-03-21 135 spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 136
adf38bb0b5956ab Zhichang Yuan 2018-03-21 137 return 0;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 138 }
adf38bb0b5956ab Zhichang Yuan 2018-03-21 139
adf38bb0b5956ab Zhichang Yuan 2018-03-21 140 /*
adf38bb0b5956ab Zhichang Yuan 2018-03-21 141 * hisi_lpc_target_out - trigger a series of LPC cycles for write operation
adf38bb0b5956ab Zhichang Yuan 2018-03-21 142 * @lpcdev: pointer to hisi lpc device
adf38bb0b5956ab Zhichang Yuan 2018-03-21 143 * @para: some parameters used to control the lpc I/O operations
adf38bb0b5956ab Zhichang Yuan 2018-03-21 144 * @addr: the lpc I/O target port address
adf38bb0b5956ab Zhichang Yuan 2018-03-21 145 * @buf: where the data to be written is stored
adf38bb0b5956ab Zhichang Yuan 2018-03-21 146 * @opcnt: how many I/O operations required, i.e. data width
adf38bb0b5956ab Zhichang Yuan 2018-03-21 147 *
adf38bb0b5956ab Zhichang Yuan 2018-03-21 148 * Returns 0 on success, non-zero on fail.
adf38bb0b5956ab Zhichang Yuan 2018-03-21 149 */
adf38bb0b5956ab Zhichang Yuan 2018-03-21 150 static int hisi_lpc_target_out(struct hisi_lpc_dev *lpcdev,
adf38bb0b5956ab Zhichang Yuan 2018-03-21 151 struct lpc_cycle_para *para, unsigned long addr,
adf38bb0b5956ab Zhichang Yuan 2018-03-21 152 const unsigned char *buf, unsigned long opcnt)
adf38bb0b5956ab Zhichang Yuan 2018-03-21 153 {
adf38bb0b5956ab Zhichang Yuan 2018-03-21 154 unsigned int waitcnt;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 155 unsigned long flags;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 156 u32 cmd_word;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 157 int ret;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 158
adf38bb0b5956ab Zhichang Yuan 2018-03-21 159 if (!buf || !opcnt || !para || !lpcdev)
adf38bb0b5956ab Zhichang Yuan 2018-03-21 160 return -EINVAL;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 161
adf38bb0b5956ab Zhichang Yuan 2018-03-21 162 /* default is increasing address */
adf38bb0b5956ab Zhichang Yuan 2018-03-21 163 cmd_word = LPC_REG_CMD_OP; /* IO mode, write */
adf38bb0b5956ab Zhichang Yuan 2018-03-21 164 waitcnt = LPC_PEROP_WAITCNT;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 165 if (!(para->opflags & FG_INCRADDR_LPC)) {
adf38bb0b5956ab Zhichang Yuan 2018-03-21 166 cmd_word |= LPC_REG_CMD_SAMEADDR;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 167 waitcnt = LPC_MAX_WAITCNT;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 168 }
adf38bb0b5956ab Zhichang Yuan 2018-03-21 169
adf38bb0b5956ab Zhichang Yuan 2018-03-21 170 spin_lock_irqsave(&lpcdev->cycle_lock, flags);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 171
adf38bb0b5956ab Zhichang Yuan 2018-03-21 172 writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 173 writel_relaxed(cmd_word, lpcdev->membase + LPC_REG_CMD);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 174 writel_relaxed(addr, lpcdev->membase + LPC_REG_ADDR);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 175
adf38bb0b5956ab Zhichang Yuan 2018-03-21 @176 writesb(lpcdev->membase + LPC_REG_WDATA, buf, opcnt);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 177
adf38bb0b5956ab Zhichang Yuan 2018-03-21 178 writel(LPC_REG_STARTUP_SIGNAL_START,
adf38bb0b5956ab Zhichang Yuan 2018-03-21 179 lpcdev->membase + LPC_REG_STARTUP_SIGNAL);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 180
adf38bb0b5956ab Zhichang Yuan 2018-03-21 181 /* whether the operation is finished */
adf38bb0b5956ab Zhichang Yuan 2018-03-21 182 ret = wait_lpc_idle(lpcdev->membase, waitcnt);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 183
adf38bb0b5956ab Zhichang Yuan 2018-03-21 184 spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956ab Zhichang Yuan 2018-03-21 185
adf38bb0b5956ab Zhichang Yuan 2018-03-21 186 return ret;
adf38bb0b5956ab Zhichang Yuan 2018-03-21 187 }
adf38bb0b5956ab Zhichang Yuan 2018-03-21 188
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c
2025-04-21 2:06 ` Pei Xiao
@ 2025-04-22 7:58 ` Andy Shevchenko
2025-04-22 11:35 ` Pei Xiao
0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2025-04-22 7:58 UTC (permalink / raw)
To: Pei Xiao; +Cc: linux-kernel, f.fangjian, robh, john.g.garry, xuwei5, Pei Xiao
On Mon, Apr 21, 2025 at 10:06:28AM +0800, Pei Xiao wrote:
> 在 2025/4/19 23:22, Andy Shevchenko 写道:
> > On Fri, Apr 18, 2025 at 04:51:23PM +0800, xiaopeitux@foxmail.com wrote:
...
> >> linux/console.h,linux/io.h,linux/pci.h,linux/slab.h
> >> are not used, this patch removes it.
> > Definitely you haven't tested this...
>
> Sorry for that,I have tested in ARM64 platform, have no build problem,sorry for that!
Okay, but you need to follow IWYU principle. io.h is definitely used in this
file.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c
2025-04-22 7:58 ` Andy Shevchenko
@ 2025-04-22 11:35 ` Pei Xiao
0 siblings, 0 replies; 9+ messages in thread
From: Pei Xiao @ 2025-04-22 11:35 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-kernel, f.fangjian, robh, john.g.garry, xuwei5, Pei Xiao
在 2025/4/22 15:58, Andy Shevchenko 写道:
> On Mon, Apr 21, 2025 at 10:06:28AM +0800, Pei Xiao wrote:
>> 在 2025/4/19 23:22, Andy Shevchenko 写道:
>>> On Fri, Apr 18, 2025 at 04:51:23PM +0800, xiaopeitux@foxmail.com wrote:
> ...
>
>>>> linux/console.h,linux/io.h,linux/pci.h,linux/slab.h
>>>> are not used, this patch removes it.
>>> Definitely you haven't tested this...
>> Sorry for that,I have tested in ARM64 platform, have no build problem,sorry for that!
> Okay, but you need to follow IWYU principle. io.h is definitely used in this
> file.
I send v2 patch in:
https://lore.kernel.org/lkml/tencent_AB44A8723B522941A2792D9C58CDD9B8B60A@qq.com/
but I don't that comment patch whether have problem.
thanks !
Pei.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-04-22 11:41 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1744964101.git.xiaopei01@kylinos.cn>
2025-04-18 8:51 ` [PATCH 1/2] bus: hisi_lpc: remove unused head file in hisi_lpc.c xiaopeitux
2025-04-19 8:01 ` kernel test robot
2025-04-19 15:22 ` Andy Shevchenko
2025-04-21 2:06 ` Pei Xiao
2025-04-22 7:58 ` Andy Shevchenko
2025-04-22 11:35 ` Pei Xiao
2025-04-21 11:34 ` kernel test robot
2025-04-18 8:51 ` [PATCH 2/2] logic_pio: Add detailed comments for find_io_range() and logic_pio_trans_cpuaddr() xiaopeitux
2025-04-19 15:21 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox