LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl_sai: fix getting version from VERID
@ 2023-02-07  9:04 Shengjiu Wang
  2023-02-07 11:16 ` Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shengjiu Wang @ 2023-02-07  9:04 UTC (permalink / raw)
  To: nicoleotsuka, Xiubo.Lee, festevam, shengjiu.wang, lgirdwood,
	broonie, perex, tiwai, alsa-devel
  Cc: linuxppc-dev, linux-kernel

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 <shengjiu.wang@nxp.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID
  2023-02-07  9:04 [PATCH] ASoC: fsl_sai: fix getting version from VERID Shengjiu Wang
@ 2023-02-07 11:16 ` Fabio Estevam
  2023-02-07 11:21 ` Iuliana Prodan
  2023-02-07 14:06 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2023-02-07 11:16 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: alsa-devel, Xiubo.Lee, linuxppc-dev, tiwai, lgirdwood, perex,
	nicoleotsuka, broonie, shengjiu.wang, linux-kernel

On Tue, Feb 7, 2023 at 6:30 AM Shengjiu Wang <shengjiu.wang@nxp.com> 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 <shengjiu.wang@nxp.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID
  2023-02-07  9:04 [PATCH] ASoC: fsl_sai: fix getting version from VERID Shengjiu Wang
  2023-02-07 11:16 ` Fabio Estevam
@ 2023-02-07 11:21 ` Iuliana Prodan
  2023-02-07 14:06 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Iuliana Prodan @ 2023-02-07 11:21 UTC (permalink / raw)
  To: Shengjiu Wang, nicoleotsuka, Xiubo.Lee, festevam, shengjiu.wang,
	lgirdwood, broonie, perex, tiwai, alsa-devel
  Cc: linuxppc-dev, linux-kernel

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 <shengjiu.wang@nxp.com>
> ---
>   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 <iuliana.prodan@nxp.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID
  2023-02-07  9:04 [PATCH] ASoC: fsl_sai: fix getting version from VERID Shengjiu Wang
  2023-02-07 11:16 ` Fabio Estevam
  2023-02-07 11:21 ` Iuliana Prodan
@ 2023-02-07 14:06 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2023-02-07 14:06 UTC (permalink / raw)
  To: nicoleotsuka, Xiubo.Lee, festevam, shengjiu.wang, lgirdwood,
	perex, tiwai, alsa-devel, Shengjiu Wang
  Cc: linuxppc-dev, linux-kernel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-07 14:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-07  9:04 [PATCH] ASoC: fsl_sai: fix getting version from VERID Shengjiu Wang
2023-02-07 11:16 ` Fabio Estevam
2023-02-07 11:21 ` Iuliana Prodan
2023-02-07 14:06 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox