Re: [PATCH v6] x86/hpet: Reduce HPET counter read contention

From: Waiman Long
Date: Mon Aug 15 2016 - 22:08:32 EST


On 08/12/2016 10:30 PM, kbuild test robot wrote:
Hi Waiman,

[auto build test ERROR on tip/auto-latest]
[also build test ERROR on v4.8-rc1 next-20160812]
[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/Waiman-Long/x86-hpet-Reduce-HPET-counter-read-contention/20160813-090247
config: x86_64-randconfig-s0-08131002 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

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

arch/x86/kernel/hpet.c:791: error: unknown field 'lock' specified in initializer
arch/x86/kernel/hpet.c:791: warning: missing braces around initializer
arch/x86/kernel/hpet.c:791: warning: (near initialization for 'hpet.<anonymous>.lock.val')

vim +/lock +791 arch/x86/kernel/hpet.c

785 u32 value;
786 };
787 u64 lockval;
788 };
789
790 static union hpet_lock hpet __cacheline_aligned = {
> 791 .lock = __ARCH_SPIN_LOCK_UNLOCKED,
792 };
793
794 static cycle_t read_hpet(struct clocksource *cs)

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

The following additional patch should fix the build error. The error wasn't produced when I did my test build with the gcc 4.8.5 compiler. That was why I missed it.

Cheers,
Longman

----------------------------------

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 71127fe..0822688 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -788,7 +788,7 @@ union hpet_lock {
};

static union hpet_lock hpet __cacheline_aligned = {
- .lock = __ARCH_SPIN_LOCK_UNLOCKED,
+ { .lock = __ARCH_SPIN_LOCK_UNLOCKED, },
};

static cycle_t read_hpet(struct clocksource *cs)