diff mbox series

[v4,5/8] powerpc/pmem/of_pmem: Update of_pmem to use the new barrier instruction.

Message ID 20200529052820.151651-6-aneesh.kumar@linux.ibm.com (mailing list archive)
State Superseded
Headers show
Series Support new pmem flush and sync instructions for POWER | expand

Commit Message

Aneesh Kumar K.V May 29, 2020, 5:28 a.m. UTC
of_pmem on POWER10 can now use phwsync instead of hwsync to ensure
all previous writes are architecturally visible for the platform
buffer flush.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 arch/powerpc/include/asm/cacheflush.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

kernel test robot May 31, 2020, 2:46 p.m. UTC | #1
Hi "Aneesh,

I love your patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on linux-nvdimm/libnvdimm-for-next scottwood/next v5.7-rc7]
[cannot apply to next-20200529]
[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/Aneesh-Kumar-K-V/Support-new-pmem-flush-and-sync-instructions-for-POWER/20200531-062841
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-ppc6xx_defconfig (attached as .config)
compiler: powerpc-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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

In file included from arch/powerpc/include/asm/asm-prototypes.h:12,
from arch/powerpc/kernel/early_32.c:11:
arch/powerpc/include/asm/cacheflush.h: In function 'arch_pmem_flush_barrier':
arch/powerpc/include/asm/cacheflush.h:126:6: error: implicit declaration of function 'cpu_has_feature'; did you mean 'mmu_has_feature'? [-Werror=implicit-function-declaration]
126 |  if (cpu_has_feature(CPU_FTR_ARCH_207S))
|      ^~~~~~~~~~~~~~~
|      mmu_has_feature
In file included from arch/powerpc/include/asm/cputhreads.h:7,
from arch/powerpc/include/asm/mmu_context.h:12,
from arch/powerpc/include/asm/asm-prototypes.h:17,
from arch/powerpc/kernel/early_32.c:11:
arch/powerpc/include/asm/cpu_has_feature.h: At top level:
>> arch/powerpc/include/asm/cpu_has_feature.h:49:20: error: conflicting types for 'cpu_has_feature'
49 | static inline bool cpu_has_feature(unsigned long feature)
|                    ^~~~~~~~~~~~~~~
In file included from arch/powerpc/include/asm/asm-prototypes.h:12,
from arch/powerpc/kernel/early_32.c:11:
arch/powerpc/include/asm/cacheflush.h:126:6: note: previous implicit declaration of 'cpu_has_feature' was here
126 |  if (cpu_has_feature(CPU_FTR_ARCH_207S))
|      ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

vim +/cpu_has_feature +49 arch/powerpc/include/asm/cpu_has_feature.h

c812c7d8f1470a Aneesh Kumar K.V 2016-07-23  38  
4db7327194dba0 Kevin Hao        2016-07-23  39  	if (CPU_FTRS_ALWAYS & feature)
4db7327194dba0 Kevin Hao        2016-07-23  40  		return true;
4db7327194dba0 Kevin Hao        2016-07-23  41  
4db7327194dba0 Kevin Hao        2016-07-23  42  	if (!(CPU_FTRS_POSSIBLE & feature))
4db7327194dba0 Kevin Hao        2016-07-23  43  		return false;
4db7327194dba0 Kevin Hao        2016-07-23  44  
4db7327194dba0 Kevin Hao        2016-07-23  45  	i = __builtin_ctzl(feature);
4db7327194dba0 Kevin Hao        2016-07-23  46  	return static_branch_likely(&cpu_feature_keys[i]);
4db7327194dba0 Kevin Hao        2016-07-23  47  }
4db7327194dba0 Kevin Hao        2016-07-23  48  #else
b92a226e528423 Kevin Hao        2016-07-23 @49  static inline bool cpu_has_feature(unsigned long feature)
b92a226e528423 Kevin Hao        2016-07-23  50  {
b92a226e528423 Kevin Hao        2016-07-23  51  	return early_cpu_has_feature(feature);
b92a226e528423 Kevin Hao        2016-07-23  52  }
4db7327194dba0 Kevin Hao        2016-07-23  53  #endif
b92a226e528423 Kevin Hao        2016-07-23  54  

:::::: The code at line 49 was first introduced by commit
:::::: b92a226e528423b8d249dd09bb450d53361fbfcb powerpc: Move cpu_has_feature() to a separate file

:::::: TO: Kevin Hao <haokexin@gmail.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/arch/powerpc/include/asm/cacheflush.h b/arch/powerpc/include/asm/cacheflush.h
index e92191b390f3..bc3ea009cf14 100644
--- a/arch/powerpc/include/asm/cacheflush.h
+++ b/arch/powerpc/include/asm/cacheflush.h
@@ -119,6 +119,13 @@  static inline void invalidate_dcache_range(unsigned long start,
 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
 	memcpy(dst, src, len)
 
+
+#define arch_pmem_flush_barrier arch_pmem_flush_barrier
+static inline void  arch_pmem_flush_barrier(void)
+{
+	if (cpu_has_feature(CPU_FTR_ARCH_207S))
+		asm volatile(PPC_PHWSYNC ::: "memory");
+}
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_POWERPC_CACHEFLUSH_H */