All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jelly Jia <Jelly.Jia@cixtech.com>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, dmaengine@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, vkoul@kernel.org,
	Frank.Li@kernel.org
Subject: Re: [PATCH v7 04/10] dmaengine: arm-dma350: Serialize IRQ and termination state
Date: Fri, 20 Nov 2026 14:15:55 +0800	[thread overview]
Message-ID: <av/lm+np9hUJlpRm@ubuntu> (raw)
In-Reply-To: <sashiko-outbox-218565@kernel.org>

Hi,

> Can clearing CH_INTREN before stopping the channel leave CH_STAT_DONE or
> CH_STAT_ERR latched in CH_STATUS across channel teardown?

The status bits may remain set, but I don't think they can be
misattributed to a newly started descriptor with the current locking.

Both d350_irq() and the call to d350_start_next() hold vc.lock.
The IRQ handler acquires this lock before reading CH_STATUS:

- If the handler runs before the new descriptor is installed,
  dch->desc is NULL after termination. The handler acknowledges the
  old status and returns without completing a descriptor.

- If d350_start_next() runs first, it installs the new descriptor
  and writes ENABLECMD while still holding the lock. The DMA-350
  TRM, section 6.5.1.2, specifies that ENABLECMD automatically clears
  STAT_DONE and STAT_ERR, which also clears the corresponding INTR
  flags. The handler therefore cannot sample the old status against
  the new descriptor.

Also, section 6.5.1.3 states that clearing CH_INTREN does not affect
interrupts that are already pending, so the INTR bits do not simply
become zero when CH_INTREN is cleared.

This reasoning assumes that STOP completes successfully; STOP timeout
recovery is a separate issue.

Best regards,
Jelly

  reply	other threads:[~2026-11-20  6:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  9:43 [PATCH v7 00/10] dmaengine: arm-dma350: Add slave support and Sky1 integration Jelly Jia
2026-11-17  9:43 ` [PATCH v7 01/10] dmaengine: arm-dma350: Fix source trigger bit Jelly Jia
2026-11-17  9:43 ` [PATCH v7 02/10] dmaengine: arm-dma350: Check DMA mask setup errors Jelly Jia
2026-11-20 17:29   ` Frank Li
2026-11-17  9:43 ` [PATCH v7 03/10] dmaengine: arm-dma350: Initialize channel coherency Jelly Jia
2026-11-17  9:43 ` [PATCH v7 04/10] dmaengine: arm-dma350: Serialize IRQ and termination state Jelly Jia
2026-11-17 10:03   ` sashiko-bot
2026-11-20  6:15     ` Jelly Jia [this message]
2026-11-17  9:43 ` [PATCH v7 05/10] dmaengine: arm-dma350: Report submitted descriptor status Jelly Jia
2026-11-17  9:43 ` [PATCH v7 06/10] dmaengine: arm-dma350: Use managed device registration Jelly Jia
2026-11-17  9:43 ` [PATCH v7 07/10] dmaengine: arm-dma350: Track descriptor byte lengths explicitly Jelly Jia
2026-11-17  9:43 ` [PATCH v7 08/10] dmaengine: arm-dma350: Add slave and cyclic transfer support Jelly Jia
2026-11-17  9:43 ` [PATCH v7 09/10] dt-bindings: dma: arm,dma-350: Describe the CIX Sky1 integration Jelly Jia
2026-11-17  9:43 ` [PATCH v7 10/10] dmaengine: arm-dma350: Support integration clocks and resets Jelly Jia

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=av/lm+np9hUJlpRm@ubuntu \
    --to=jelly.jia@cixtech.com \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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.