Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	broonie@kernel.org, yung-chuan.liao@linux.intel.com,
	lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com,
	shumingf@realtek.com, linux-sound@vger.kernel.org,
	patches@opensource.cirrus.com
Subject: Re: [PATCH 5/7] ASoC: SDCA: Add basic system suspend support
Date: Thu, 11 Dec 2025 11:28:43 +0000	[thread overview]
Message-ID: <aTqq68epKmoJs3ip@opensource.cirrus.com> (raw)
In-Reply-To: <aTqd3omCzmFuTJ7l@vaman>

On Thu, Dec 11, 2025 at 04:03:02PM +0530, Vinod Koul wrote:
> On 10-12-25, 14:43, Charles Keepax wrote:
> > On Tue, Dec 09, 2025 at 12:11:27PM +0000, Pierre-Louis Bossart wrote:
> > > On 11/25/25 15:21, Charles Keepax wrote:
> > This is definitely up for debate, my primary issue with allowing
> > firmware download at the runtime level is that SDCA gives you no
> > way to tell that the device is ready to rock. The only way I have
> > been able to divine to do this is to wait for an FDL irq and if
> > one doesn't come within a reasonable time out move on. However,
> > that waiting would add a considerable delay to runtime resume
> > even if no firmware was downloaded, which feels problematic.
> 
> What is the typical time to have firmware downloaded and get the irq?

There isn't really an answer to that, it will vary alot based on
the host, the firmware size, the device itself. The timeout we
use to wait for the FDL IRQ in the kernel is currently 100mS, but
that isn't determined by the specification so may need extended
when new hardware arrives. For our device on a MTL UPX, with the
current firmware, and that 100mS timeout, it takes just over 300mS
to complete FDL.

> > 1) Do we really want to support downloading firmware on runtime
> >    suspend? I am doubtful it is really usable due to latency.
> 
> I feel there is no way around. We cant do this async

Obviously agree, if we need to download firmware we have to,
but I think you misunderstand my point. Currently, we don't
have anything that requires this, so why not add support when
we do? I think there is a reasonable chance no one will use the
feature and even if I did add support now, it won't be tested.
Furthermore, there is nothing in the current code that prevents
adding support for this in the future.

> Best is to speed up loading by having firmware cached in the kernel so
> userspace delays can be avoided (unless ofcourse it is humongous size)
> If device needs firmware, we have to download, dont see a choice here

Caching the firmware makes very minimal difference (on my system
pull firmware from user-space takes less than 1% of the time),
the majority of the time is a) spend pumping data through the bus,
b) waiting to ensure are no new FDL IRQs.

> > 2) If we do, do you have any ideas about how to determine if the
> >    device needs firmware?
> 
> Driver should know and first thing in resume, download the firmware,
> maybe a flag in device properties?

Yeah I think that would be about my best guess at how we would
could reduce the impact of this change. We could add a quirk to
say skip runtime download for this device/system. That would mean
new hardware would work albeit a bit sluggishly and established
systems/devices could quirk for a reasonable user-experience. But
I can't say I love that as a solution.

Thanks,
Charles

  reply	other threads:[~2025-12-11 11:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 15:21 [PATCH 0/7] SDCA jack and system suspend fixups Charles Keepax
2025-11-25 15:21 ` [PATCH 1/7] ASoC: SDCA: Factor out jack handling into new c file Charles Keepax
2025-12-09 12:00   ` Pierre-Louis Bossart
2025-12-10 16:31     ` Charles Keepax
2025-12-20 11:22       ` Pierre-Louis Bossart
2025-11-25 15:21 ` [PATCH 2/7] ASoC: SDCA: Add ability to connect SDCA jacks to ASoC jacks Charles Keepax
2025-11-25 15:21 ` [PATCH 3/7] ASoC: SDCA: Add ASoC jack hookup in class driver Charles Keepax
2025-11-25 15:21 ` [PATCH 4/7] ASoC: SDCA: Add SDCA IRQ enable/disable helpers Charles Keepax
2025-12-09 12:03   ` Pierre-Louis Bossart
2025-11-25 15:21 ` [PATCH 5/7] ASoC: SDCA: Add basic system suspend support Charles Keepax
2025-12-09 12:11   ` Pierre-Louis Bossart
2025-12-10 14:43     ` Charles Keepax
2025-12-10 16:48       ` Charles Keepax
2025-12-11 10:33       ` Vinod Koul
2025-12-11 11:28         ` Charles Keepax [this message]
2025-12-20 11:31       ` Pierre-Louis Bossart
2025-11-25 15:21 ` [PATCH 6/7] ASoC: SDCA: Device boot into the system suspend process Charles Keepax
2025-12-09 12:18   ` Pierre-Louis Bossart
2025-12-11 11:59     ` Charles Keepax
2025-12-20 11:36       ` Pierre-Louis Bossart
2025-11-25 15:21 ` [PATCH 7/7] ASoC: SDCA: Add lock to serialise the Function initialisation Charles Keepax
2025-12-09 12:20   ` Pierre-Louis Bossart
2025-12-10 15:27     ` Charles Keepax
2025-12-11 10:26       ` Richard Fitzgerald
2025-12-20 11:21         ` 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=aTqq68epKmoJs3ip@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=shumingf@realtek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox