All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Charles Perry <charles.perry@microchip.com>
Cc: Charles Perry <charles.perry@microchip.com>,
	Radu Rendec <radu@rendec.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Romain Caritey <romain.caritey@microchip.com>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] irqchip: Add Microchip PIC64-HPSC/HX NVM interrupt controller
Date: Sat, 05 Dec 2026 19:39:51 +0100	[thread overview]
Message-ID: <87y0a3lgg8.ffs@fw13> (raw)
In-Reply-To: <axNFnrdRAzS_eOE2@MON-LT-C78453.mchp-main.com>

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

  reply	other threads:[~2026-12-05 18:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 16:06 [PATCH 0/2] Add support for Microchip PIC64-HPSC/HX NVM interrupt controller Charles Perry
2026-12-01 16:06 ` [PATCH 1/2] dt-bindings: interrupt-controller: document Microchip PIC64-HPSC/HX NVM intc Charles Perry
2026-12-01 18:13   ` Conor Dooley
2026-12-02 16:44     ` Charles Perry
2026-12-01 16:06 ` [PATCH 2/2] irqchip: Add Microchip PIC64-HPSC/HX NVM interrupt controller Charles Perry
2026-12-01 16:21   ` sashiko-bot
2026-12-01 19:31   ` Thomas Gleixner
2026-12-02 22:20     ` Charles Perry
2026-12-03 10:35       ` Thomas Gleixner
2026-12-03 18:14         ` Charles Perry
2026-12-04 10:57           ` Thomas Gleixner
2026-12-04 15:54             ` Charles Perry
2026-12-04 20:40               ` Thomas Gleixner
2026-12-04 22:58                 ` Charles Perry
2026-12-05 18:39                   ` Thomas Gleixner [this message]
2026-12-04 11:00   ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y0a3lgg8.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=charles.perry@microchip.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=radu@rendec.net \
    --cc=robh@kernel.org \
    --cc=romain.caritey@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.