alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] sst: replace custom implementation of readq / writeq
@ 2015-08-27 12:09 Andy Shevchenko
  2015-09-17  8:57 ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2015-08-27 12:09 UTC (permalink / raw)
  To: Jie Yang, Liam Girdwood, alsa-devel; +Cc: Andy Shevchenko

The readq() and writeq() helpers are available in the
asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64-nonatomic-lo-hi.h
headers. Replace custom implementation by the generic helpers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/intel/atom/sst/sst_pvt.c | 16 ++++++----------
 sound/soc/intel/common/sst-dsp.c   |  9 ++++-----
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/sound/soc/intel/atom/sst/sst_pvt.c b/sound/soc/intel/atom/sst/sst_pvt.c
index adb32fe..6cc222d 100644
--- a/sound/soc/intel/atom/sst/sst_pvt.c
+++ b/sound/soc/intel/atom/sst/sst_pvt.c
@@ -31,7 +31,10 @@
 #include <sound/pcm.h>
 #include <sound/soc.h>
 #include <sound/compress_driver.h>
+
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
 #include <asm/platform_sst_audio.h>
+
 #include "../sst-mfld-platform.h"
 #include "sst.h"
 #include "../../common/sst-dsp.h"
@@ -49,25 +52,18 @@ u32 sst_shim_read(void __iomem *addr, int offset)
 
 u64 sst_reg_read64(void __iomem *addr, int offset)
 {
-	u64 val = 0;
-
-	memcpy_fromio(&val, addr + offset, sizeof(val));
-
-	return val;
+	return readq(addr + offset);
 }
 
 int sst_shim_write64(void __iomem *addr, int offset, u64 value)
 {
-	memcpy_toio(addr + offset, &value, sizeof(value));
+	writeq(value, addr + offset);
 	return 0;
 }
 
 u64 sst_shim_read64(void __iomem *addr, int offset)
 {
-	u64 val = 0;
-
-	memcpy_fromio(&val, addr + offset, sizeof(val));
-	return val;
+	return readq(addr + offset);
 }
 
 void sst_set_fw_state_locked(
diff --git a/sound/soc/intel/common/sst-dsp.c b/sound/soc/intel/common/sst-dsp.c
index a627236..5274482 100644
--- a/sound/soc/intel/common/sst-dsp.c
+++ b/sound/soc/intel/common/sst-dsp.c
@@ -22,6 +22,8 @@
 #include <linux/io.h>
 #include <linux/delay.h>
 
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+
 #include "sst-dsp.h"
 #include "sst-dsp-priv.h"
 
@@ -43,16 +45,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.5.0

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

* Re: [PATCH v1 1/1] sst: replace custom implementation of readq / writeq
  2015-08-27 12:09 [PATCH v1 1/1] sst: replace custom implementation of readq / writeq Andy Shevchenko
@ 2015-09-17  8:57 ` Andy Shevchenko
  2015-09-17  9:24   ` Liam Girdwood
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2015-09-17  8:57 UTC (permalink / raw)
  To: Jie Yang, Liam Girdwood, alsa-devel

On Thu, 2015-08-27 at 15:09 +0300, Andy Shevchenko wrote:
> The readq() and writeq() helpers are available in the
> asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64-nonatomic
> -lo-hi.h
> headers. Replace custom implementation by the generic helpers.
> 

Liam, any comments on this?

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  sound/soc/intel/atom/sst/sst_pvt.c | 16 ++++++----------
>  sound/soc/intel/common/sst-dsp.c   |  9 ++++-----
>  2 files changed, 10 insertions(+), 15 deletions(-)
> 
> diff --git a/sound/soc/intel/atom/sst/sst_pvt.c 
> b/sound/soc/intel/atom/sst/sst_pvt.c
> index adb32fe..6cc222d 100644
> --- a/sound/soc/intel/atom/sst/sst_pvt.c
> +++ b/sound/soc/intel/atom/sst/sst_pvt.c
> @@ -31,7 +31,10 @@
>  #include <sound/pcm.h>
>  #include <sound/soc.h>
>  #include <sound/compress_driver.h>
> +
> +#include <asm-generic/io-64-nonatomic-lo-hi.h>
>  #include <asm/platform_sst_audio.h>
> +
>  #include "../sst-mfld-platform.h"
>  #include "sst.h"
>  #include "../../common/sst-dsp.h"
> @@ -49,25 +52,18 @@ u32 sst_shim_read(void __iomem *addr, int offset)
>  
>  u64 sst_reg_read64(void __iomem *addr, int offset)
>  {
> -	u64 val = 0;
> -
> -	memcpy_fromio(&val, addr + offset, sizeof(val));
> -
> -	return val;
> +	return readq(addr + offset);
>  }
>  
>  int sst_shim_write64(void __iomem *addr, int offset, u64 value)
>  {
> -	memcpy_toio(addr + offset, &value, sizeof(value));
> +	writeq(value, addr + offset);
>  	return 0;
>  }
>  
>  u64 sst_shim_read64(void __iomem *addr, int offset)
>  {
> -	u64 val = 0;
> -
> -	memcpy_fromio(&val, addr + offset, sizeof(val));
> -	return val;
> +	return readq(addr + offset);
>  }
>  
>  void sst_set_fw_state_locked(
> diff --git a/sound/soc/intel/common/sst-dsp.c 
> b/sound/soc/intel/common/sst-dsp.c
> index a627236..5274482 100644
> --- a/sound/soc/intel/common/sst-dsp.c
> +++ b/sound/soc/intel/common/sst-dsp.c
> @@ -22,6 +22,8 @@
>  #include <linux/io.h>
>  #include <linux/delay.h>
>  
> +#include <asm-generic/io-64-nonatomic-lo-hi.h>
> +
>  #include "sst-dsp.h"
>  #include "sst-dsp-priv.h"
>  
> @@ -43,16 +45,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);
>  

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH v1 1/1] sst: replace custom implementation of readq / writeq
  2015-09-17  8:57 ` Andy Shevchenko
@ 2015-09-17  9:24   ` Liam Girdwood
  2015-09-17 11:41     ` Vinod Koul
  0 siblings, 1 reply; 6+ messages in thread
From: Liam Girdwood @ 2015-09-17  9:24 UTC (permalink / raw)
  To: Andy Shevchenko, Koul, Vinod; +Cc: alsa-devel, Jie Yang, Liam Girdwood

On Thu, 2015-09-17 at 11:57 +0300, Andy Shevchenko wrote:
> On Thu, 2015-08-27 at 15:09 +0300, Andy Shevchenko wrote:
> > The readq() and writeq() helpers are available in the
> > asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64-nonatomic
> > -lo-hi.h
> > headers. Replace custom implementation by the generic helpers.
> > 
> 
> Liam, any comments on this?

Looks good from me, but it's one of Vinod's drivers (now added to CC).

Liam

> 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  sound/soc/intel/atom/sst/sst_pvt.c | 16 ++++++----------
> >  sound/soc/intel/common/sst-dsp.c   |  9 ++++-----
> >  2 files changed, 10 insertions(+), 15 deletions(-)
> > 
> > diff --git a/sound/soc/intel/atom/sst/sst_pvt.c 
> > b/sound/soc/intel/atom/sst/sst_pvt.c
> > index adb32fe..6cc222d 100644
> > --- a/sound/soc/intel/atom/sst/sst_pvt.c
> > +++ b/sound/soc/intel/atom/sst/sst_pvt.c
> > @@ -31,7 +31,10 @@
> >  #include <sound/pcm.h>
> >  #include <sound/soc.h>
> >  #include <sound/compress_driver.h>
> > +
> > +#include <asm-generic/io-64-nonatomic-lo-hi.h>
> >  #include <asm/platform_sst_audio.h>
> > +
> >  #include "../sst-mfld-platform.h"
> >  #include "sst.h"
> >  #include "../../common/sst-dsp.h"
> > @@ -49,25 +52,18 @@ u32 sst_shim_read(void __iomem *addr, int offset)
> >  
> >  u64 sst_reg_read64(void __iomem *addr, int offset)
> >  {
> > -	u64 val = 0;
> > -
> > -	memcpy_fromio(&val, addr + offset, sizeof(val));
> > -
> > -	return val;
> > +	return readq(addr + offset);
> >  }
> >  
> >  int sst_shim_write64(void __iomem *addr, int offset, u64 value)
> >  {
> > -	memcpy_toio(addr + offset, &value, sizeof(value));
> > +	writeq(value, addr + offset);
> >  	return 0;
> >  }
> >  
> >  u64 sst_shim_read64(void __iomem *addr, int offset)
> >  {
> > -	u64 val = 0;
> > -
> > -	memcpy_fromio(&val, addr + offset, sizeof(val));
> > -	return val;
> > +	return readq(addr + offset);
> >  }
> >  
> >  void sst_set_fw_state_locked(
> > diff --git a/sound/soc/intel/common/sst-dsp.c 
> > b/sound/soc/intel/common/sst-dsp.c
> > index a627236..5274482 100644
> > --- a/sound/soc/intel/common/sst-dsp.c
> > +++ b/sound/soc/intel/common/sst-dsp.c
> > @@ -22,6 +22,8 @@
> >  #include <linux/io.h>
> >  #include <linux/delay.h>
> >  
> > +#include <asm-generic/io-64-nonatomic-lo-hi.h>
> > +
> >  #include "sst-dsp.h"
> >  #include "sst-dsp-priv.h"
> >  
> > @@ -43,16 +45,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);
> >  
> 

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

* Re: [PATCH v1 1/1] sst: replace custom implementation of readq / writeq
  2015-09-17  9:24   ` Liam Girdwood
