[PATCH 2/2] ASoC: Intel: Use readq to read 64 bit registers
Lu, Brent
brent.lu at intel.com
Tue May 12 08:19:20 CEST 2020
> -----Original Message-----
> From: Alsa-devel <alsa-devel-bounces at alsa-project.org> On Behalf Of
> Amadeusz Slawinski
> Sent: Thursday, May 7, 2020 9:34 PM
> To: Rojewski, Cezary <cezary.rojewski at intel.com>; Pierre-Louis Bossart
> <pierre-louis.bossart at linux.intel.com>; Liam Girdwood
> <lgirdwood at gmail.com>; Jie Yang <yang.jie at linux.intel.com>; Mark Brown
> <broonie at kernel.org>; Takashi Iwai <tiwai at suse.com>
> Cc: alsa-devel at alsa-project.org; Amadeusz Sławiński
> <amadeuszx.slawinski at linux.intel.com>
> Subject: [PATCH 2/2] ASoC: Intel: Use readq to read 64 bit registers
>
> In order to fix issue described in:
> "ASoC: Intel: sst: ipc command timeout"
> https://patchwork.kernel.org/patch/11482829/
>
> use readq function, which is meant to read 64 bit values from registers.
> On 32 bit platforms it falls back to two readl calls.
>
> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski at linux.intel.com>
> Reported-by: Brent Lu <brent.lu at intel.com>
Tested-by: Brent Lu <brent.lu at intel.com>
Regards,
Brent
> ---
> sound/soc/intel/common/sst-dsp.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/intel/common/sst-dsp.c
> b/sound/soc/intel/common/sst-dsp.c
> index ec66be269b69..36c077aa386e 100644
> --- a/sound/soc/intel/common/sst-dsp.c
> +++ b/sound/soc/intel/common/sst-dsp.c
> @@ -10,7 +10,7 @@
> #include <linux/interrupt.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> -#include <linux/io.h>
> +#include <linux/io-64-nonatomic-lo-hi.h>
> #include <linux/delay.h>
>
> #include "sst-dsp.h"
> @@ -34,16 +34,13 @@ EXPORT_SYMBOL_GPL(sst_shim32_read);
>
> void sst_shim32_write64(void __iomem *addr, u32 offset, u64 value) {
> - memcpy_toio(addr + offset, &value, sizeof(value));
> + writeq(value, addr + offset);
> }
> EXPORT_SYMBOL_GPL(sst_shim32_write64);
>
> u64 sst_shim32_read64(void __iomem *addr, u32 offset) {
> - u64 val;
> -
> - memcpy_fromio(&val, addr + offset, sizeof(val));
> - return val;
> + return readq(addr + offset);
> }
> EXPORT_SYMBOL_GPL(sst_shim32_read64);
>
> --
> 2.17.1
More information about the Alsa-devel
mailing list