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=1796142094; b=I7ua7XJzI68bRWjsxCHd5JjnSoOlZlim1Xm0+c41oUwTZvkou8oUpx5eH0GU31MT91Fx d9s3qdZNsNx+cg+2HlpwHmcSPYfQStk++c8Cc+2VmilH7jmhwNw+1KmwjMMbwkLf4fcKB XYih2H2ji7QvqAi9USO9Qpd4JZjxoWfSJexZji7TljFQH75wLl0mmLY2ec6Sb963Ak48F FStEERNCQI9FtePOv4nf582Ut2z2HJgoBgVN8XysMLxOEUXuAiB6e6Ns2DXespGhZpzo+ hQYLPymWVn+RZ7MDf7duUBSFQ8fkl+IOFbXyYF/m0yrZx7v3ZS43saqjnDNAU2lmjAw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796142094; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=mlhqvTCEyT8IXBgVjkUKicqhjKPclHVbvHSQ8ARcOp8=; b=OrIGQ4QtEMJIvkeLZIqNcEURBWArqz1ZvfdRnA90minM2JTAEwbSlVhMApHZLysxG7nu lljAijTw+v/AwOdJdy1easWinQo2v66/NYSAhN1FY+b9T5qjh90mtJQsgwCzvlwfcvZSJ hGrE1ozJ4f0AS2KLINWiwYhJyyszb0LJO6fC0lDQ3X6ReF6Fux724c/LeRIqShMNmc7pz uzZsSTncxL7mCaY3YblaSyofS2YTlRdg3YOCRAZHbMzjBmxmtppiKdS3a886uoY3Ot9LA bztN9z3k4Wtu3VCrqQ6RriFEk9QtMrpwmNJN72d8kxgM6Nu33O7O0ev3CO2KMOjdzgQ== 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="PDFXyr/o"; 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 9535B606A68B for ; Tue, 1 Dec 2026 16:21:34 +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=PDFXyr/o Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BF001F00898; Tue, 1 Dec 2026 16:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796142093; bh=mlhqvTCEyT8IXBgVjkUKicqhjKPclHVbvHSQ8ARcOp8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=PDFXyr/owObPsbATLayu8Tdv5iFHDgW7WmbXOJiYyo/I6mMUpi9SmB3tcyoPKiu/j XUxlmAvTG0F6n52DJf4OcsnmX/7JFKTPi55OxnVJDyB9dfKS3RzubvyvaqFTUfyXox KM7dvQnm5C3CVkupmK95UlCAPIC5vZG5/Erv0JRbOl/8JPqX9eplniIXtj5i4XO3I2 5oq6JMIyM4e+uIIESMW1Zd1n5U505OqTovSVbfvMqMBkALuJf4Qxk2pmF2z80oTUBo ZCJI2V6/5iYcvcOMHguNXzoB7grrOt/U7l/Q85k3iRo8k9bAVAqy5KTrJyF5lhm/eg ruyS0DiAR5OJQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/2] irqchip: Add Microchip PIC64-HPSC/HX NVM interrupt controller Reply-To: sashiko-reviews@lists.linux.dev To: "Charles Perry" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261201-linux-7-4-rc4-pic64hpsc-nvm-intc-v1-2-e87ed786dc1b@microchip.com> References: <20261201-linux-7-4-rc4-pic64hpsc-nvm-intc-v1-0-e87ed786dc1b@microchip.com> <20261201-linux-7-4-rc4-pic64hpsc-nvm-intc-v1-2-e87ed786dc1b@microchip.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 16:21:33 +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 1 potential issue to consider: - [High] irqchip: pic64hpsc-nvm-intc: premature STATUS clear loses level IRQs -- commit 73f24bc314fe5e84231bc25d702188d9731ab0ca Author: Romain Caritey irqchip: Add Microchip PIC64-HPSC/HX NVM interrupt controller This commit adds an irqchip driver for the local NVM interrupt controller found on Microchip PIC64-HPSC and PIC64-HX SoCs. > diff --git a/drivers/irqchip/irq-mchp-pic64hpsc-nvm-intc.c b/drivers/irqc= hip/irq-mchp-pic64hpsc-nvm-intc.c > new file mode 100644 > index 0000000000000..84e4cfdbc5e7f > --- /dev/null > +++ b/drivers/irqchip/irq-mchp-pic64hpsc-nvm-intc.c [ ... ] > +static void p64h_nvm_intc_irq_ack(struct irq_data *d) > +{ > + struct p64h_nvm_intc *intc =3D irq_data_get_irq_chip_data(d); > + > + writel(BIT(d->hwirq), intc->base + P64H_NVM_INTC_STATUS); > +} > + > +static void p64h_nvm_intc_irq_mask(struct irq_data *d) > +{ > + struct p64h_nvm_intc *intc =3D irq_data_get_irq_chip_data(d); > + > + p64h_nvm_intc_update_enable(intc, BIT(d->hwirq), 0); > +} > + > +static void p64h_nvm_intc_irq_unmask(struct irq_data *d) > +{ > + struct p64h_nvm_intc *intc =3D irq_data_get_irq_chip_data(d); > + > + p64h_nvm_intc_update_enable(intc, 0, BIT(d->hwirq)); > +} [ ... ] > +static irqreturn_t p64h_nvm_intc_handler(int irq, void *data) > +{ > + struct p64h_nvm_intc *intc =3D data; > + unsigned long pending; > + unsigned int hwirq; > + > + pending =3D readl(intc->base + P64H_NVM_INTC_STATUS) & > + readl(intc->base + P64H_NVM_INTC_ENABLE) & > + P64H_NVM_INTC_VALID_MASK; > + > + if (!pending) > + return IRQ_NONE; > + > + /* > + * STATUS may hold a stale edge, already handled while masked. > + * Clear it, then dispatch only the sources whose line is still high. > + */ > + writel(pending, intc->base + P64H_NVM_INTC_STATUS); > + > + pending &=3D readl(intc->base + P64H_NVM_INTC_VALUE); > + > + for_each_set_bit(hwirq, &pending, P64H_NVM_INTC_NUM_IRQS) > + generic_handle_domain_irq(intc->domain, hwirq); > + > + return IRQ_HANDLED; > +} [Severity: High] Can clearing P64H_NVM_INTC_STATUS before the child device deasserts its level-high interrupt line permanently lose level interrupts? >From the comment and handling in p64h_nvm_intc_handler(), P64H_NVM_INTC_VALUE reflects the live level of the child lines, whereas P64H_NVM_INTC_STATUS latches rising edges and gates the parent APLIC line together with P64H_NVM_INTC_ENABLE. However, P64H_NVM_INTC_STATUS is cleared in p64h_nvm_intc_handler() and again in p64h_nvm_intc_irq_ack() via handle_level_irq() -> mask_ack_irq() before the child handler services the device, while the child line in P64H_NVM_INTC_VALUE is still high. If the child line stays continuously high without dropping low and rising again (for example, when a controller has another pending event keeping its line asserted after handle_irq_event(), or when handle_level_irq() bails out at !irq_can_handle(desc) while the IRQ is disabled), P64H_NVM_INTC_STATUS remains 0 when p64h_nvm_intc_irq_unmask() re-enables the line, and the interrupt never fires again. Unconditionally clearing P64H_NVM_INTC_STATUS in p64h_nvm_intc_probe() has the same problem for any child line already asserted high at probe time. Conversely, if a transient edge latches into P64H_NVM_INTC_STATUS while the child IRQ is masked (such as during an IRQF_ONESHOT threaded handler) and is already cleared at the device before unmasking, p64h_nvm_intc_irq_unmask= () leaves the stale bit set in P64H_NVM_INTC_STATUS, immediately triggering a spurious parent interrupt where pending &=3D readl(... + P64H_NVM_INTC_VALU= E) is 0. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201-linux-7-4-= rc4-pic64hpsc-nvm-intc-v1-0-e87ed786dc1b@microchip.com?part=3D2