From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA9792EEE84 for ; Sun, 23 Aug 2026 21:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787519323; cv=none; b=tKeQ1plZkO8I2/BgtanHBVjkkgjpyynGw1PE6gZXKeRH57kqOtM3tAJPQOmBfw9EimshpVXUviSg91D/ZfMHNjnSqOWYwaIKw1qqIcBLPRLeQKf24oKyX7ehUlg7Q6EwVo5vFFapnLVracUWYjdqKjqUjoO02qk38aoG6wn2dV8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787519323; c=relaxed/simple; bh=UkLaYR6Wl8UjvT+BoWMbeZihae9UoD68PpYpKqWdph8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g+gZDXj/vk2O9ApWUYD8IfECXp+3wWm5Mx5U8jvNDU5mzkHESwU6HOpAgrWQb8+ePkPi6scxccENYoa0JBuf8YxIdk/up2G4V43QQfEPNxZmtQgwXejVHdtqRDAxbPBIple5tZ8RtfEWsnhOuN43Udcv77rygmmPBVN8x9cpYE8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LltBWq5b; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LltBWq5b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FC4B1F00A3D; Sun, 23 Aug 2026 21:08:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787519322; bh=54WvJ21JoVGRCdXLECnx4CWKDSN3e8vJh/XTmWJfc+0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=LltBWq5bU4ujwdqNOS6L89Pmc4H4wr3K1XI1a3AQE8ftdgEFuMLmhHZP5+QI6JB+K N5J43h1lawqOGPo6RZkt/UvpvSIdcSU25FcUAu9LRymDSM6MkuH0KuJCWqeDDXsT0r w1WaLuzivzIHMZYRoIOVPtc3R4D34asggySDslmAAn3ER/dmHQJkSSNUoVebSLYx2+ bfNMGSEx6xjDBBbjL6Uz2i5fHNQKO3Qxlg+OFX1FxNztM4RkDf7EOqNUaHRluIaefK kQNTnF/bYBIXvOoWxHysh5tqO41kBsCxXKSTwc2ECu0YEk4w/fwW7L5uieKpFIhzh9 AH6i2AOuyH4KA== Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfauth.phl.internal (Postfix) with ESMTP id 84546F40066; Sun, 23 Aug 2026 17:08:41 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Sun, 23 Aug 2026 17:08:41 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFWgoWe2yw9q/Nk9gKy5CNiTNFKJw+pqEnV46M9L254wyFrGItzkaMvvfjy6obnE8 T0ug6Kr/iRepWyOen1gy4yv6WE/PmpNYtxyWQItuRZ/N/OoJNBoAL8xsVdiiP4F1mYOsgs 2w10lkju+MD6sDiEYxmmb6HCdLqRMnPtPd7B0+xJWSuwsa/HsRRwvSvi44FsuanNqt21Qz Hky+mhdQmCNXY40i3/8g5PTM66U8wWZtS6Urqm13dWCkGghutOWJ/+AjxKzllpOP8N65Sd tD4ZbxC7tKfZZYfWYjjbOhvGY41XGnrS7YBFo+jFppafjef8Hmi/aOAKGGhnZeJlJ5SSou keePBot/y7uEK5qX0aIX1Cxx+c68smkxvfTafQqDflR1XgFoYup31cHMzTqfD8aA9d2RZY tWrhIpv0OlMJaXMi+F7/4dzJXwWcSLDLtz4vANPQYKSg1SSwDxQgW4d9NDksFnERtwj55w RcdggaOUaO1WAwtZfTdF4aggYdH2cYDD2XSUZJnY4RjB+F2iRIsD0xx2c8Aq4w0yxaZ6hu Aq5u02yhLKpEEQMfLbSXr+OEYXEygpyd3hMSpVP9PwTAFPfNMnFPq8CDxtzUQZ75r5gOpL sxgAAFmw6XNjHvbE6DhUXUCKqQq/rHe9uxeGR6OedmgcCdX+gcD2AWefFBWg X-ME-Proxy: Feedback-ID: i8dbe485b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Aug 2026 17:08:41 -0400 (EDT) Date: Sun, 23 Aug 2026 14:08:39 -0700 From: Boqun Feng To: Radu Rendec Cc: Kuan-Wei Chiu , tglx@kernel.org, peterz@infradead.org, lyude@redhat.com, jserv@ccns.ncku.edu.tw, marscheng@google.com, eleanor15x@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] irq: Make refcount_interrupt kunit test selectable Message-ID: References: <20260823171721.3059733-1-visitorckw@gmail.com> <014ccedef7256efc027b8759134b9d1712d3afb6.camel@rendec.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <014ccedef7256efc027b8759134b9d1712d3afb6.camel@rendec.net> On Sun, Aug 23, 2026 at 04:46:23PM -0400, Radu Rendec wrote: > On Sun, 2026-08-23 at 17:17 +0000, Kuan-Wei Chiu wrote: > > Currently, refcount_interrupt_test is built unconditionally when > > CONFIG_KUNIT is enabled, causing it to run unexpectedly during boot. > > > > Fix this by introducing CONFIG_REFCOUNT_INTERRUPT_KUNIT_TEST so the > > test can be configured independently, following standard kunit > > practices. > > > > Fixes: 07a88e2bcd5b ("irq: Add KUnit test for refcounted interrupt enable/disable") > > Signed-off-by: Kuan-Wei Chiu > > --- > >  kernel/irq/Kconfig  | 12 ++++++++++++ > >  kernel/irq/Makefile |  2 +- > >  2 files changed, 13 insertions(+), 1 deletion(-) > > Can someone please explain me why this needs to be a separate unit test > in the first place and can't be integrated into the (previously) > existing unit test gated by IRQ_KUNIT_TEST? > If you look at the irq_test.c, you will find that it primarily tests the {request,disable,enable}_irq() API (i.e. allocating IRQ vectors and enabling and disabling them), which is not the same scope as local_interrupt_{disable,enable}() (i.e. operating the CPU irq disabling status), so it makes sense to have a separate test case. But yes, I agree Kuan-Wei's fix is needed. Regards, Boqun > Ironically, both the issue that this patch is trying to fix and my > question were raised by sashiko here: > https://lore.kernel.org/all/20260605055315.3E96E1F00893@smtp.kernel.org/ > > > diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig > > index 05cba4e16dad..6923f37eaab4 100644 > > --- a/kernel/irq/Kconfig > > +++ b/kernel/irq/Kconfig > > @@ -150,6 +150,18 @@ config IRQ_KUNIT_TEST > >   > >     If unsure, say N. > >   > > +config REFCOUNT_INTERRUPT_KUNIT_TEST > > + tristate "Test refcounted interrupt enable/disable" if !KUNIT_ALL_TESTS > > + depends on KUNIT > > + default KUNIT_ALL_TESTS > > + help > > +   This builds the kunit tests for the refcounted interrupt > > +   infrastructure. It verifies the correctness of single, nested, > > +   and multiple interrupt enable/disable state changes and ensures > > +   that the underlying reference counting mechanisms work as expected. > > + > > +   If unsure, say N. > > + > >  endmenu > >   > >  config GENERIC_IRQ_MULTI_HANDLER > > diff --git a/kernel/irq/Makefile b/kernel/irq/Makefile > > index 44c4d6fc502a..0e5df962a149 100644 > > --- a/kernel/irq/Makefile > > +++ b/kernel/irq/Makefile > > @@ -16,4 +16,4 @@ obj-$(CONFIG_SMP) += affinity.o > >  obj-$(CONFIG_GENERIC_IRQ_DEBUGFS) += debugfs.o > >  obj-$(CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR) += matrix.o > >  obj-$(CONFIG_IRQ_KUNIT_TEST) += irq_test.o > > -obj-$(CONFIG_KUNIT) += refcount_interrupt_test.o > > +obj-$(CONFIG_REFCOUNT_INTERRUPT_KUNIT_TEST) += refcount_interrupt_test.o