Devicetree
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Igor Paunovic <royalnet026@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, kernel@collabora.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] media: synopsys: hdmirx: add HDMI audio capture support
Date: Thu, 23 Jul 2026 23:56:11 +0300	[thread overview]
Message-ID: <1ac66aab-8985-4441-8ce1-07e2ea5183bd@collabora.com> (raw)
In-Reply-To: <CAEWPSH5j3tYNb1JKRGwa00PVnYAgCKS+B-Qz07D8Z7TJea5cMw@mail.gmail.com>

On 7/21/26 08:31, Igor Paunovic wrote:
> Hi Dmitry,
> 
>> Re-arming will be best option if it works properly.
> 
> Went back to it and made it work properly -- with one honest caveat
> at the end.
> 
> Plain cancel/re-arm could not have been enough as previously
> written: hdmirx_resume() fully resets the controller via
> reset_control_bulk_assert/deassert in hdmirx_enable(), wiping the
> audio configuration (I2S_EN, AUDIO_ENABLE, FIFO thresholds), and
> the worker's error path never re-programs those -- it only resyncs
> the clock rate and reinits the FIFO. So v4 does:
> 
> - suspend: cancel_delayed_work_sync() on the audio worker before
> the clocks are gated (audio_streaming stays set);
> - resume: if a capture stream is active, re-program the whole
> audio path (clock from the last known sample rate, FIFO
> thresholds, I2S_EN, AUDIO_ENABLE) and re-arm the worker.
> 
> The programming is factored out of hw_params() into a shared
> hdmirx_audio_setup() helper so resume and hw_params cannot drift.
> I also checked that nothing in the post-resume hotplug re-init path
> (plugout/plugin/submodule_init/controller_init) touches the audio
> bits, so the restore survives the replug dance resume triggers.
> 
> Measured on the Orange Pi 5 Plus (pm_test=devices, i.e. full device
> suspend/resume callbacks, active capture stream with live audio
> through the whole cycle): on resume the capture simply continues --
> audio was flowing again the moment the display came back, no
> userspace intervention, clean dmesg, no oops in any of the ~6
> cycles exercised tonight.
> 
> The caveat: a *second* suspend/resume cycle in the same boot leaves
> the audio datapath silent (the I2S slave sees no bit clock, so
> capture reads time out) even though the resume restore re-programs
> everything, and a fresh stream open does not recover it -- only a
> reboot does. Notably this happens with plain no-stream suspend
> cycles as well, so it is not caused by (and would not be prevented
> by) either the re-arm or the -EBUSY approach -- it looks like more
> controller state lost on repeated reset that neither hw_params nor
> resume currently covers, likely the same warm-up state machine I
> described in the v3 testing note (audio needing a video STREAMON
> after a replug). I am instrumenting the register state next to
> root-cause it; I'd treat it as a follow-up rather than a v4
> blocker, but happy to hear if you see it differently -- and curious
> whether the 5B shows the same second-cycle behavior.
> 
> v4 follows with the re-arm plus the dts and binding changes already
> mentioned.
> 
> One more small thing the audio bit exposes, for a possible
> follow-up: hdmirx_cec_update_bits() is a non-atomic RMW (the read
> and the write each take rst_lock separately), and with audio added
> there are now two writers of GLOBAL_SWENABLE, so a CEC adapter
> enable racing an audio enable/disable could in theory lose the
> other side's bit. Mainline today has a single writer, so it is not
> a bug there. Can send a small patch making it atomic if you think
> it is worth it.

Feel free to send the follow ups.

-- 
Best regards,
Dmitry

  reply	other threads:[~2026-07-23 20:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-18  8:57 [PATCH v3 0/4] media: synopsys: hdmirx: add HDMI audio capture support Igor Paunovic
2026-07-18  8:57 ` [PATCH v3 1/4] dt-bindings: media: snps,dw-hdmi-rx: add #sound-dai-cells Igor Paunovic
2026-07-19  8:54   ` Krzysztof Kozlowski
2026-07-19  9:53     ` Igor Paunovic
2026-07-18  8:57 ` [PATCH v3 2/4] media: synopsys: hdmirx: add HDMI audio capture support Igor Paunovic
2026-07-18  9:09   ` sashiko-bot
2026-07-18 10:53     ` Igor Paunovic
2026-07-20  1:42   ` Dmitry Osipenko
2026-07-20 12:30     ` Igor Paunovic
2026-07-20 14:36       ` Dmitry Osipenko
2026-07-21  5:31         ` Igor Paunovic
2026-07-23 20:56           ` Dmitry Osipenko [this message]
2026-07-23 23:47             ` Igor Paunovic
2026-07-25 17:58               ` Dmitry Osipenko
2026-07-18  8:57 ` [PATCH v3 3/4] arm64: dts: rockchip: add #sound-dai-cells to the RK3588 HDMI receiver Igor Paunovic
2026-07-18 11:12   ` Igor Paunovic
2026-07-18  8:57 ` [PATCH v3 4/4] arm64: dts: rockchip: enable HDMI RX audio capture on Orange Pi 5 Plus Igor Paunovic
2026-07-18  9:11   ` sashiko-bot
2026-07-18 11:04     ` Igor Paunovic
2026-07-18 23:31   ` Sebastian Reichel
2026-07-19  7:12     ` Igor Paunovic

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=1ac66aab-8985-4441-8ce1-07e2ea5183bd@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=royalnet026@gmail.com \
    --cc=sebastian.reichel@collabora.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