All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Rosen Penev <rosenp@gmail.com>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Alban Bedel <albeu@free.fr>
Cc: Radu Rendec <radu@rendec.net>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-mips@vger.kernel.org
Subject: Re: [PATCH v2 2/3] irqchip/ath79-cpu: flush every write buffer of a shared interrupt
Date: Wed, 11 Nov 2026 00:53:23 +0100	[thread overview]
Message-ID: <87ld70tf9o.ffs@fw13> (raw)
In-Reply-To: <20261108215738.113582-3-rosenp@gmail.com>

On Sun, Nov 08 2026 at 13:57, Rosen Penev wrote:
>  /*
> - * The IP2/IP3 lines are tied to a PCI/WMAC/USB device. Drivers for
> - * these devices typically allocate coherent DMA memory, however the
> - * DMA controller may still have some unsynchronized data in the FIFO.
> - * Issue a flush in the handlers to ensure that the driver sees
> - * the update.
> + * The MIPS core has 8 interrupt lines: IP0/IP1 are software interrupts,
> + * IP7 is the CP0 timer, and IP2-IP6 are wired by the SoC to its devices.
> + * The wiring is fixed in hardware. Several devices can share a line, like
> + * the WMAC and the PCIe root complex on IP2 of AR934x, and their drivers
> + * then request the interrupt with IRQF_SHARED.
>   *
> - * This array map the interrupt lines to the DDR write buffer channels.
> + * Each DMA master writes to DDR through its own write buffer in the DDR
> + * controller, and each write buffer has its own flush register. When a
> + * device raises its interrupt, its last DMA writes may still sit in its
> + * write buffer, so the handler could read stale descriptors or data.
> + *
> + * The CPU interrupt says nothing about which device on a shared line
> + * raised it. So before running the handlers of a line, flush the write
> + * buffers of every device wired to it. Each handler then sees its
> + * device's data, checks its own status, and returns IRQ_NONE if it was
> + * not the source.
> + *
> + * irq_wb_chans maps each CPU interrupt line to the mask of the write
> + * buffer channels to flush, from the qca,ddr-wb-channel-interrupts and
> + * qca,ddr-wb-channels properties.

Thanks for writing this up. That really makes reasoning about this way
more palatable.


  reply	other threads:[~2026-11-10 23:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 21:57 [PATCH v2 0/3] ath79: flush every write buffer of a shared CPU interrupt Rosen Penev
2026-11-08 21:57 ` [PATCH v2 1/3] dt-bindings: interrupt-controller: qca,ar7100-cpu-intc: allow shared write buffer interrupts Rosen Penev
2026-11-09 13:06   ` Krzysztof Kozlowski
2026-11-11 19:56   ` [tip: irq/drivers] dt-bindings: interrupt-controller: qca,ar7100-cpu-intc: Allow " tip-bot2 for Rosen Penev
2026-11-08 21:57 ` [PATCH v2 2/3] irqchip/ath79-cpu: flush every write buffer of a shared interrupt Rosen Penev
2026-11-10 23:53   ` Thomas Gleixner [this message]
2026-11-11 19:56   ` [tip: irq/drivers] irqchip/ath79-cpu: Flush " tip-bot2 for Rosen Penev
2026-11-08 21:57 ` [PATCH v2 3/3] MIPS: ath79: flush the DDR write buffers of an interrupt in parallel Rosen Penev
2026-11-11 19:56   ` [tip: irq/drivers] MIPS: ath79: Flush " tip-bot2 for Rosen Penev

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=87ld70tf9o.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=albeu@free.fr \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=radu@rendec.net \
    --cc=robh@kernel.org \
    --cc=rosenp@gmail.com \
    --cc=tsbogend@alpha.franken.de \
    /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.