Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1315175 > unrolled thread
| Started by | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| First post | 2016-01-22 19:00 +0100 |
| Last post | 2016-01-22 20:00 +0100 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] phys_to_pfn_t: use phys_addr_t Dan Williams <dan.j.williams@intel.com> - 2016-01-22 19:00 +0100
Re: [PATCH] phys_to_pfn_t: use phys_addr_t Matthew Wilcox <willy@linux.intel.com> - 2016-01-22 19:50 +0100
[PATCH v2] phys_to_pfn_t: use phys_addr_t Dan Williams <dan.j.williams@intel.com> - 2016-01-22 20:00 +0100
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2016-01-22 19:00 +0100 |
| Subject | [PATCH] phys_to_pfn_t: use phys_addr_t |
| Message-ID | <qTOa7-7nC-9@gated-at.bofh.it> |
A dma_addr_t is potentially smaller than a phys_addr_t on some archs.
Don't truncate the address when doing the pfn conversion.
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Reported-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
include/linux/pfn_t.h | 2 +-
kernel/memremap.c | 2 +-
tools/testing/nvdimm/test/iomap.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/pfn_t.h b/include/linux/pfn_t.h
index 0703b5360d31..98145a17c1eb 100644
--- a/include/linux/pfn_t.h
+++ b/include/linux/pfn_t.h
@@ -29,7 +29,7 @@ static inline pfn_t pfn_to_pfn_t(unsigned long pfn)
return __pfn_to_pfn_t(pfn, 0);
}
-extern pfn_t phys_to_pfn_t(dma_addr_t addr, unsigned long flags);
+extern pfn_t phys_to_pfn_t(phys_addr_t addr, unsigned long flags);
static inline bool pfn_t_has_page(pfn_t pfn)
{
diff --git a/kernel/memremap.c b/kernel/memremap.c
index e517a16cb426..7f6d08f41d72 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -150,7 +150,7 @@ void devm_memunmap(struct device *dev, void *addr)
}
EXPORT_SYMBOL(devm_memunmap);
-pfn_t phys_to_pfn_t(dma_addr_t addr, unsigned long flags)
+pfn_t phys_to_pfn_t(phys_addr_t addr, unsigned long flags)
{
return __pfn_to_pfn_t(addr >> PAGE_SHIFT, flags);
}
diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c
index 7ec7df9e7fc7..0c1a7e65bb81 100644
--- a/tools/testing/nvdimm/test/iomap.c
+++ b/tools/testing/nvdimm/test/iomap.c
@@ -113,7 +113,7 @@ void *__wrap_devm_memremap_pages(struct device *dev, struct resource *res,
}
EXPORT_SYMBOL(__wrap_devm_memremap_pages);
-pfn_t __wrap_phys_to_pfn_t(dma_addr_t addr, unsigned long flags)
+pfn_t __wrap_phys_to_pfn_t(phys_addr_t addr, unsigned long flags)
{
struct nfit_test_resource *nfit_res = get_nfit_res(addr);
[toc] | [next] | [standalone]
| From | Matthew Wilcox <willy@linux.intel.com> |
|---|---|
| Date | 2016-01-22 19:50 +0100 |
| Message-ID | <qTOWt-7Yf-3@gated-at.bofh.it> |
| In reply to | #1315175 |
Missed one:
static inline dma_addr_t pfn_t_to_phys(pfn_t pfn)
{
return PFN_PHYS(pfn_t_to_pfn(pfn));
}
On Fri, Jan 22, 2016 at 09:51:14AM -0800, Dan Williams wrote:
> A dma_addr_t is potentially smaller than a phys_addr_t on some archs.
> Don't truncate the address when doing the pfn conversion.
>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Reported-by: Matthew Wilcox <willy@linux.intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> include/linux/pfn_t.h | 2 +-
> kernel/memremap.c | 2 +-
> tools/testing/nvdimm/test/iomap.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/pfn_t.h b/include/linux/pfn_t.h
> index 0703b5360d31..98145a17c1eb 100644
> --- a/include/linux/pfn_t.h
> +++ b/include/linux/pfn_t.h
> @@ -29,7 +29,7 @@ static inline pfn_t pfn_to_pfn_t(unsigned long pfn)
> return __pfn_to_pfn_t(pfn, 0);
> }
>
> -extern pfn_t phys_to_pfn_t(dma_addr_t addr, unsigned long flags);
> +extern pfn_t phys_to_pfn_t(phys_addr_t addr, unsigned long flags);
>
> static inline bool pfn_t_has_page(pfn_t pfn)
> {
> diff --git a/kernel/memremap.c b/kernel/memremap.c
> index e517a16cb426..7f6d08f41d72 100644
> --- a/kernel/memremap.c
> +++ b/kernel/memremap.c
> @@ -150,7 +150,7 @@ void devm_memunmap(struct device *dev, void *addr)
> }
> EXPORT_SYMBOL(devm_memunmap);
>
> -pfn_t phys_to_pfn_t(dma_addr_t addr, unsigned long flags)
> +pfn_t phys_to_pfn_t(phys_addr_t addr, unsigned long flags)
> {
> return __pfn_to_pfn_t(addr >> PAGE_SHIFT, flags);
> }
> diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c
> index 7ec7df9e7fc7..0c1a7e65bb81 100644
> --- a/tools/testing/nvdimm/test/iomap.c
> +++ b/tools/testing/nvdimm/test/iomap.c
> @@ -113,7 +113,7 @@ void *__wrap_devm_memremap_pages(struct device *dev, struct resource *res,
> }
> EXPORT_SYMBOL(__wrap_devm_memremap_pages);
>
> -pfn_t __wrap_phys_to_pfn_t(dma_addr_t addr, unsigned long flags)
> +pfn_t __wrap_phys_to_pfn_t(phys_addr_t addr, unsigned long flags)
> {
> struct nfit_test_resource *nfit_res = get_nfit_res(addr);
>
[toc] | [prev] | [next] | [standalone]
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2016-01-22 20:00 +0100 |
| Subject | [PATCH v2] phys_to_pfn_t: use phys_addr_t |
| Message-ID | <qTP6a-81w-11@gated-at.bofh.it> |
| In reply to | #1315219 |
A dma_addr_t is potentially smaller than a phys_addr_t on some archs.
Don't truncate the address when doing the pfn conversion.
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Reported-by: Matthew Wilcox <willy@linux.intel.com>
[willy: fix pfn_t_to_phys as well]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
include/linux/pfn_t.h | 4 ++--
kernel/memremap.c | 2 +-
tools/testing/nvdimm/test/iomap.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/pfn_t.h b/include/linux/pfn_t.h
index 0703b5360d31..37448ab5fb5c 100644
--- a/include/linux/pfn_t.h
+++ b/include/linux/pfn_t.h
@@ -29,7 +29,7 @@ static inline pfn_t pfn_to_pfn_t(unsigned long pfn)
return __pfn_to_pfn_t(pfn, 0);
}
-extern pfn_t phys_to_pfn_t(dma_addr_t addr, unsigned long flags);
+extern pfn_t phys_to_pfn_t(phys_addr_t addr, unsigned long flags);
static inline bool pfn_t_has_page(pfn_t pfn)
{
@@ -48,7 +48,7 @@ static inline struct page *pfn_t_to_page(pfn_t pfn)
return NULL;
}
-static inline dma_addr_t pfn_t_to_phys(pfn_t pfn)
+static inline phys_addr_t pfn_t_to_phys(pfn_t pfn)
{
return PFN_PHYS(pfn_t_to_pfn(pfn));
}
diff --git a/kernel/memremap.c b/kernel/memremap.c
index e517a16cb426..7f6d08f41d72 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -150,7 +150,7 @@ void devm_memunmap(struct device *dev, void *addr)
}
EXPORT_SYMBOL(devm_memunmap);
-pfn_t phys_to_pfn_t(dma_addr_t addr, unsigned long flags)
+pfn_t phys_to_pfn_t(phys_addr_t addr, unsigned long flags)
{
return __pfn_to_pfn_t(addr >> PAGE_SHIFT, flags);
}
diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c
index 7ec7df9e7fc7..0c1a7e65bb81 100644
--- a/tools/testing/nvdimm/test/iomap.c
+++ b/tools/testing/nvdimm/test/iomap.c
@@ -113,7 +113,7 @@ void *__wrap_devm_memremap_pages(struct device *dev, struct resource *res,
}
EXPORT_SYMBOL(__wrap_devm_memremap_pages);
-pfn_t __wrap_phys_to_pfn_t(dma_addr_t addr, unsigned long flags)
+pfn_t __wrap_phys_to_pfn_t(phys_addr_t addr, unsigned long flags)
{
struct nfit_test_resource *nfit_res = get_nfit_res(addr);
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web