Re: [char-misc-next 07/15] mei: use wrietl/readl instead of iowrappers

From: Alan Cox
Date: Tue Dec 04 2012 - 09:26:28 EST


On Tue, 4 Dec 2012 16:04:36 +0200
Tomas Winkler <tomas.winkler@xxxxxxxxx> wrote:

> on intel registers are alwasy memory mapped so drop
> the overhead of iowrite32 and ioread32
>
> Signed-off-by: Tomas Winkler <tomas.winkler@xxxxxxxxx>
> ---
> 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 ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/