diff mbox series

Fix randconfig build error and code bug

Message ID 20201105114326.353021-1-yaoaili126@163.com (mailing list archive)
State Changes Requested, archived
Headers show
Series Fix randconfig build error and code bug | expand

Commit Message

yaoaili126@163.com Nov. 5, 2020, 11:43 a.m. UTC
From: Aili Yao <yaoaili@kingsoft.com>

CONFIG_ACPI_APEI is not sufficient for ghes module global function
replace it with CONFIG_ACPI_APEI_GHES.

When gen_pool_alloc fails in ghes_in_mce_cper_entry_check, we still need
to try other cper table to get it cleaned even we are likely to get another
allocation fail.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Aili Yao <yaoaili@kingsoft.com>
---
 arch/x86/kernel/cpu/mce/internal.h | 6 +++++-
 drivers/acpi/apei/ghes.c           | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)


base-commit: b11831c841cb8046a9e01300f5d91985c293e045

Comments

James Morse Nov. 6, 2020, 7:34 p.m. UTC | #1
Hello,

On 05/11/2020 11:43, yaoaili126@163.com wrote:
> From: Aili Yao <yaoaili@kingsoft.com>
> 
> CONFIG_ACPI_APEI is not sufficient for ghes module global function
> replace it with CONFIG_ACPI_APEI_GHES.
> 
> When gen_pool_alloc fails in ghes_in_mce_cper_entry_check, we still need
> to try other cper table to get it cleaned even we are likely to get another
> allocation fail.

This applies on top of your previous patches. It doesn't make sense in isolation.

When this happens its normal to post a 'v2' of your patch with the issue fixed.
If you only just posted the first version, then it is best to wait a little to give
reviewers a chance (multiple versions posted on the same day is too much). In this case
its good to reply to the build-robots' message saying how you've fixed it locally...


I think we need to find out whether your firmware supports GHES_ASSIST before we make
changes here...


Thanks,

James
kernel test robot Nov. 10, 2020, 8:34 p.m. UTC | #2
Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on b11831c841cb8046a9e01300f5d91985c293e045]

url:    https://github.com/0day-ci/linux/commits/yaoaili126-163-com/Fix-randconfig-build-error-and-code-bug/20201105-222108
base:    b11831c841cb8046a9e01300f5d91985c293e045
config: x86_64-randconfig-a015-20201110 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4d81c8adb6ed9840257f6cb6b93f60856d422a15)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/d1203fe379a2190e7ff5d40a30465bea2c98a47f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review yaoaili126-163-com/Fix-randconfig-build-error-and-code-bug/20201105-222108
        git checkout d1203fe379a2190e7ff5d40a30465bea2c98a47f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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 >>):

   In file included from arch/x86/kernel/cpu/mce/apei.c:27:
>> arch/x86/kernel/cpu/mce/internal.h:95:19: error: static declaration of 'ghes_in_mce_cper_entry_check' follows non-static declaration
   static inline int ghes_in_mce_cper_entry_check(void)
                     ^
   include/acpi/ghes.h:130:5: note: previous declaration is here
   int ghes_in_mce_cper_entry_check(void);
       ^
   1 error generated.

vim +/ghes_in_mce_cper_entry_check +95 arch/x86/kernel/cpu/mce/internal.h

d1203fe379a2190 arch/x86/kernel/cpu/mce/internal.h        Aili Yao        2020-11-05   91  
d1203fe379a2190 arch/x86/kernel/cpu/mce/internal.h        Aili Yao        2020-11-05   92  #ifdef CONFIG_ACPI_APEI_GHES
d1203fe379a2190 arch/x86/kernel/cpu/mce/internal.h        Aili Yao        2020-11-05   93  extern int ghes_in_mce_cper_entry_check(void);
d1203fe379a2190 arch/x86/kernel/cpu/mce/internal.h        Aili Yao        2020-11-05   94  #else
b11831c841cb804 arch/x86/kernel/cpu/mce/internal.h        Aili Yao        2020-11-03  @95  static inline int ghes_in_mce_cper_entry_check(void)
b11831c841cb804 arch/x86/kernel/cpu/mce/internal.h        Aili Yao        2020-11-03   96  {
b11831c841cb804 arch/x86/kernel/cpu/mce/internal.h        Aili Yao        2020-11-03   97  	return 0;
b11831c841cb804 arch/x86/kernel/cpu/mce/internal.h        Aili Yao        2020-11-03   98  }
482908b49ebfa45 arch/x86/kernel/cpu/mcheck/mce-internal.h Huang Ying      2010-05-18   99  #endif
a79da38494ec23f arch/x86/kernel/cpu/mcheck/mce-internal.h Borislav Petkov 2015-08-12  100  

---
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/x86/kernel/cpu/mce/internal.h b/arch/x86/kernel/cpu/mce/internal.h
index 1c79b32fcaa9..1fdf8ac45372 100644
--- a/arch/x86/kernel/cpu/mce/internal.h
+++ b/arch/x86/kernel/cpu/mce/internal.h
@@ -70,7 +70,6 @@  int apei_write_mce(struct mce *m);
 ssize_t apei_read_mce(struct mce *m, u64 *record_id);
 int apei_check_mce(void);
 int apei_clear_mce(u64 record_id);
-extern int ghes_in_mce_cper_entry_check(void);
 #else
 static inline int apei_write_mce(struct mce *m)
 {
@@ -88,6 +87,11 @@  static inline int apei_clear_mce(u64 record_id)
 {
 	return -EINVAL;
 }
+#endif
+
+#ifdef CONFIG_ACPI_APEI_GHES
+extern int ghes_in_mce_cper_entry_check(void);
+#else
 static inline int ghes_in_mce_cper_entry_check(void)
 {
 	return 0;
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index ba3140d74f75..8baa19c6b625 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -1131,7 +1131,7 @@  int ghes_in_mce_cper_entry_check(void)
 			/* Going to panic, No need to keep the error. */
 			ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
 			ret = -ENOMEM;
-			goto done;
+			continue;
 		}
 
 		estatus_node->ghes = ghes;
@@ -1157,7 +1157,7 @@  int ghes_in_mce_cper_entry_check(void)
 		gen_pool_free(ghes_estatus_pool, (unsigned long)estatus_node,
 		      node_len);
 	}
-done:
+
 	rcu_read_unlock();
 	atomic_dec(&ghes_in_nmi);
 	return ret;