2023-02-07 09:30:13

by Shengjiu Wang

[permalink] [raw]
Subject: [PATCH] ASoC: fsl_sai: fix getting version from VERID

The version information is at the bit31 ~ bit16 in the VERID
register, so need to right shift 16bit to get it, otherwise
the result of comparison "sai->verid.version >= 0x0301" is
wrong.

Fixes: 99c1e74f25d4 ("ASoC: fsl_sai: store full version instead of major/minor")
Signed-off-by: Shengjiu Wang <[email protected]>
---
sound/soc/fsl/fsl_sai.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index c365afd6c4ea..1b197478b3d9 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -1142,6 +1142,7 @@ static int fsl_sai_check_version(struct device *dev)

sai->verid.version = val &
(FSL_SAI_VERID_MAJOR_MASK | FSL_SAI_VERID_MINOR_MASK);
+ sai->verid.version >>= FSL_SAI_VERID_MINOR_SHIFT;
sai->verid.feature = val & FSL_SAI_VERID_FEATURE_MASK;

ret = regmap_read(sai->regmap, FSL_SAI_PARAM, &val);
--
2.34.1



2023-02-07 11:16:29

by Fabio Estevam

[permalink] [raw]
Subject: Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID

On Tue, Feb 7, 2023 at 6:30 AM Shengjiu Wang <[email protected]> wrote:
>
> The version information is at the bit31 ~ bit16 in the VERID
> register, so need to right shift 16bit to get it, otherwise
> the result of comparison "sai->verid.version >= 0x0301" is
> wrong.
>
> Fixes: 99c1e74f25d4 ("ASoC: fsl_sai: store full version instead of major/minor")
> Signed-off-by: Shengjiu Wang <[email protected]>

Reviewed-by: Fabio Estevam <[email protected]>

2023-02-07 11:22:11

by Iuliana Prodan

[permalink] [raw]
Subject: Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID

On 2/7/2023 11:04 AM, Shengjiu Wang wrote:
> The version information is at the bit31 ~ bit16 in the VERID
> register, so need to right shift 16bit to get it, otherwise
> the result of comparison "sai->verid.version >= 0x0301" is
> wrong.
>
> Fixes: 99c1e74f25d4 ("ASoC: fsl_sai: store full version instead of major/minor")
> Signed-off-by: Shengjiu Wang <[email protected]>
> ---
> sound/soc/fsl/fsl_sai.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> index c365afd6c4ea..1b197478b3d9 100644
> --- a/sound/soc/fsl/fsl_sai.c
> +++ b/sound/soc/fsl/fsl_sai.c
> @@ -1142,6 +1142,7 @@ static int fsl_sai_check_version(struct device *dev)
>
> sai->verid.version = val &
> (FSL_SAI_VERID_MAJOR_MASK | FSL_SAI_VERID_MINOR_MASK);
> + sai->verid.version >>= FSL_SAI_VERID_MINOR_SHIFT;
> sai->verid.feature = val & FSL_SAI_VERID_FEATURE_MASK;
>
> ret = regmap_read(sai->regmap, FSL_SAI_PARAM, &val);


I would put the version in one line, but probably is easier to read this
way.
Also, please explain, in commit message, what and from where is 0x0301 -
might worth adding a macro for this, in another commit, of course.
Otherwise,

Reviewed-by: Iuliana Prodan <[email protected]>


2023-02-07 14:06:43

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID

On Tue, 07 Feb 2023 17:04:24 +0800, Shengjiu Wang wrote:
> The version information is at the bit31 ~ bit16 in the VERID
> register, so need to right shift 16bit to get it, otherwise
> the result of comparison "sai->verid.version >= 0x0301" is
> wrong.
>
>

Applied to

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

Thanks!

[1/1] ASoC: fsl_sai: fix getting version from VERID
commit: 29aab38823b61e482995c24644bd2d8acfe56185

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