From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796415262; b=obm470It7S85qVWyR3pULQ1yFMN4KdOEuMTTTcYWZjyonBMWxMUFRjY8DaV9psr9PTff 593E/5lF0TfxrNpVXkWZQ5gN0o5CCVajA0yFOuUhGH3ki8zoV+gpB4xT4133tJKOsOe0G hX8BEqenl+6IKndUoXha40dF0W6v0hOR6ge3Rox8JoIY3K5yXmMg2JCjmKQpV6WIaE14M GYA1R8uh9719Y/va8d0ArRflVNtsWNAKS/sMeGc24/2Dr/S86Pvhe9vd4BJnGiHE7jPR6 b+hKf5yNe3kdBDh1zn/DM4JgT71YdG5B5F8+aUGHssU8d6b0IXQVe01aqauHO3Tf+iA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796415262; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=jPgYf4qmYvT9wn7XSwJK1WoxBRvztCkRYf1p6w6cOhc=; b=OMNCz4KUs92mSsRJzJI0ksckdJ4CGoxFab8mDkbchepp3LI8hYGeCtrFYT8IDRSZo3dy JiiMIN8HTalrO+UI6Q4rSSd9prsrDByqFFcRCkLtExzfUUoEW6S/1iFfbv/6rWqO63I7d QyaozKNxioB89kmC3Suel9pH/zcPo+Pnh3POG5EC3lQh8gV+uZcOUenv0Att6N4igHP0u q427QH4gouOIaSKTEtM+xFFVNTt7ydH/+UJRu57DOT6XzNg75stjbynHf9RX0DtC4oTzo LT30FhlQgv2bfDJgmklChdurOo//TTuGgyPZ/J4ydcSQtyksqkhV5j2xqM7phdrNp8Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JfqD3mHZ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0236D606A32D for ; Fri, 4 Dec 2026 20:14:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JfqD3mHZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B7F31F0093B; Fri, 4 Dec 2026 20:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796415261; bh=jPgYf4qmYvT9wn7XSwJK1WoxBRvztCkRYf1p6w6cOhc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=JfqD3mHZ9WCxGJ4dqYBM6jWGDA8Q6kE5YiSd0y+QQCWlj8Un4VPwylJffNxDZiIgm 5nEJ5Sn03vl0AAFaXp1Uqy7o0LIFHBqUWrycF+05yR1d9jCx6UZSmGYSoWyd71xTuz tFrWtE3HTaHgh9kW0QnJsv98RV65G04EJHCw/IRJiHZXiEeuK/3bsKbrLbe8ODp3PW DNRQyTLgKkKxrPNyRfAs+gzeRmncyBKPAcbyEk+CKqlNTA17xWwx6RGwXEnESQzM9c bylupQMRrlhHIkdSNp+sh+W3V2Op4wJaW9ZKfYETtlsQvuQ2PCa6mX0u2n3jEEWMEQ xWgMPOLbsNBCQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v7 3/3] irqchip: Add Cortina Systems CS75xx peripheral interrupt controller Reply-To: sashiko-reviews@lists.linux.dev To: "Fil Dunsky" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204-cs75xx-intc-v7-3-c5e6e23a1a8c@gmail.com> References: <20261204-cs75xx-intc-v7-0-c5e6e23a1a8c@gmail.com> <20261204-cs75xx-intc-v7-3-c5e6e23a1a8c@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 20:14:21 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] irqchip/cs75xx: unlocked read of gc->mask_cache in cs75xx_intc_handler() - [Low] irqchip: stray Link trailer and duplicated paragraph in commit message -- commit dc49f44370a5b75de4ec7c5408183cbf6b8fb780 Author: Fil Dunsky > irqchip: Add Cortina Systems CS75xx peripheral interrupt controller > > The timers, GPIO banks, I2C, MDIO, SPI and a few other low speed > peripherals of the Cortina Systems CS75xx SoCs share a single GIC > interrupt. A status register shows the level of the 15 sources and an > enable register masks them; there is nothing to acknowledge, each source > is cleared in its peripheral. > > Add a chained driver using a generic chip on a linear domain. > The driver depends on OF and HAS_IOMEM and can be enabled independently > of the CS75xx platform support. > > Use irq_domain_instantiate() to allocate and initialize the generic chip > and install the parent handler before the IRQ domain is published. > A consumer can then only map an IRQ once the chip and handler are ready. > Use guard_chained_irq() to pair chained entry and exit. > > Link: https://lore.kernel.org/all/87mrqpov7z.ffs@fw13/ > > Pass the transient register base and parent IRQ through init_data. > Configure the generic chip in its own init callback and install the > parent handler in the domain init callback before publication. > > Link: https://lore.kernel.org/r/87zeuoogwp.ffs@fw13 > Signed-off-by: Fil Dunsky [Severity: Low] There is a Link: trailer in the middle of the commit message, followed by a paragraph repeating the generic chip and parent handler init description. Should those two paragraphs be merged and both Link: trailers grouped together before Signed-off-by? [ ... ] > diff --git a/drivers/irqchip/irq-cs75xx.c b/drivers/irqchip/irq-cs75xx.c > new file mode 100644 > index 0000000000000..10fd2fafad7fb > --- /dev/null > +++ b/drivers/irqchip/irq-cs75xx.c > @@ -0,0 +1,133 @@ [ ... ] > +static void cs75xx_intc_handler(struct irq_desc *desc) > +{ > + struct irq_domain *domain =3D irq_desc_get_handler_data(desc); > + struct irq_chip *chip =3D irq_desc_get_chip(desc); > + struct irq_chip_generic *gc; > + unsigned long pending; > + unsigned int hwirq; > + > + gc =3D irq_get_domain_generic_chip(domain, 0); > + guard_chained_irq(chip, desc); > + > + pending =3D readl(gc->reg_base + CS75XX_INTC_STATUS) & gc->mask_cache; > + for_each_set_bit(hwirq, &pending, CS75XX_INTC_NR_IRQS) > + generic_handle_domain_irq(domain, hwirq); > +} [Severity: Medium] Can this unlocked read of gc->mask_cache race with concurrent mask/unmask updates on another CPU and dispatch spurious child interrupts? irq_gc_mask_set_bit() and irq_gc_mask_clr_bit() update gc->mask_cache under gc->lock, while cs75xx_intc_handler() reads it unlocked. Along with the data race, unsynchronized reads of CS75XX_INTC_STATUS and gc->mask_cache allow a split snapshot when another CPU unmasks an IRQF_ONESHOT child IRQ: CPU0 CPU1 cs75xx_intc_handler() readl(CS75XX_INTC_STATUS) /* bit A and bit B set */ /* clears peripheral B */ irq_finalize_oneshot() unmask_threaded_irq() irq_gc_mask_set_bit() gc->mask_cache |=3D BIT(B) unlock(&desc_B->lock) & gc->mask_cache <-- data race, sees bit B set generic_handle_domain_irq(..., B) handle_level_irq(desc_B) handle_irq_event(desc_B) <-- spurious IRQ Because desc_B is already unmasked and desc_B->lock has been released by the time handle_level_irq() runs, irq_can_handle() returns true and invokes the handler for an already-cleared interrupt. Wrapping the status and mask_cache read in scoped_guard(raw_spinlock, &gc->lock) before the dispatch loop avoids both the data race and the split snapshot. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-cs75xx-int= c-v7-0-c5e6e23a1a8c@gmail.com?part=3D3