Skip to content

ath79: flush every write buffer of a shared CPU interrupt

Rosen Penev linux-devicetree linux-mips lkml 2 versions – Applied

Status from this message: The following commit has been merged into the irq/drivers branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesApplied
  2. v11 patch 2 repliesSuperseded

Changes in v2 from the cover letter

- Add dt-binding change.
- Add a comment describing the interrupt wiring and the write buffers (Thomas)
- New patch 3: flush the write buffers of an interrupt in parallel, and document the double flush from the AR7100 datasheet (Thomas)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3dt-bindings: interrupt-controller: qca,ar7100-cpu-intc: allow shared write buffer interruptsDocumentation/devicetree/bindings/interrupt-controller/qca,ar7100-cpu-intc.yaml+4 -11 reply
2/3irqchip/ath79-cpu: flush every write buffer of a shared interruptdrivers/irqchip/irq-ath79-cpu.c+34 -171 reply
3/3MIPS: ath79: flush the DDR write buffers of an interrupt in parallelarch/mips/ath79/common.c arch/mips/include/asm/mach-ath79/ath79.h drivers/irqchip/irq-ath79-cpu.c+45 -210 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchKrzysztof Kozlowski
1/3A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] ath79: flush every write buffer of a shared CPU interrupt

On AR934x and QCA953x, the WMAC and the PCIe root complex share CPU interrupt 2, but each writes to DDR through its own write buffer in the DDR controller. The ath79 CPU interrupt controller flushes one write buffer per interrupt before running its handlers, so only the buffer listed last in the device tree gets flushed, and the other device can read stale descriptors.

Patch 1 documents in the binding that a CPU interrupt may be listed once per write buffer. Patch 2 keeps a mask of write buffers per CPU interrupt and flushes all of them, and documents how the interrupt lines, the write buffers and the flush fit together. Patch 3, suggested by Thomas, starts the flushes of all the buffers of an interrupt before waiting for any of them, so they drain in parallel, and replaces the "It must be run twice" comment with what the AR7100 datasheet says about it.

Patch 3 changes the signature of ath79_ddr_wb_flush() and its call site in the irqchip driver, so patches 2 and 3 should go through the same tree.

Changes since v1:
- Add dt-binding change.
- Add a comment describing the interrupt wiring and the write buffers (Thomas)
- New patch 3: flush the write buffers of an interrupt in parallel, and document the double flush from the AR7100 datasheet (Thomas)

Build tested with ath79_defconfig (LLVM, W=1).

Claude Code (Claude Opus 5.5) helped write the comments, patch 3 and the commit messages, and searched the Atheros datasheets for the double-flush requirement. I reviewed all the changes.

Rosen Penev (3):
dt-bindings: interrupt-controller: qca,ar7100-cpu-intc: allow shared
write buffer interrupts
irqchip/ath79-cpu: flush every write buffer of a shared interrupt
MIPS: ath79: flush the DDR write buffers of an interrupt in parallel

 .../qca,ar7100-cpu-intc.yaml                  |  5 +-
 arch/mips/ath79/common.c                      | 51 ++++++++++++++-----
 arch/mips/include/asm/mach-ath79/ath79.h      |  2 +-
 drivers/irqchip/irq-ath79-cpu.c               | 44 ++++++++++------
 4 files changed, 73 insertions(+), 29 deletions(-)
Signature · 1 line
2.56.0