ASoC: Intel: catpt: Round of fixes and PM changes
Subsystems (3)
Cezary Rojewski
maintainercover ASoC: Intel: catpt: Round of fixes and PM changes
Set of changes addressing gaps in DRAM offset checks, error paths and PM.
The first two patches are straight-forward, the last four relate to the power management. The standing out PM change is removal of the catpt-driver as a system-suspend (S3) blocker. This is a suggestion from Andy as indeed, audio is not a critical component that should prevent the system from going into S3. Whatever happens, the driver can recover on a follow up resume (S3 -> S0).
Cezary Rojewski (6):
ASoC: Intel: catpt: Fix offset checks
ASoC: Intel: catpt: Fix error path in hw_params()
ASoC: Intel: catpt: Fix probing order of driver components
ASoC: Intel: catpt: Do not ignore errors on runtime resume
ASoC: Intel: catpt: Do not block the system from suspending
ASoC: Intel: catpt: Drop catpt_runtime_resume()
sound/soc/intel/catpt/device.c | 33 +++++++++++++++++++-------------- sound/soc/intel/catpt/loader.c | 8 ++++---- sound/soc/intel/catpt/pcm.c | 16 +++++++++------- sound/soc/intel/catpt/sysfs.c | 2 +- 4 files changed, 33 insertions(+), 26 deletions(-)
Signature · 1 line
2.25.1
Cezary Rojewski
maintainerPATCH 1/6 ASoC: Intel: catpt: Fix offset checks
Verify if the entire block is found within DRAM, not just the start of it.
--- sound/soc/intel/catpt/loader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/intel/catpt/loader.c +4 -4
@@ -216,7 +216,7 @@ static int catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan)continue ; off =catpt_to_host_offset (info->offset); -if (off < cdev->dram.start || off > cdev->dram.end) +if (off < cdev->dram.start || off + info->size >= cdev->dram.end)continue ; dev_dbg(cdev->dev, "restoring memdump: off 0x%08x size %d\n",
@@ -261,12 +261,12 @@ static int catpt_restore_fwimage(struct catpt_dev *cdev,continue ; off =catpt_to_host_offset (info->offset); -if (off < cdev->dram.start || off > cdev->dram.end) -continue ; - r2.start = off; r2.end = r2.start + info->size -1 ; +if (r2.start < cdev->dram.start || r2.end > cdev->dram.end) +continue ; +if (!resource_intersection (&r2, &r1, &common))continue ;/* calculate start offset of common data area */
Signature · 1 line
2.25.1
Re: [PATCH 1/6] ASoC: Intel: catpt: Fix offset checks
Quoted 2 lines · Cezary Rojewski
Verify if the entire block is found within DRAM, not just the start of it.
I would rewrap this to have less distant lengths.
E.g.,
Verify if the entire block is found within DRAM, not just the start of it.
Quoted 1 line
Signed-off-by Cezary Rojewski <[email protected]>
...
sound/soc/intel/catpt/loader.c static int catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan) · line 220
Quoted 6 lines
static int
catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan)sound/soc/intel/catpt/loader.c +1
-1off =catpt_to_host_offset (info->offset); -if (off < cdev->dram.start || off > cdev->dram.end) +if (off < cdev->dram.start || off + info->size >= cdev->dram.end)continue ;
Hmm... I would rather do something like
struct resource r; ... resource_set_range(catpt_to_host_offset(info->offset), info->size); if (!resource_contains()) continue;
Quoted 1 line
dev_dbg(cdev->dev, "restoring memdump: off 0x%08x size %d\n",
OTOH it seems more invasive change for kinda a fix.
...
sound/soc/intel/catpt/loader.c static int catpt_restore_fwimage(struct catpt_dev *cdev, · line 268
Quoted 11 lines
static int catpt_restore_fwimage(struct
catpt_dev*cdev,sound/soc/intel/catpt/loader.c +2
-3off =catpt_to_host_offset (info->offset); -if (off < cdev->dram.start || off > cdev->dram.end) -continue ; - r2.start = off; r2.end = r2.start + info->size -1 ; +if (r2.start < cdev->dram.start || r2.end > cdev->dram.end) +continue ;
See above, but here we already good for use the respective resource_*() API.
Quoted 2 lines
sound/soc/intel/catpt/loader.c +0
-0if (!resource_intersection (&r2, &r1, &common))continue ;
Signature · 2 lines
With Best Regards, Andy Shevchenko
Cezary Rojewski
maintainerRe: [PATCH 1/6] ASoC: Intel: catpt: Fix offset checks
Quoted 11 lines · Andy Shevchenko
Quoted 2 lines · Cezary Rojewski
Verify if the entire block is found within DRAM, not just the start of it.
I would rewrap this to have less distant lengths.
E.g.,
Verify if the entire block is found within DRAM, not just the start of it.
Sure, will do. Typically I just do 72-chars per line and whatever happens, happens.
Quoted 19 lines
Quoted 1 line
Signed-off-by Cezary Rojewski <[email protected]>...
sound/soc/intel/catpt/loader.c static int catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan) · line 220
Quoted 6 lines
static int
catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan)off = catpt_to_host_offset(info->offset);sound/soc/intel/catpt/loader.c +1
-1-if (off < cdev->dram.start || off > cdev->dram.end) +if (off < cdev->dram.start || off + info->size >= cdev->dram.end)continue ;Hmm... I would rather do something like
struct resource r; ... resource_set_range(catpt_to_host_offset(info->offset), info->size); if (!resource_contains()) continue;
Quoted 3 lines
Quoted 1 line
dev_dbg(cdev->dev, "restoring memdump: off 0x%08x size %d\n",
OTOH it seems more invasive change for kinda a fix.
Looks elegant though. My idea was to avoid additional operations (which resource_contains() does), perhaps unnecessarily as readability suffered because of that. Ack.
Quoted 20 lines
...
sound/soc/intel/catpt/loader.c static int catpt_restore_fwimage(struct catpt_dev *cdev, · line 268
Quoted 11 lines
static int catpt_restore_fwimage(struct
catpt_dev*cdev,off = catpt_to_host_offset(info->offset);sound/soc/intel/catpt/loader.c +2
-3-if (off < cdev->dram.start || off > cdev->dram.end) -continue ; - r2.start = off; r2.end = r2.start + info->size -1 ; +if (r2.start < cdev->dram.start || r2.end > cdev->dram.end) +continue ;See above, but here we already good for use the respective resource_*() API.
Quoted 2 lines
if (!resource_intersection(&r2, &r1, &common))
continue;
Re: [PATCH 1/6] ASoC: Intel: catpt: Fix offset checks
Quoted 7 lines · Cezary Rojewski
Quoted 6 lines · Andy Shevchenko
Quoted 2 lines · Cezary Rojewski
Verify if the entire block is found within DRAM, not just the start of it.
I would rewrap this to have less distant lengths.
Quoted 7 lines
Quoted 4 lines
E.g.,
Verify if the entire block is found within DRAM, not just the start of it.
Sure, will do. Typically I just do 72-chars per line and whatever happens, happens.
Understand, but here is a corner case, I usually rewrap a bit when it's line out of only a couple of characters.
...
Quoted 15 lines
Quoted 15 lines
sound/soc/intel/catpt/loader.c static int catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan) · line 220
Quoted 6 lines
static int
catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan)off = catpt_to_host_offset(info->offset);sound/soc/intel/catpt/loader.c +1
-1-if (off < cdev->dram.start || off > cdev->dram.end) +if (off < cdev->dram.start || off + info->size >= cdev->dram.end)continue ;Hmm... I would rather do something like
struct resource r; ... resource_set_range(catpt_to_host_offset(info->offset), info->size); if (!resource_contains()) continue;
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
dev_dbg(cdev->dev, "restoring memdump: off 0x%08x size %d\n",
OTOH it seems more invasive change for kinda a fix.
Looks elegant though. My idea was to avoid additional operations (which
resource_contains()does), perhaps unnecessarily as readability suffered because of that. Ack.
Note, it's defined as static inline, if compiler can prove constiness of something, it will eliminate the code. TL;DR: let compiler to do its job.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 1/6] ASoC: Intel: catpt: Fix offset checks
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Cezary Rojewski
Quoted 1 line · Andy Shevchenko
On Fri, Nov 21, 2025 at 12:43:26PM +0100, Cezary Rojewski wrote:
...
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
sound/soc/intel/catpt/loader.c static int catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan) · line 220
Quoted 6 lines
static int
catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan)off = catpt_to_host_offset(info->offset);sound/soc/intel/catpt/loader.c +1
-1-if (off < cdev->dram.start || off > cdev->dram.end) +if (off < cdev->dram.start || off + info->size >= cdev->dram.end)continue ;Hmm... I would rather do something like
struct resource r;
You might need to nullify this as well:
struct resource r = {}; // or any equivalent
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
... resource_set_range(catpt_to_host_offset(info->offset), info->size); if (!resource_contains()) continue;Quoted 7 lines
Quoted 3 lines
Quoted 1 line
dev_dbg(cdev->dev, "restoring memdump: off 0x%08x size %d\n",
OTOH it seems more invasive change for kinda a fix.
Looks elegant though. My idea was to avoid additional operations (which
resource_contains()does), perhaps unnecessarily as readability suffered because of that. Ack.Note, it's defined as static inline, if compiler can prove constiness of something, it will eliminate the code. TL;DR: let compiler to do its job.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Cezary Rojewski
maintainerRe: [PATCH 1/6] ASoC: Intel: catpt: Fix offset checks
Quoted 16 lines · Andy Shevchenko
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Cezary Rojewski
Quoted 1 line · Andy Shevchenko
On Fri, Nov 21, 2025 at 12:43:26PM +0100, Cezary Rojewski wrote:
...
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
sound/soc/intel/catpt/loader.c static int catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan) · line 220
Quoted 6 lines
static int
catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan)off = catpt_to_host_offset(info->offset);sound/soc/intel/catpt/loader.c +1
-1-if (off < cdev->dram.start || off > cdev->dram.end) +if (off < cdev->dram.start || off + info->size >= cdev->dram.end)continue ;Hmm... I would rather do something like
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
struct resource r;You might need to nullify this as well:
struct resource r = {}; // or any equivalent
This made me realize variables 'r1', 'r2' and 'common' that are part of catpt_restore_fwimage() are not zeroed and utilizing resource_xxx() API without doing so is bogus. My plan is to the following: leave this very fix as-is (without refactoring) and follow it up immediately with patch that swaps manual manipulation with resource_xxx(), as you suggested.
Sounds good?
Quoted 16 lines
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
... resource_set_range(catpt_to_host_offset(info->offset), info->size); if (!resource_contains()) continue;Quoted 7 lines
Quoted 3 lines
Quoted 1 line
dev_dbg(cdev->dev, "restoring memdump: off 0x%08x size %d\n",OTOH it seems more invasive change for kinda a fix.
Looks elegant though. My idea was to avoid additional operations (which
resource_contains()does), perhaps unnecessarily as readability suffered because of that. Ack.Note, it's defined as static inline, if compiler can prove constiness of something, it will eliminate the code. TL;DR: let compiler to do its job.
Re: [PATCH 1/6] ASoC: Intel: catpt: Fix offset checks
Quoted 5 lines · Cezary Rojewski
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Cezary Rojewski
Quoted 1 line · Andy Shevchenko
On Fri, Nov 21, 2025 at 12:43:26PM +0100, Cezary Rojewski wrote:
...
Quoted 15 lines
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
sound/soc/intel/catpt/loader.c static int catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan) · line 220
Quoted 6 lines
static int
catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan)off = catpt_to_host_offset(info->offset);sound/soc/intel/catpt/loader.c +1
-1-if (off < cdev->dram.start || off > cdev->dram.end) +if (off < cdev->dram.start || off + info->size >= cdev->dram.end)continue ;Hmm... I would rather do something like
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
struct resource r;You might need to nullify this as well:
struct resource r = {}; // or any equivalent
Quoted 7 lines
This made me realize variables 'r1', 'r2' and 'common' that are part of
catpt_restore_fwimage()are not zeroed and utilizingresource_xxx()API without doing so is bogus. My plan is to the following: leave this very fix as-is (without refactoring) and follow it up immediately with patch that swaps manual manipulation withresource_xxx(), as you suggested.Sounds good?
Yep! Thanks.
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
... resource_set_range(catpt_to_host_offset(info->offset), info->size); if (!resource_contains()) continue;Quoted 7 lines
Quoted 3 lines
Quoted 1 line
dev_dbg(cdev->dev, "restoring memdump: off 0x%08x size %d\n",OTOH it seems more invasive change for kinda a fix.
Looks elegant though. My idea was to avoid additional operations (which
resource_contains()does), perhaps unnecessarily as readability suffered because of that. Ack.Note, it's defined as static inline, if compiler can prove constiness of something, it will eliminate the code. TL;DR: let compiler to do its job.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 1/6] ASoC: Intel: catpt: Fix offset checks
Quoted 6 lines · Andy Shevchenko
Quoted 5 lines · Cezary Rojewski
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Cezary Rojewski
Quoted 1 line · Andy Shevchenko
On Fri, Nov 21, 2025 at 12:43:26PM +0100, Cezary Rojewski wrote:
...
Quoted 21 lines
Quoted 21 lines
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Review
Quoted 6 lines
static int
catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan)off = catpt_to_host_offset(info->offset);(quoted diff) +1
-1- if (off < cdev->dram.start || off > cdev->dram.end) + if (off < cdev->dram.start || off + info->size >= cdev->dram.end) continue;Hmm... I would rather do something like
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
struct resource r;You might need to nullify this as well:
struct resource r = {}; // or any equivalent
This made me realize variables 'r1', 'r2' and 'common' that are part of
catpt_restore_fwimage()are not zeroed and utilizingresource_xxx()API without doing so is bogus. My plan is to the following: leave this very fix as-is (without refactoring) and follow it up immediately with patch that swaps manual manipulation withresource_xxx(), as you suggested.
Quoted 3 lines
Quoted 1 line
Sounds good?
Yep! Thanks.
Just to add, you may also consider using the form
r = DEFINE_RES_*(...);
which effectively will nullify untouched fields.
So, either it or {} or memset() whichever fits
better.
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
... resource_set_range(catpt_to_host_offset(info->offset), info->size); if (!resource_contains()) continue;Quoted 7 lines
Quoted 3 lines
Quoted 1 line
dev_dbg(cdev->dev, "restoring memdump: off 0x%08x size %d\n",OTOH it seems more invasive change for kinda a fix.
Looks elegant though. My idea was to avoid additional operations (which
resource_contains()does), perhaps unnecessarily as readability suffered because of that. Ack.Note, it's defined as static inline, if compiler can prove constiness of something, it will eliminate the code. TL;DR: let compiler to do its job.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Cezary Rojewski
maintainerPATCH 2/6 ASoC: Intel: catpt: Fix error path in hw_params()
In reply to Cezary RojewskiDo not leave any resources hanging on the DSP side if applying user settings fails.
--- sound/soc/intel/catpt/pcm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/intel/catpt/pcm.c +3 -1
@@ -417,8 +417,10 @@ static int catpt_dai_hw_params(struct snd_pcm_substream *substream,return CATPT_IPC_ERROR (ret); ret =catpt_dai_apply_usettings (dai, stream); -if (ret) +if (ret) { +catpt_ipc_free_stream (cdev, stream->info.stream_hw_id);return ret; + } stream->allocated = true;return 0 ;
Signature · 1 line
2.25.1
Cezary Rojewski
maintainerPATCH 3/6 ASoC: Intel: catpt: Fix probing order of driver components
In reply to Cezary Rojewskicatpt_dai_pcm_new() is called during the bring up sequence of the machine board device. That device is a child of the ACPI device the catpt-driver attaches to. The function manipulates pm_runtime_xxx() to ensure its parent is woken up before sending IPCs. If the parent's pm_runtime is not configured before that happens, errors will occur.
--- sound/soc/intel/catpt/device.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
sound/soc/intel/catpt/device.c +9 -6
@@ -184,22 +184,25 @@ static int catpt_probe_components(struct catpt_dev *cdev) goto err_boot_fw; } - ret =catpt_register_board (cdev); -if (ret) { -dev_err (cdev->dev,"register board failed: %d\n" , ret); - goto err_reg_board; - } -/* reflect actual ADSP state in pm_runtime */ pm_runtime_set_active (cdev->dev);pm_runtime_set_autosuspend_delay (cdev->dev,2000 );pm_runtime_use_autosuspend (cdev->dev);pm_runtime_mark_last_busy (cdev->dev); +/* Enable PM before spawning child device. See catpt_dai_pcm_new(). */ pm_runtime_enable (cdev->dev); + + ret =catpt_register_board (cdev); +if (ret) { +dev_err (cdev->dev,"register board failed: %d\n" , ret); + goto err_reg_board; + } +return 0 ; err_reg_board: +pm_runtime_disable (cdev->dev);snd_soc_unregister_component (cdev->dev); err_boot_fw:catpt_dmac_remove (cdev);
Signature · 1 line
2.25.1
Cezary Rojewski
maintainerPATCH 4/6 ASoC: Intel: catpt: Do not ignore errors on runtime resume
In reply to Cezary RojewskiIf pm_runtime_resume_and_get() fails, follow up pm_runtime_xxx() operate on device in erroneous state.
--- sound/soc/intel/catpt/pcm.c | 12 ++++++------ sound/soc/intel/catpt/sysfs.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-)
sound/soc/intel/catpt/pcm.c +6 -6
@@ -671,7 +671,7 @@ static int catpt_dai_pcm_new(struct snd_soc_pcm_runtime *rtm,return 0 ; ret =pm_runtime_resume_and_get (cdev->dev); -if (ret <0 && ret != -EACCES ) +if (ret)return ret; ret =catpt_ipc_set_device_format (cdev, &devfmt);
@@ -874,7 +874,7 @@ static int catpt_mixer_volume_get(struct snd_kcontrol *kcontrol,int i; ret =pm_runtime_resume_and_get (cdev->dev); -if (ret <0 && ret != -EACCES ) +if (ret)return ret;for (i =0 ; i <CATPT_CHANNELS_MAX ; i++) {
@@ -895,7 +895,7 @@ static int catpt_mixer_volume_put(struct snd_kcontrol *kcontrol,int ret; ret =pm_runtime_resume_and_get (cdev->dev); -if (ret <0 && ret != -EACCES ) +if (ret)return ret; ret = catpt_set_dspvol(cdev, cdev->mixer.mixer_hw_id,
@@ -926,7 +926,7 @@ static int catpt_stream_volume_get(struct snd_kcontrol *kcontrol, } ret =pm_runtime_resume_and_get (cdev->dev); -if (ret <0 && ret != -EACCES ) +if (ret)return ret;for (i =0 ; i <CATPT_CHANNELS_MAX ; i++) {
@@ -957,7 +957,7 @@ static int catpt_stream_volume_put(struct snd_kcontrol *kcontrol, } ret =pm_runtime_resume_and_get (cdev->dev); -if (ret <0 && ret != -EACCES ) +if (ret)return ret; ret = catpt_set_dspvol(cdev, stream->info.stream_hw_id,
@@ -1033,7 +1033,7 @@ static int catpt_loopback_switch_put(struct snd_kcontrol *kcontrol, } ret =pm_runtime_resume_and_get (cdev->dev); -if (ret <0 && ret != -EACCES ) +if (ret)return ret; ret =catpt_ipc_mute_loopback (cdev, stream->info.stream_hw_id, mute);
sound/soc/intel/catpt/sysfs.c +1 -1
@@ -16,7 +16,7 @@ static ssize_t fw_version_show(struct device *dev,int ret; ret =pm_runtime_resume_and_get (cdev->dev); -if (ret <0 && ret != -EACCES ) +if (ret)return ret; ret =catpt_ipc_get_fw_version (cdev, &version);
Signature · 1 line
2.25.1
Cezary Rojewski
maintainerPATCH 5/6 ASoC: Intel: catpt: Do not block the system from suspending
In reply to Cezary RojewskiEven if something goes wrong when performing suspend on DSP, from the system perspective the component is not critical enough to block the suspend operation entirely. Leaving recovery to next resume() suffices.
--- sound/soc/intel/catpt/device.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
sound/soc/intel/catpt/device.c +9 -2
@@ -28,7 +28,7 @@#define CREATE_TRACE_POINTS #include "trace.h" -static int catpt_suspend (struct device *dev) +static int __catpt_suspend (struct device *dev) {struct catpt_dev *cdev =dev_get_drvdata (dev);struct dma_chan *chan;
@@ -106,6 +106,13 @@ static int catpt_resume(struct device *dev)return 0 ; } +/* Do not block the system from suspending, recover on resume() if needed. */ +static int catpt_suspend (struct device *dev) +{ +__catpt_suspend (dev); +return 0 ; +} +static int catpt_runtime_suspend (struct device *dev) {if (!try_module_get (dev->driver->owner)) {
@@ -114,7 +121,7 @@ static int catpt_runtime_suspend(struct device *dev) }module_put (dev->driver->owner); -return catpt_suspend (dev); +return __catpt_suspend (dev); }static int catpt_runtime_resume (struct device *dev)
Signature · 1 line
2.25.1
Re: [PATCH 5/6] ASoC: Intel: catpt: Do not block the system from suspending
Quoted 3 lines · Cezary Rojewski
Even if something goes wrong when performing suspend on DSP, from the system perspective the component is not critical enough to block the suspend operation entirely. Leaving recovery to next
resume()suffices.
...
sound/soc/intel/catpt/device.c static int catpt_resume(struct device *dev) · line 112
Quoted 4 lines
sound/soc/intel/catpt/device.c +4
-0+/* Do not block the system from suspending, recover on resume() if needed. */ +static int catpt_suspend (struct device *dev) +{ +__catpt_suspend (dev);
Can we use catpt_do_suspend() name? Or something with a better suffix?
Wouldn't be useful to have some debug message to be printed in case of failure?
ret = catpt_do_suspend(dev); if (ret) dev_dbg(dev, ..., ret);
?
Quoted 2 lines
sound/soc/intel/catpt/device.c +2
-0+return 0 ; +}
Signature · 2 lines
With Best Regards, Andy Shevchenko
Cezary Rojewski
maintainerRe: [PATCH 5/6] ASoC: Intel: catpt: Do not block the system from suspending
Quoted 16 lines · Andy Shevchenko
Quoted 3 lines · Cezary Rojewski
Even if something goes wrong when performing suspend on DSP, from the system perspective the component is not critical enough to block the suspend operation entirely. Leaving recovery to next
resume()suffices.Acked-by Andy Shevchenko <[email protected]>...
sound/soc/intel/catpt/device.c static int catpt_resume(struct device *dev) · line 112
Quoted 4 lines
sound/soc/intel/catpt/device.c +4
-0+/* Do not block the system from suspending, recover on resume() if needed. */ +static int catpt_suspend (struct device *dev) +{ +__catpt_suspend (dev);Can we use
catpt_do_suspend()name? Or something with a better suffix?
Quoted 8 lines
Wouldn't be useful to have some debug message to be printed in case of failure?
ret = catpt_do_suspend(dev); if (ret) dev_dbg(dev, ..., ret);?
No problem renaming the function in v2. As for the debug print, __catpt_suspend/catpt_do_suspend() would dump enough information already. If I get failure from powering up DRAM/IRAM banks or an IPC failure, additional "failed" message on top won't add anything useful.
Quoted 3 lines
Quoted 2 lines
sound/soc/intel/catpt/device.c +2
-0+return 0 ; +}
Re: [PATCH 5/6] ASoC: Intel: catpt: Do not block the system from suspending
Quoted 2 lines · Cezary Rojewski
Quoted 1 line · Andy Shevchenko
On Fri, Nov 21, 2025 at 12:43:30PM +0100, Cezary Rojewski wrote:
...
Quoted 13 lines
Quoted 13 lines
sound/soc/intel/catpt/device.c static int catpt_resume(struct device *dev) · line 112
Quoted 4 lines
sound/soc/intel/catpt/device.c +4
-0+/* Do not block the system from suspending, recover on resume() if needed. */ +static int catpt_suspend (struct device *dev) +{ +__catpt_suspend (dev);Can we use
catpt_do_suspend()name? Or something with a better suffix?Wouldn't be useful to have some debug message to be printed in case of failure?
ret = catpt_do_suspend(dev); if (ret) dev_dbg(dev, ..., ret);
Quoted 6 lines
Quoted 1 line
?
No problem renaming the function in v2. As for the debug print, __catpt_suspend/catpt_do_suspend() would dump enough information already. If I get failure from powering up DRAM/IRAM banks or an IPC failure, additional "failed" message on top won't add anything useful.
Okay, then no need to add a noise, indeed.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
sound/soc/intel/catpt/device.c +2
-0+return 0 ; +}
Signature · 2 lines
With Best Regards, Andy Shevchenko
Cezary Rojewski
maintainerPATCH 6/6 ASoC: Intel: catpt: Drop catpt_runtime_resume()
In reply to Cezary RojewskiThe function provides no value over catpt_resume(), use the latter directly.
--- sound/soc/intel/catpt/device.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
sound/soc/intel/catpt/device.c +1 -6
@@ -124,14 +124,9 @@ static int catpt_runtime_suspend(struct device *dev)return __catpt_suspend (dev); } -static int catpt_runtime_resume (struct device *dev) -{ -return catpt_resume (dev); -} -static const struct dev_pm_ops catpt_dev_pm = { SYSTEM_SLEEP_PM_OPS(catpt_suspend, catpt_resume) -RUNTIME_PM_OPS (catpt_runtime_suspend, catpt_runtime_resume,NULL ) +RUNTIME_PM_OPS (catpt_runtime_suspend, catpt_resume,NULL ) };/* machine board owned by CATPT is removed with this hook */
Signature · 1 line
2.25.1
Re: [PATCH 6/6] ASoC: Intel: catpt: Drop catpt_runtime_resume()
Quoted 2 lines · Cezary Rojewski
The function provides no value over
catpt_resume(), use the latter directly.
This makes code understanding a bit harder in my opinion. I would not apply this patch.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Cezary Rojewski
maintainerRe: [PATCH 6/6] ASoC: Intel: catpt: Drop catpt_runtime_resume()
Quoted 7 lines · Andy Shevchenko
Quoted 2 lines · Cezary Rojewski
The function provides no value over
catpt_resume(), use the latter directly.This makes code understanding a bit harder in my opinion. I would not apply this patch.
Ack, will remove in v2.