Skip to contentSkip to conversation

ASoC: fsl_sai: Improve error handling

PATCH In review [email protected] 3 participants 6 messages Nov 10 – Nov 17

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ASoC: fsl_sai: Improve error handling

From: bui duc phuc <[email protected]>

Hi all,

This series includes two follow-up changes for the FSL SAI driver, covering hardware reset handling and dataline configuration error reporting.

Complie-tested only.

Best regards,
Phuc

bui duc phuc (2):
ASoC: fsl_sai: Make fsl_sai_reset_hw() return void
ASoC: fsl_sai: Report dataline configuration read errors

 sound/soc/fsl/fsl_sai.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 ASoC: fsl_sai: Make fsl_sai_reset_hw() return void

From: bui duc phuc <[email protected]>

fsl_sai_reset_hw() has a single caller, which does not need to handle its return value. The function already reports register write failures through dev_err().

Change the return type to void and continue clearing RCSR even if clearing TCSR fails.

---
 sound/soc/fsl/fsl_sai.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
sound/soc/fsl/fsl_sai.c +3 -9
index 430e896d064e..59c9b8c28133 100644
@@ -1410,7 +1410,7 @@ static int fsl_sai_check_version(struct device *dev)
 	return 0;
 }
 
-static int fsl_sai_reset_hw(struct device *dev)
+static void fsl_sai_reset_hw(struct device *dev)
 {
 	struct fsl_sai *sai = dev_get_drvdata(dev);
 	unsigned char ofs = sai->soc_data->reg_offset;
@@ -1421,18 +1421,12 @@ static int fsl_sai_reset_hw(struct device *dev)
 	 * Bootloader may leave SAI running causing interrupt storm.
 	 */
 	ret = regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), 0);
-	if (ret) {
+	if (ret)
 		dev_err(dev, "Failed to clear TCSR: %d\n", ret);
-		return ret;
-	}
 
 	ret = regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), 0);
-	if (ret) {
+	if (ret)
 		dev_err(dev, "Failed to clear RCSR: %d\n", ret);
-		return ret;
-	}
-
-	return 0;
 }
 
 /*
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] ASoC: fsl_sai: Make fsl_sai_reset_hw() return void

Quoted 11 lines · On Tue, Nov 10, 2026 at 3:59 PM <[email protected]> wrote:

From: bui duc phuc <[email protected]>

fsl_sai_reset_hw() has a single caller, which does not need to handle its return value. The function already reports register write failures through dev_err().

Change the return type to void and continue clearing RCSR even if clearing TCSR fails.

best regards
shengjiu Wang

Quoted 41 lines
---
 sound/soc/fsl/fsl_sai.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
sound/soc/fsl/fsl_sai.c +3 -10
index 430e896d064e..59c9b8c28133 100644
@@ -1410,7 +1410,7 @@ static int fsl_sai_check_version(struct device *dev)
        return 0;
 }
 
-static int fsl_sai_reset_hw(struct device *dev)
+static void fsl_sai_reset_hw(struct device *dev)
 {
        struct fsl_sai *sai = dev_get_drvdata(dev);
        unsigned char ofs = sai->soc_data->reg_offset;
@@ -1421,18 +1421,12 @@ static int fsl_sai_reset_hw(struct device *dev)
         * Bootloader may leave SAI running causing interrupt storm.
         */
        ret = regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), 0);
-       if (ret) {
+       if (ret)
                dev_err(dev, "Failed to clear TCSR: %d\n", ret);
-               return ret;
-       }
 
        ret = regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), 0);
-       if (ret) {
+       if (ret)
                dev_err(dev, "Failed to clear RCSR: %d\n", ret);
-               return ret;
-       }
-
-       return 0;
 }
 
 /*
--

2.43.0

#3 lore raw

PATCH 2/2 ASoC: fsl_sai: Report dataline configuration read errors

In reply to [email protected]

From: bui duc phuc <[email protected]>

fsl_sai_read_dlcfg() returns errors from of_property_read_u32_index() without reporting them.

Add a dev_err() call in fsl_sai_probe() to report failures returned by fsl_sai_read_dlcfg().

---
 sound/soc/fsl/fsl_sai.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/fsl/fsl_sai.c +3 -1
index 59c9b8c28133..16197f9ac2d8 100644
@@ -1621,8 +1621,10 @@ static int fsl_sai_probe(struct platform_device *pdev)
 
 	/* read dataline mask for rx and tx*/
 	ret = fsl_sai_read_dlcfg(sai);
-	if (ret < 0)
+	if (ret < 0) {
+		dev_err(dev, "failed to read dlcfg %d\n", ret);
 		return ret;
+	}
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] ASoC: fsl_sai: Report dataline configuration read errors

Quoted 10 lines · On Tue, Nov 10, 2026 at 3:59 PM <[email protected]> wrote:

From: bui duc phuc <[email protected]>

fsl_sai_read_dlcfg() returns errors from of_property_read_u32_index() without reporting them.

Add a dev_err() call in fsl_sai_probe() to report failures returned by fsl_sai_read_dlcfg().

Best regards
Shengjiu Wang

Quoted 23 lines
---
 sound/soc/fsl/fsl_sai.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/fsl/fsl_sai.c +3 -2
index 59c9b8c28133..16197f9ac2d8 100644
@@ -1621,8 +1621,10 @@ static int fsl_sai_probe(struct platform_device *pdev)
 
        /* read dataline mask for rx and tx*/
        ret = fsl_sai_read_dlcfg(sai);
-       if (ret < 0)
+       if (ret < 0) {
+               dev_err(dev, "failed to read dlcfg %d\n", ret);
                return ret;
+       }
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
--

2.43.0

maintainer
#5 lore raw
In reply to [email protected]
Quoted 11 lines · On Tue, 10 Nov 2026 14:58:39 +0700, [email protected] wrote:

ASoC: fsl_sai: Improve error handling

From: bui duc phuc <[email protected]>

Hi all,

This series includes two follow-up changes for the FSL SAI driver, covering hardware reset handling and dataline configuration error reporting.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5

Thanks!

[1/2] ASoC: fsl_sai: Make fsl_sai_reset_hw() return void

      https://git.kernel.org/broonie/sound/c/7192f1a8cb6d
[2/2] ASoC: fsl_sai: Report dataline configuration read errors
      https://git.kernel.org/broonie/sound/c/6616554f4166

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark