All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Richard Fitzgerald <rf@opensource.cirrus.com>,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	Vinod Koul <vkoul@kernel.org>,
	Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@opensource.cirrus.com
Subject: Re: [PATCH 0/2] soundwire: Suspend and resume asynchronously
Date: Mon, 30 Nov 2026 15:16:50 +0100	[thread overview]
Message-ID: <61ee2317-bbf0-42cd-a43c-b1374cb69c25@linux.dev> (raw)
In-Reply-To: <04ea4610-91ba-48ad-8b70-37d2fcc81df1@opensource.cirrus.com>


> 1. HEAD: arm and SYNCGO are not atomic across links (main concern)
> 
> • Where: intel_start_bus() arms at intel_bus_common.c:30 and issues
> SYNCGO at :41; intel_start_bus_after_reset() does the same at :108
> and :135. Arm and SYNCGO take shim_lock separately, and one SYNCGO
> clears the arm bit (CMDSYNC) for every link (intel.c:525).
> • Who is affected: with async links, intel_resume() starts every link
> concurrently on every resume. multi_link is on by default
> (intel_auxdevice.c:407-417), so this covers every Intel system with two
> or more links, on both cAVS and ACE2.x.
> • Bad ordering: link B arms, link A's SYNCGO clears B's arm, then B
> writes the CONFIG_UPDATE that applies its sdw_cdns_init() settings,
> which turn on multi-master (MMASTER) mode (cadence_master.c:1481),
> without being armed.
> • Unarmed CONFIG_UPDATEs are routine once a link is already in MMASTER
> mode: exit_reset (cadence_master.c:1182), clock stop (:1737) and clock
> restart (:1812).
> • The update that first enters MMASTER mode is the one the comment
> "follow recommended programming flows to avoid timeouts when gsync is
> enabled" protects.
> • The commit message says such an update is "applied right away", but
> its 50-cycle trace never produced this ordering.
> • If it fails: you get "cannot start bus during resume"
> (intel_auxdevice.c:754). The link is powered down and runtime PM stays
> disabled, because intel_suspend() disabled it (:653) and the re-enable
> at :765 is skipped. Every codec on that link then times out until the
> driver is rebound.
> • Runtime resume: the commit message notes runtime resume isn't
> serialized either. That's true, but it needs runtime resumes on two
> links to coincide. HEAD makes this concurrency happen on every system
> resume.
> • Suggested fix: hold a mutex shared by all links of the controller from
> arm to SYNCGO in both start_bus variants. Alternatives are to get Intel
> to confirm the hardware behaviour, or to drop HEAD; only the combined
> gain of both patches was measured.

Both models found the same problem, that's impressive.

I think it's enough to use shim_lock between sync_arm and the end of the
CONFIG_UPDATE. sync_go only happens on a 4kHz basis, no reason to wait
that long.


  reply	other threads:[~2026-11-30 14:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 15:00 [PATCH 0/2] soundwire: Suspend and resume asynchronously Paul Menzel
2026-11-27 15:00 ` [PATCH 1/2] soundwire: Suspend and resume managers and peripherals asynchronously Paul Menzel
2026-11-27 15:00 ` [PATCH 2/2] soundwire: intel: Suspend and resume the links asynchronously Paul Menzel
2026-11-28 11:21 ` [PATCH 0/2] soundwire: Suspend and resume asynchronously Pierre-Louis Bossart
2026-11-30 11:19 ` Richard Fitzgerald
2026-11-30 14:16   ` Pierre-Louis Bossart [this message]
2026-11-30 11:35 ` Richard Fitzgerald
2026-11-30 14:12   ` Pierre-Louis Bossart

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=61ee2317-bbf0-42cd-a43c-b1374cb69c25@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=rf@opensource.cirrus.com \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.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 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.