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=1796495995; b=MBGL0hAPb8WWkqpj+6/pEZLOphel5EK5KwPTQVtrMkXZ4tcWDeG2TVuA8L7um/DlzzXf 5a6jKESVohL93LxN9yWL/zCFfQoTVCjuhAV4mg3Dfb0zwDlHMUQ2SXfy8IzkHXuqusRJa SKnTU5fJZZPX3DwhJOnpv6VZsV9sGzjmPLxffSkLvsybZQ+AcowCx/N+xs/381O2sm3fp PoUjDTQkmzEaHGodzGiMoJjvlRWUusnkeI98pWaGmMweq6awbVqn7k0++cIqxgJZIjTX5 f11rthTGz6+G7POI9Bhein9w8C7/TSAj6+P7qfM23gEFb93J2LfCsqEG0GdyFLwUNRg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796495995; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type; bh=y8TQfSpQzRIDMkhbvPcMJjt/kEDwiF3EJosrmQPM85s=; b=5pYQ7C3ZzM88JKm7X/cw0FDq+wAXdEARRG27r78ZXRNapCPP69YoDFyw2EzJOc6zrOsL mEWgAz0SefNNMBrO4mnU4xV96Nl3WihJYHbN/u7GkaE+31qCMVw1dCblMvbvWGorUpA5p /p8Xcw1Vpdxos3XzDX9AjHBFZMrgflGjqUoCBHdm5+AxRY86mVpr7HIeLAbNY5mrUWSpJ ZGZb2LBjZGzn43udLJT89I+XXBWvC7G0MwKueJxt891twvwkiDevaDMPBsPyOxmZsgzwT 6337D3DxBok4OD5rf1fqja9+gif0sW9ZMppRJQhznuiCoOTG4aE0be9c0t8hh0VCrmQ== 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=A3kCbu6F; 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 2320A606A322; Sat, 5 Dec 2026 18:39:55 +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=A3kCbu6F Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C7A11F0092B; Sat, 5 Dec 2026 18:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796495995; bh=y8TQfSpQzRIDMkhbvPcMJjt/kEDwiF3EJosrmQPM85s=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=A3kCbu6F7ipOAAga+Gf9QKSPWh5DH1GN2b346QKX2KSoOwBq9E4yLk2uEDBiViSTI YnJG51NNr0safyfKR/WMBdgHIZR6H+QT9ujAkM3ZPr8FRIdd7rBXQ83qfQY/EeZXBx IuNuCfDKPhTxqRmhFAhithKLMlYKM8zotHSTV44KK72nSB7oINxRG1y0g+DfKHJ//k uqbTw8hQLEzRTZxInC/LwPT/nWINH4l1cmkji7/MxUhR75xFRUXZ0AE++DenmOODig +9Q1eEKPHdu6glukBJEm1OpOsPoBzS12wT0/A7kyTGOPm0zE32Tt+3uK7MNiexe+Cd iNRrl1VwC8EWw== From: Thomas Gleixner To: Charles Perry Cc: Charles Perry , Radu Rendec , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Romain Caritey , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 2/2] irqchip: Add Microchip PIC64-HPSC/HX NVM interrupt controller In-Reply-To: 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> <874icwpzlk.ffs@fw13> <87ecbyodnb.ffs@fw13> <87wlppmhz7.ffs@fw13> <87a4mkn5jl.ffs@fw13> Date: Sat, 05 Dec 2026 19:39:51 +0100 Message-ID: <87y0a3lgg8.ffs@fw13> 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 Content-Type: text/plain On Fri, Dec 04 2026 at 17:58, Charles Perry wrote: > On Fri, Dec 04, 2026 at 09:40:14PM +0100, Thomas Gleixner wrote: >> Which means the input logic is edge type. The output is level type. >> >> But you claim the input is level type too. That doesn't make any sense. > > I was under the impression that it's the device (and not the interrupt > controller) that decides if an interrupt is level or edge but maybe I'm > wrong. If you connect a level type device to an edge type interrupt controller or the other way round then you have to keep the pieces. > If this happens on an input of nvm-intc, then VALUE=1 and STATUS=0. > > The way we would handle this with nvm-intc is to check VALUE after unmask() > and call the interrupt handler again if it is raised. That's not done in > the patch I sent because I never encountered the issue. That needs core support, but I really recommend to look into edge handling first. The device driver has to make sure, that all interrupt bits in the device status are cleared before leaving the handler. Then the next interrupt will create an edge and everything just works. >> If the interrupt is latched on a rising edge, then you need to treat it >> as edge interrupt type. The underlying APLIC interrupt can still be > > Ok, that should work. IIUC, I should use handle_edge_irq() which > ->irq_ack() but does not ->irq_mask(). > > In our first attempt to support this, we added the STATUS register in all > of the NVM controllers (xSPI, SD, NAND) and each of these drivers would ack > their interrupt bit in the STATUS register without any masking. That worked > fine but is a bit of a hack because you need to map the same register in 3 > different drivers. ... and presents a blatant layering violation :) Thanks, tglx