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=1796381823; b=R56gih0M6bCCKS/0r2ic2NSoIYXDkXZA2JdUJRHXd3+0mX2upiZmai/Q3Wixwkw0wYVk 8NEyK0st0KORTANKM3+LIbia2YBMEt/HRy8Nq8BjnFypC4MSW6et/jVmMrZR0KP4xtX0X lv1NuvaXAJj3qgFbzW1FrblUB4fIYr4QHPEWNmLGVOhiGp1y4Iy33GajqcasJ5RG2eHwV FoEwyG+cUjhE+dcwVmkHtFJiOspGy6el9PnCwecGxjSBsP+UWsbjJ7EhDwiwDDvBLgoxm Zy2/OAZwuXzGveYhpGTknCaCITWK0b8YEVhsDX8h3aXF6aO8ay6iVwSrdBdQ9NkbAFQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381823; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type; bh=vS/HKvmvxu0BbNI75y1au92eUmH+xAWPSEoq0y0D03M=; b=ugykxAfXlhyw1KP1ji2aX03Kan/Iz0YlcNLMyJrZkHkO62uc4DPAui44NTYyJqIgktay BtEPUALwy/CAFs0LHYDBCitutVWqaCekV3sbWqFWA4HsFAeFZP3klqDcmGgck+JlWQaZx p9/hWNuekWZEiN7E22n6t4x54OGrsLkiXQ8qLmO2SENNeEY4YbAHgxJ+HrrhF0SR6/CMw /nHf5pEugDJIGi2DI2NAYMoCQdMgaDFZJP1qWBgg0JwJuLdb1UffiJdBhVP7DD/e7shg+ KVmFjd+6GO23/8RGRp9nYn9UVp1KP8iKtSDAf2nagtbulm986JLDx3IaiqIolVfZMvA== 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=Tt5QYaYI; 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 9AC70606A322; Fri, 4 Dec 2026 10:57:03 +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=Tt5QYaYI Received: by smtp.kernel.org (Postfix) with ESMTPSA id D10461F000C2; Fri, 4 Dec 2026 10:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796381823; bh=vS/HKvmvxu0BbNI75y1au92eUmH+xAWPSEoq0y0D03M=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Tt5QYaYIaymftnva1Kxl30z/kfatJv0m7g6lE0+DnPFAhGCaQJC45gyvv3oYDIP6+ 6XtYFhh+hlx9IGRNS2MLJCzcI4pDF/6nEH6xH0trfHFPAa/Em+IP613m0i8v6h7hgf DQkeiAgj1Mm6Z2bf7IB+13PH52ElenaCW4ZHzth8B0xYwtcyyqm1QRrKV+4a/+CmrQ pewiHCZC5jWnoVoUV9gGUaS+wpitw48lur0W7jkNu7EI0xnvmae4+xC3nxklBC8hWG bLDrecnu0tXUtPstKr/BwM/6yXXLxmJfSxLWjPDaqOq6WqxLBGlS4sqQP0j2UgGKlW mHOuB4VK/XnAw== 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> Date: Fri, 04 Dec 2026 11:57:00 +0100 Message-ID: <87wlppmhz7.ffs@fw13> X-Mailing-List: devicetree@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 Thu, Dec 03 2026 at 13:14, Charles Perry wrote: > On Thu, Dec 03, 2026 at 11:35:20AM +0100, Thomas Gleixner wrote: >> On Wed, Dec 02 2026 at 17:20, Charles Perry wrote: >> > On Tue, Dec 01, 2026 at 08:31:19PM +0100, Thomas Gleixner wrote: >> >> > + * Clear it, then dispatch only the sources whose line is still high. >> >> > + */ >> >> > + writel(pending, intc->base + P64H_NVM_INTC_STATUS); >> >> >> >> What happens in the case that there is only BIT(N) pending in STATUS and >> >> that bit is not set in ENABLED? >> > >> > That happens only with PREEMPT_RT. >> >> I don't think that's a PREEMPT_RT issue. That's an issue related to >> threaded interrupts. Just add 'threadirqs' on the kernel command line >> with a !RT kernel and you should observe the same. > > I've tested 'threadirqs' with !RT and I observe the same thing as with RT. Not a surprise. Let's look how level interrupt controllers work in general: Hardware CPU Line is raised interrupt is raised interrupt() handle_level_irq() mask_ack() device_handler() Line is cleared ... unmask() The mask_ack() does two things: 1) It masks the interrupt so the it can't be raised again until the device handler completed. That's required because with level type the interrupt line stays raised until the device handler cleared it in the device. 2) It acks the interrupt, which resets the logic in the interrupt chip to raise the interrupt in the CPU again. So if ACK happens without masking the interrupt stays asserted or the ACK might cause a 1-0-1 transition in some chips. Threaded mode does not really change this: interrupt is raised interrupt() handle_level_irq() mask_ack() wake_thread() return // interrupt stays masked thread() device_handler() unmask() All what changes is the timing. So this sequence: pending = read(STATUS) & read(ENABLE); write(pending, STATUS); pending &= read(STATUS); does not make sense for a sanely designed level type controller which usually does: STATUS = LINESTATE & ENABLED and if it has multiple input lines then the output is simply: OUTLINE = STATUS(0) | STATUS(1) .... | STATUS(N) >From your code and comments it seems STATUS is latched which does not make sense. But even then it does not explain how the status bit stays raised with the mask_ack() sequence of the level handler. That makes me very confident that these SoCs are redefining the future for space and mission critical applications :) Thanks, tglx