From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796032176; b=RKbncZwxs+uVKq81cIwGDiLs+Bdigl63lPwUR5ZJM+zq9ViCieupeE92Pl1BMDimXqPd VBiZH6SZJJJ7YFEz3W3eRnMJ6kEk/OGB7YTTuC1uB7Wvnf+96Wa8YhD7n9CaZn20hreWy VoraLOk0qCe6aXGUv8JK+ggFDB+5PR7KUCm21i8MoJlaebtHjniQGyA2gt3Sus5Wbk6Yq Kc6cOLIurrMOZAaNPVKTwV+KknfoP6u4Hb093bF8o6jDQB/WLjTosw7FPlK42DvSRxOyQ TSr2Rmi2nNCSDZ6AD+WTUjAWszUiLsr0vm+6Ns6R0Uexa5AJh7nnERHw3X4yXDsPZ/A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796032176; h=DMARC-Filter:From:DKIM-Signature:DKIM-Signature:To:Cc:Subject: In-Reply-To:References:Date:Message-ID:MIME-Version:Content-Type; bh=ho1uN8vp3lM8jNBMEgmqd6hM9P7jPXM2CyTGKriEmuU=; b=IrcSTbTatMgXuzU+sOUbC1yJKA4DeZn1GI2LkVE9+i1A1LNo2KRSSKwlbEucGGA2BmI0 nHD0yUVKkcmKxeBjRLTjO8yqe9L7KqOaO/qElQQBz3WOwcDSJep5MB/eM17jtil2Vd87J j/CYGZl3eHygC6HOyGHgXM+7F0hq53annsHKs+rbDB/ZCN6fCc/rCuJ6c2egH5Yq86bT9 xdMOV3UQU5jFMPxGQ6xpvLzABdjQKKCJz9hhuE6yhsikVrLYwHJW8xDpbyvgNdSBL859e WV80ci666JGTGSr7wHD3R7N+oNnjtpSa3Wo5Q+KQ3ADWK2m7/lfH3K0dd1fwhb51aBQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=uwB2xHAd; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=qnBINZPv; arc=none smtp.remote-ip=193.142.43.55 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5728D606A687 for ; Mon, 30 Nov 2026 09:49:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5728D606A687 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=uwB2xHAd; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=qnBINZPv From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1796032174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ho1uN8vp3lM8jNBMEgmqd6hM9P7jPXM2CyTGKriEmuU=; b=uwB2xHAduA7h6S9HQ+mKnhYce1Kav4CkY1rE2Xde9HhWq62QsgXa71tzvAyg7/3SOU6/JZ zEkY1ohUx+5L/y9ul8V07OOWXZtmylgJ/ohQHQD4lYhu1odRK/R3hddEDmP0CTzr+iBSJ5 OkFLtUJ6abrEmbR3WaapEFCjI+QqTzCCLMzgObCNnbnZoj+iiQB+UUUzGNB76vUWjLwA+b GaF6czCpUXyPnTncE7obzTvXXDo4q0dnZuQL2UAqOwQYINVaFf8fy6WzX6HBgpkNuTo2II MspIaL4fNejdgfULDULxc3sWGqcYymjZu0ITIpGbObKq1Rbloh9SJ737pkHTfw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1796032174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ho1uN8vp3lM8jNBMEgmqd6hM9P7jPXM2CyTGKriEmuU=; b=qnBINZPvo0sKaaeTU3c4P6oAkvy+WaRmWf044eeOKbDM71NzU7dajrtOZ1lzPkqG6tPc3m uMItmUcoMySb0jAQ== To: Chaoyong Zhou , maz@kernel.org, linux-arm-kernel@lists.infradead.org Cc: stable@vger.kernel.org Subject: Re: [PATCH RESEND v2] irqdomain: Restore block-wise Multi-MSI free semantics In-Reply-To: References: <8cb676da416dc4dd3cdf4c6ee1a87db887e70886.adc02e38.fb00.4c86.a424.c9153ba82907@feishu.cn> Date: Mon, 30 Nov 2026 10:49:33 +0100 Message-ID: <87mrqqr6mq.ffs@fw13> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain On Fri, Nov 27 2026 at 15:59, Chaoyong Zhou wrote: > From: Chaoyong Zhou > > Please note: this is a resend from my personal mailbox > (zhoucyfx@foxmail.com). The initial copy on 2026-11-25 was sent from my > work address (zhouchaoyong@ruijie.com.cn) and reached you both, but our > corporate mail gateway mangles outgoing mail into multipart/alternative > (HTML), which the infradead list rejects with "550 Mailing lists do not > accept HTML mail", so the list copies bounced twice. Sending via git > send-email over this mailbox keeps the mail text/plain only. How is that relevant for the change log? Put such information under the "---" cutoff if at all. Nobody cares how about your email problems. > Restore the pre-existing block-wise free semantics: when the whole > range is consistently mapped, hand it down to the domains as a single > block, exactly mirroring the allocation. Keep the per-interrupt > fallback for inconsistent ranges, preserving the protection introduced > by commit 4615fbc3788d ("genirq/irqdomain: Don't try to free an interrupt > that has no mapping") for unwinding partially allocated ranges. > > Fixes: 4615fbc3788d ("genirq/irqdomain: Don't try to free an interrupt that has no mapping") > The interrupts of a Multi-MSI descriptor are allocated from the MSI > controllers as a single aligned block: the ITS (GICv3 and GICv5) and > the Armada 370/XP drivers, amongst others, round the vector count up > to a power of two and carve the region out of their per-device event > bitmap with bitmap_find_free_region(). > > Commit 4615fbc3788d ("genirq/irqdomain: Don't try to free an > interrupt that has no mapping") changed irq_domain_free_irqs_hierarchy() > to free the interrupts of a range one at a time, to protect against > error paths trying to free interrupts that were never allocated. > > That changed the contract with the underlying domains: a Multi-MSI > block is now released one interrupt at a time with nr_irqs == 1, > which cannot unwind the aligned region the allocation created. The > unused tail of the block is never released, leaving stale bits in the > event bitmap. As a result the MSI device is never fully reclaimed > (its_irq_domain_free() only mops up the device once its bitmap is > empty), and re-probing the device fails to allocate the same number > of vectors, silently degrading to a single MSI. > > This has been reported for GICv3 ITS: > > https://lore.kernel.org/all/20240708153933.GC5745@thinkpad/ > Can you try: https://lore.kernel.org/87fqxbwla2.ffs@fw13 That should solve your problem along with some others which have been reported. Thanks, tglx