Re: [PATCH] ASoC: soc-core: Create device_link to ensure correct suspend order
From: Richard Fitzgerald
Date: Tue Jun 02 2026 - 10:00:06 EST
On 02/06/2026 2:46 pm, Mark Brown wrote:
On Tue, Jun 02, 2026 at 02:34:53PM +0100, Richard Fitzgerald wrote:
On 02/06/2026 2:31 pm, Mark Brown wrote:
Do we still have devices registering separate components with the same
device for DMA and DAI operations? They'd end up duplicating the links
here.
Ok, weird, but I agree it's possible for one driver to register multiple
components. I'll make a V2 that skips the device link if the component
dev is the same as the card dev.
That wouldn't avoid the issue I think? The card is a separate device,
but the DMA and DAI are two devices registered separately. This used to
be because we had completely separate driver types for DMA and DAI,
prior to the component refactoring. A simple move to component would
keep two separate components, this could be refactored into a single
component but that'd need to actually happen and I'm not sure we did
that for everything. I was wondering if you'd checked already, sounds
like no?
Oh, you mean two components with the same dev, so that the
device_link_add() gets called for the same (card,component) devices
multiple times?
I tested multiple calls for the same device pair, and it's ok.
This also covers the case where ASoC core now creates this device_link
and the codec driver also creates the same device_link between the
card and itself (hdac_hdmi does this).
From the kernel doc for device_link_add():
"if a device link between the given @consumer and @supplier pair
exists already when this function is called for them, the existing link
will be returned"