@ 2015-09-17 11:41     ` Vinod Koul
  2015-09-18 12:07       ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2015-09-17 11:41 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel, Andy Shevchenko, Jie Yang, Liam Girdwood

On Thu, Sep 17, 2015 at 10:24:04AM +0100, Liam Girdwood wrote:
> On Thu, 2015-09-17 at 11:57 +0300, Andy Shevchenko wrote:
> > On Thu, 2015-08-27 at 15:09 +0300, Andy Shevchenko wrote:
> > > The readq() and writeq() helpers are available in the
> > > asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64-nonatomic
> > > -lo-hi.h
> > > headers. Replace custom implementation by the generic helpers.
> > > 
> > 
> > Liam, any comments on this?
> 
> Looks good from me, but it's one of Vinod's drivers (now added to CC).

Please do test this on BYT/BSW as well, otherwise looks good

Acked-by: Vinod Koul <vinod.koul@intel.com>

-- 
~Vinod

> 
> Liam
> 
> > 
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > ---
> > >  sound/soc/intel/atom/sst/sst_pvt.c | 16 ++++++----------
> > >  sound/soc/intel/common/sst-dsp.c   |  9 ++++-----
> > >  2 files changed, 10 insertions(+), 15 deletions(-)
> > > 
> > > diff --git a/sound/soc/intel/atom/sst/sst_pvt.c 
> > > b/sound/soc/intel/atom/sst/sst_pvt.c
> > > index adb32fe..6cc222d 100644
> > > --- a/sound/soc/intel/atom/sst/sst_pvt.c
> > > +++ b/sound/soc/intel/atom/sst/sst_pvt.c
> > > @@ -31,7 +31,10 @@
> > >  #include <sound/pcm.h>
> > >  #include <sound/soc.h>
> > >  #include <sound/compress_driver.h>
> > > +
> > > +#include <asm-generic/io-64-nonatomic-lo-hi.h>
> > >  #include <asm/platform_sst_audio.h>
> > > +
> > >  #include "../sst-mfld-platform.h"
> > >  #include "sst.h"
> > >  #include "../../common/sst-dsp.h"
> > > @@ -49,25 +52,18 @@ u32 sst_shim_read(void __iomem *addr, int offset)
> > >  
> > >  u64 sst_reg_read64(void __iomem *addr, int offset)
> > >  {
> > > -	u64 val = 0;
> > > -
> > > -	memcpy_fromio(&val, addr + offset, sizeof(val));
> > > -
> > > -	return val;
> > > +	return readq(addr + offset);
> > >  }
> > >  
> > >  int sst_shim_write64(void __iomem *addr, int offset, u64 value)
> > >  {
> > > -	memcpy_toio(addr + offset, &value, sizeof(value));
> > > +	writeq(value, addr + offset);
> > >  	return 0;
> > >  }
> > >  
> > >  u64 sst_shim_read64(void __iomem *addr, int offset)
> > >  {
> > > -	u64 val = 0;
> > > -
> > > -	memcpy_fromio(&val, addr + offset, sizeof(val));
> > > -	return val;
> > > +	return readq(addr + offset);
> > >  }
> > >  
> > >  void sst_set_fw_state_locked(
> > > diff --git a/sound/soc/intel/common/sst-dsp.c 
> > > b/sound/soc/intel/common/sst-dsp.c
> > > index a627236..5274482 100644
> > > --- a/sound/soc/intel/common/sst-dsp.c
> > > +++ b/sound/soc/intel/common/sst-dsp.c
> > > @@ -22,6 +22,8 @@
> > >  #include <linux/io.h>
> > >  #include <linux/delay.h>
> > >  
> > > +#include <asm-generic/io-64-nonatomic-lo-hi.h>
> > > +
> > >  #include "sst-dsp.h"
> > >  #include "sst-dsp-priv.h"
> > >  
> > > @@ -43,16 +45,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);
> > >  
> > 
> 

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

* Re: [PATCH v1 1/1] sst: replace custom implementation of readq / writeq
  2015-09-17 11:41     ` Vinod Koul
