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=1796156143; b=RNHdyGB9okAjoJuS1C5indu8/wotl4uQ60RuW/SKJFQNw4iWLeG/qApEOjpdnE5Shm38 abNO50yoSSIRXY5UfLilxe/5kTF9/WlcJi8WqU+YiJ7MRyZOVDmf4za5Mo2PFLvM1B783 JI+Vd7mhwb0uVctuCoNQvWa9nWOmfB9xAxX1qvfJMhWUXOUfVfoRYQEVIfszO0PBhxh8a xw1vQPMpPUOcoJjVtRNUtpXhlAPcgB34/GsAdPz0bO4XrTciY7eNZUAlLfQ7R1YyLNeHW fBzjMD26wdBoz6m7sxXnVitTfY7G1E9JyzziqLaWP3/C/20XLm8/TqGW9ASB2c/TiOg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796156143; h=DMARC-Filter:Date:DKIM-Signature:DKIM-Signature:From:Sender:Reply-to: To:Subject:Cc:In-Reply-To:References:MIME-Version:Message-ID:Robot-ID: Robot-Unsubscribe:Precedence:Content-Type:Content-Transfer-Encoding; bh=oAW6FWXLeN0lQcasVyvuIOaeRUq3DaGWhKPRN9WG5XY=; b=uXtx6VuaZeNcISbjhBbnnQwNQFJaKlg3SYDTxnoVMZ6ZSUSLeZHxuPyHcUopp4SnfjVx j+yd6wTEOIYD0jH+8mC62f+00atc7Q0+rBK6qW8VntfckPVKDw46yVLh6AyT5RHB0Ot/N SAXqTZbnyCkRGVz2PzhNW4scMNqElnsG2XzOQYW9bNzxJKcfROcMeK9xXqWecelsD9Q4X pgqtX+oeixpalXZt/v7lE6YcZIfRue6NcUOFfQw88+7IBs8visKpsaBfY2R4n8H2qcvIN J6/6ElgQpxepYXbkZJl/IMxVeN8ndMmSN6l5CLefyLCgTvB68Fd7SerbqP4ILuUWiJA== 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=NX2tO78Q; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=7hhPWlTf; 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 9FD55606A68A; Tue, 1 Dec 2026 20:15:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9FD55606A68A 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=NX2tO78Q; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=7hhPWlTf Date: Tue, 01 Dec 2026 20:15:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1796156141; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oAW6FWXLeN0lQcasVyvuIOaeRUq3DaGWhKPRN9WG5XY=; b=NX2tO78QG9yuZIirPMhH6jnb1QHEkCXyfv+8jXDXmGATGq3c5vvHDsNzKS5gEgAuhpmQRD YbxfE5Zyel+Pwy2INJ3uuJmCm/p3/HbepRCKlcSGcCzkkSuu2564bQ0eFub5Lm/J09xYLJ U7PInHJu4ceXyzRg02j6qZc52fnIdZPpT4RSBy8V/BMgCa/SNbR4y4HiKjiJOtTzvhaExZ uUsSfGAjTRHFVOFFHDirwszqBgnTi4rAj/7jMXBy597Ed2J9T6OJ5xpUObo7PPf+SS2bHx pqSNz7difJZEZzI5UdT6zNoFGzL/QvFVlD++FY2iRUJwsbOMTJmOr/vQim3uhA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1796156141; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oAW6FWXLeN0lQcasVyvuIOaeRUq3DaGWhKPRN9WG5XY=; b=7hhPWlTfhSdvdY/7VJaRFpMpG9Iv9NqwMOjpXKLqTGdvCRKn1/xdSCtbeopR6wqU6uaWbk MJ0fB0c+/eb8TpAQ== From: "tip-bot2 for Nicolai Buchwitz" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/drivers] irqchip/bcm2712-mip: Fix multi-MSI allocation for non-power-of-two counts Cc: Nicolai Buchwitz , Thomas Gleixner , Florian Fainelli , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20261112-bcm2712-mip-msi-align-v1-1-68090868c979@tipi-net.de> References: <20261112-bcm2712-mip-msi-align-v1-1-68090868c979@tipi-net.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-ID: <179615613935.1190409.12175280826487538840.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/drivers branch of tip: Commit-ID: e5cd48011ba4b5e52e7b873485eaac199f4a46cb Gitweb: https://git.kernel.org/tip/e5cd48011ba4b5e52e7b873485eaac199f4= a46cb Author: Nicolai Buchwitz AuthorDate: Thu, 12 Nov 2026 12:58:11 +01:00 Committer: Thomas Gleixner CommitterDate: Tue, 01 Dec 2026 21:12:22 +01:00 irqchip/bcm2712-mip: Fix multi-MSI allocation for non-power-of-two counts ilog2() rounds down, so a request for three vectors reserves only two slots and the third can overlap another allocation. The alignment is also applied to the bitmap index and ignores the msi_offset that is added to the message data. Reserve exactly the requested number of slots and align the start of the message data block to the vector count rounded up to a power of two. Fixes: 32c6c054661a ("irqchip: Add Broadcom BCM2712 MSI-X interrupt controlle= r") Signed-off-by: Nicolai Buchwitz Signed-off-by: Thomas Gleixner Reviewed-by: Florian Fainelli Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261112-bcm2712-mip-msi-align-v1-1-68090868c9= 79@tipi-net.de --- drivers/irqchip/irq-bcm2712-mip.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-bcm2712-mip.c b/drivers/irqchip/irq-bcm2712-= mip.c index 06a6ab6..a0f45df 100644 --- a/drivers/irqchip/irq-bcm2712-mip.c +++ b/drivers/irqchip/irq-bcm2712-mip.c @@ -71,15 +71,24 @@ static struct irq_chip mip_middle_irq_chip =3D { =20 static int mip_alloc_hwirq(struct mip_priv *mip, unsigned int nr_irqs) { + unsigned long hwirq; + guard(spinlock)(&mip->lock); - return bitmap_find_free_region(mip->bitmap, mip->num_msis, ilog2(nr_irqs)); + hwirq =3D bitmap_find_next_zero_area_off(mip->bitmap, mip->num_msis, 0, + nr_irqs, roundup_pow_of_two(nr_irqs) - 1, + mip->msi_offset); + if (hwirq >=3D mip->num_msis) + return -ENOSPC; + + bitmap_set(mip->bitmap, hwirq, nr_irqs); + return hwirq; } =20 static void mip_free_hwirq(struct mip_priv *mip, unsigned int hwirq, unsigned int nr_irqs) { guard(spinlock)(&mip->lock); - bitmap_release_region(mip->bitmap, hwirq, ilog2(nr_irqs)); + bitmap_clear(mip->bitmap, hwirq, nr_irqs); } =20 static int mip_middle_domain_alloc(struct irq_domain *domain, unsigned int v= irq,