lkml.org 
[lkml]   [2012]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [char-misc-next 07/15] mei: use wrietl/readl instead of io wrappers
On Tue,  4 Dec 2012 16:04:36 +0200
Tomas Winkler <tomas.winkler@intel.com> wrote:

> on intel registers are alwasy memory mapped so drop
> the overhead of iowrite32 and ioread32
>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
> drivers/misc/mei/mei_dev.h | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
> index 92a5d9a..37eb041 100644
> --- a/drivers/misc/mei/mei_dev.h
> +++ b/drivers/misc/mei/mei_dev.h
> @@ -438,7 +438,7 @@ int mei_amthif_irq_read(struct mei_device *dev, s32 *slots);
> static inline u32 mei_reg_read(const struct mei_device *dev,
> unsigned long offset)
> {
> - return ioread32(dev->mem_addr + offset);
> + return readl(dev->mem_addr + offset);
> }
>
> /**
> @@ -451,7 +451,7 @@ static inline u32 mei_reg_read(const struct mei_device *dev,
> static inline void mei_reg_write(const struct mei_device *dev,
> unsigned long offset, u32 value)
> {
> - iowrite32(value, dev->mem_addr + offset);
> + writel(value, dev->mem_addr + offset);

ioremap should match readl/writel
iomap iowrite32/ioread32

so you need to tweak the map/unmap if you do this.

As to overhead. I'd love to see a measurement that can detect the
difference. Do you have a benchmark that shows it ?


\
 
 \ /
  Last update: 2012-12-05 06:21    [W:0.248 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site