@ 2015-09-18 12:07       ` Andy Shevchenko
  2015-11-24 10:25         ` Shevchenko, Andriy
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2015-09-18 12:07 UTC (permalink / raw)
  To: Vinod Koul, Liam Girdwood; +Cc: alsa-devel, Jie Yang, Liam Girdwood

On Thu, 2015-09-17 at 17:11 +0530, Vinod Koul wrote:
> On Thu, Sep 17, 2015 at 10:24:04AM +0100, Liam Girdwood wrote:
> > On Thu, 2015-09-17 at 11:57 +0300, Andy Shevchenko wrote:
> > > On Thu, 2015-08-27 at 15:09 +0300, Andy Shevchenko wrote:
> > > > The readq() and writeq() helpers are available in the
> > > > asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64
> > > > -nonatomic
> > > > -lo-hi.h
> > > > headers. Replace custom implementation by the generic helpers.
> > > > 
> > > 
> > > Liam, any comments on this?
> > 
> > Looks good from me, but it's one of Vinod's drivers (now added to 
> > CC).
> 
> Please do test this on BYT/BSW as well, otherwise looks good

Tested both patches (another one just recently sent) on ASuS T100TA.

> 
> Acked-by: Vinod Koul <vinod.koul@intel.com>
> 

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH v1 1/1] sst: replace custom implementation of readq / writeq
  2015-09-18 12:07       ` Andy Shevchenko
@ 2015-11-24 10:25         ` Shevchenko, Andriy
  0 siblings, 0 replies; 6+ messages in thread
