From: Takashi Iwai <tiwai@suse.de>
To: nordschamane1@proton.me
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH RFC v4] ALSA: pci: add analog support for ESI MAYA44e
Date: Mon, 16 Nov 2026 16:39:42 +0100 [thread overview]
Message-ID: <877bicyedd.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261116-codex-alsa-maya44e-v4-1-381358afc43a@proton.me>
On Mon, 16 Nov 2026 05:11:02 +0100,
Nordschamane via B4 Relay wrote:
>
> From: Nordschamane <nordschamane1@proton.me>
>
> Add four-channel analog playback and capture for the ESI MAYA44e PCIe
> card (19fe:7000, subsystem 0e51:0001). Playback and capture share the
> sample clock and can use independent period sizes. Expose analog source,
> gain, direct monitoring, DAC and crossmix controls.
>
> The playback DMA rings and ALSA staging buffer are cleared during the
> reset that completes prepare. This keeps clearing and pointer rebasing
> under the same PCM stream lock, including for linked streams.
> Both streams use the locked reset path. A linked PREPARE holds the
> peer's buffer mutex but does not block its ALSA read or write copies.
> Take a driver buffer-access gate before touching either stream's
> buffers, and keep it until the reset callback. The stream lock then
> covers the remaining pointer rebase. Return -EBUSY if a copy is active.
> Explicit RESET takes its own gate when no prepare is in progress.
>
> Treat unavailable MMIO as an error during DMA setup, start and
> position tracking. A failed read must not be interpreted as a running
> engine or a completed capture period. After confirmed loss of access,
> skip BAR operations and use PCI configuration space for best-effort
> shutdown.
>
> Publish capture samples and the copied position under the same lock.
> Use the DMA position and elapsed time to detect missed capture periods.
> Skip early or repeated interrupts and report a capture XRUN when the
> ring may have wrapped without the driver copying the preceding half.
>
> The ES7010L register sequence comes from observed PCI transactions and
> analysis of the ESI Windows driver. The existing ALSA PCI MAYA44 driver
> was a reference for the WM8776 command format.
>
> OpenAI Codex assisted with PCI trace analysis, driver implementation,
> test tooling and the changelog. The requests covered analog playback,
> capture, mixer controls and suspend/resume.
>
> Signed-off-by: Nordschamane <nordschamane1@proton.me>
Thanks for the patch.
First, off, as Signed-off-by is a legal requirement, could you try to
fill a real name here? At best align the From address together, too.
About the code changes: it looks well readable in general, and the
code is rather straightforward. Yet a few things:
- Try to use guard() & co instead of the open mutex or spin lock
calls. This will avoid the lock unbalance drastically.
- The handling of the work, at least, for finishing the work doesn't
look good. In general, at PCM close callback, all streams have been
already stopped and finished, hence there shouldn't be much work
there at all. If something race is still found there, it's already
wrong. Most of such stop synchronization should have been done in
sync_stop callback, instead.
- The sample packing in the loop in ack doesn't look good, either.
Do we really need a manual expansion and the format conversion in a
loop there at all? The driver should avoid such a loop but just
copy the data as-is, as much as possible.
thanks,
Takashi
prev parent reply other threads:[~2026-11-16 15:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 4:11 [PATCH RFC v4] ALSA: pci: add analog support for ESI MAYA44e Nordschamane via B4 Relay
2026-11-16 4:25 ` sashiko-bot
2026-11-16 15:39 ` Takashi Iwai [this message]
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=877bicyedd.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=nordschamane1@proton.me \
--cc=perex@perex.cz \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox