From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750920AbdKFASO (ORCPT ); Sun, 5 Nov 2017 19:18:14 -0500 Received: from ozlabs.org ([103.22.144.67]:57603 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbdKFASN (ORCPT ); Sun, 5 Nov 2017 19:18:13 -0500 From: Michael Ellerman To: Andrew Morton Cc: Andi Kleen , linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH] Support resetting WARN_ONCE for all architectures In-Reply-To: <20171103104755.0fa2dba59f48df43d5bffb25@linux-foundation.org> References: <20171019204642.7404-1-andi@firstfloor.org> <878tfn7ldw.fsf@concordia.ellerman.id.au> <20171103104755.0fa2dba59f48df43d5bffb25@linux-foundation.org> Date: Mon, 06 Nov 2017 11:18:09 +1100 Message-ID: <87shdsb6pq.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrew Morton writes: > On Fri, 03 Nov 2017 20:38:03 +1100 Michael Ellerman wrote: >> Andi Kleen writes: >> > diff --git a/lib/bug.c b/lib/bug.c >> > index a6a1137d06db..7cb2d41845f7 100644 >> > --- a/lib/bug.c >> > +++ b/lib/bug.c >> > @@ -195,3 +195,24 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) >> > >> > return BUG_TRAP_TYPE_BUG; >> > } >> > + >> > +static void clear_once_table(struct bug_entry *start, struct bug_entry *end) >> > +{ >> > + struct bug_entry *bug; >> > + >> > + for (bug = start; bug < end; bug++) >> > + bug->flags &= ~BUGFLAG_ONCE; >> >> Clearing BUGFLAG_ONCE removes the once-ness permanently. ie. it becomes >> a WARN(). >> >> You should be clearing BUGFLAG_DONE, which is the flag that says this >> WARN has already triggered. > > This? Yes. > --- a/lib/bug.c~support-resetting-warn_once-for-all-architectures-v2-fix-fix-fix > +++ a/lib/bug.c > @@ -202,7 +202,7 @@ static void clear_once_table(struct bug_ > struct bug_entry *bug; > > for (bug = start; bug < end; bug++) > - bug->flags &= ~BUGFLAG_ONCE; > + bug->flags &= ~BUGFLAG_DONE; > } > > void generic_bug_clear_once(void) > > > And this is getting a bit nutty: > > support-resetting-warn_once.patch > support-resetting-warn_once-checkpatch-fixes.patch > support-resetting-warn_once-for-all-architectures.patch > support-resetting-warn_once-for-all-architectures-v2.patch > support-resetting-warn_once-for-all-architectures-v2-fix.patch > support-resetting-warn_once-for-all-architectures-v2-fix-fix.patch > support-resetting-warn_once-for-all-architectures-v2-fix-fix-fix.patch Quite. They should probably all just be squashed together. > I'll push all this at Stephen later today. Someone please tell me > whether this code actually works! I've tested Andi's two patches with the above one-liner and that worked for me. I'll test again on linux-next once it's in there to confirm. cheers