From: Shevchenko, Andriy @ 2015-11-24 10:25 UTC (permalink / raw)
  To: liam.r.girdwood@linux.intel.com, Koul, Vinod
  Cc: alsa-devel@alsa-project.org, yang.jie@linux.intel.com,
	lgirdwood@gmail.com

On Fri, 2015-09-18 at 15:07 +0300, Andy Shevchenko wrote:
> On Thu, 2015-09-17 at 17:11 +0530, Vinod Koul wrote:
> > On Thu, Sep 17, 2015 at 10:24:04AM +0100, Liam Girdwood wrote:
> > > On Thu, 2015-09-17 at 11:57 +0300, Andy Shevchenko wrote:
> > > > On Thu, 2015-08-27 at 15:09 +0300, Andy Shevchenko wrote:
> > > > > The readq() and writeq() helpers are available in the
> > > > > asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64
> > > > > -nonatomic
> > > > > -lo-hi.h
> > > > > headers. Replace custom implementation by the generic
> > > > > helpers.
> > > > > 
> > > > 
> > > > Liam, any comments on this?
> > > 
> > > Looks good from me, but it's one of Vinod's drivers (now added to
> > > CC).
> > 
> > Please do test this on BYT/BSW as well, otherwise looks good
> 
> Tested both patches (another one just recently sent) on ASuS T100TA.

Do I understand correctly I have to resend with Mark in Cc?

> 
> > 
> > Acked-by: Vinod Koul <vinod.koul@intel.com>
> > 
> 

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

end of thread, other threads:[~2015-11-24 10:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-27 12:09 [PATCH v1 1/1] sst: replace custom implementation of readq / writeq Andy Shevchenko
2015-09-17  8:57 ` Andy Shevchenko
2015-09-17  9:24   ` Liam Girdwood
2015-09-17 11:41     ` Vinod Koul
2015-09-18 12:07       ` Andy Shevchenko
2015-11-24 10:25         ` Shevchenko, Andriy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).