From: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH v2 1/1] iommu/vt-d: use lo_hi_readq() / lo_hi_writeq()
Date: Thu, 28 Jan 2016 14:35:10 +0200 [thread overview]
Message-ID: <1453984510.2521.290.camel@linux.intel.com> (raw)
In-Reply-To: <1447950167-111241-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
On Thu, 2015-11-19 at 18:22 +0200, Andy Shevchenko wrote:
> There is already helper functions to do 64-bit I/O on 32-bit machines
> or buses,
> thus we don't need to reinvent the wheel.
>
Any comment on this?
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> Cahngelog v2:
> - rebase on top of recent linux-next
> include/linux/intel-iommu.h | 18 ++----------------
> 1 file changed, 2 insertions(+), 16 deletions(-)
>
> diff --git a/include/linux/intel-iommu.h b/include/linux/intel-
> iommu.h
> index 821273c..34066ee 100644
> --- a/include/linux/intel-iommu.h
> +++ b/include/linux/intel-iommu.h
> @@ -29,6 +29,8 @@
> #include <linux/dma_remapping.h>
> #include <linux/mmu_notifier.h>
> #include <linux/list.h>
> +#include <linux/io-64-nonatomic-lo-hi.h>
> +
> #include <asm/cacheflush.h>
> #include <asm/iommu.h>
>
> @@ -71,24 +73,8 @@
>
> #define OFFSET_STRIDE (9)
>
> -#ifdef CONFIG_64BIT
> #define dmar_readq(a) readq(a)
> #define dmar_writeq(a,v) writeq(v,a)
> -#else
> -static inline u64 dmar_readq(void __iomem *addr)
> -{
> - u32 lo, hi;
> - lo = readl(addr);
> - hi = readl(addr + 4);
> - return (((u64) hi) << 32) + lo;
> -}
> -
> -static inline void dmar_writeq(void __iomem *addr, u64 val)
> -{
> - writel((u32)val, addr);
> - writel((u32)(val >> 32), addr + 4);
> -}
> -#endif
>
> #define DMAR_VER_MAJOR(v) (((v) & 0xf0) >> 4)
> #define DMAR_VER_MINOR(v) ((v) & 0x0f)
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-kernel@vger.kernel.org,
David Woodhouse <dwmw2@infradead.org>,
iommu@lists.linux-foundation.org
Subject: Re: [PATCH v2 1/1] iommu/vt-d: use lo_hi_readq() / lo_hi_writeq()
Date: Thu, 28 Jan 2016 14:35:10 +0200 [thread overview]
Message-ID: <1453984510.2521.290.camel@linux.intel.com> (raw)
In-Reply-To: <1447950167-111241-1-git-send-email-andriy.shevchenko@linux.intel.com>
On Thu, 2015-11-19 at 18:22 +0200, Andy Shevchenko wrote:
> There is already helper functions to do 64-bit I/O on 32-bit machines
> or buses,
> thus we don't need to reinvent the wheel.
>
Any comment on this?
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> Cahngelog v2:
> - rebase on top of recent linux-next
> include/linux/intel-iommu.h | 18 ++----------------
> 1 file changed, 2 insertions(+), 16 deletions(-)
>
> diff --git a/include/linux/intel-iommu.h b/include/linux/intel-
> iommu.h
> index 821273c..34066ee 100644
> --- a/include/linux/intel-iommu.h
> +++ b/include/linux/intel-iommu.h
> @@ -29,6 +29,8 @@
> #include <linux/dma_remapping.h>
> #include <linux/mmu_notifier.h>
> #include <linux/list.h>
> +#include <linux/io-64-nonatomic-lo-hi.h>
> +
> #include <asm/cacheflush.h>
> #include <asm/iommu.h>
>
> @@ -71,24 +73,8 @@
>
> #define OFFSET_STRIDE (9)
>
> -#ifdef CONFIG_64BIT
> #define dmar_readq(a) readq(a)
> #define dmar_writeq(a,v) writeq(v,a)
> -#else
> -static inline u64 dmar_readq(void __iomem *addr)
> -{
> - u32 lo, hi;
> - lo = readl(addr);
> - hi = readl(addr + 4);
> - return (((u64) hi) << 32) + lo;
> -}
> -
> -static inline void dmar_writeq(void __iomem *addr, u64 val)
> -{
> - writel((u32)val, addr);
> - writel((u32)(val >> 32), addr + 4);
> -}
> -#endif
>
> #define DMAR_VER_MAJOR(v) (((v) & 0xf0) >> 4)
> #define DMAR_VER_MINOR(v) ((v) & 0x0f)
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2016-01-28 12:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 16:22 [PATCH v2 1/1] iommu/vt-d: use lo_hi_readq() / lo_hi_writeq() Andy Shevchenko
2015-11-19 16:22 ` Andy Shevchenko
[not found] ` <1447950167-111241-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-01-28 12:35 ` Andy Shevchenko [this message]
2016-01-28 12:35 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1453984510.2521.290.camel@linux.intel.com \
--to=andriy.shevchenko-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.