From: Oliver O'Halloran <oohall@gmail.com> Date: 2017-06-27 10:29:04
struct device contains the ->of_node pointer so that devices can be
assoicated with the device-tree node that created them on DT platforms.
libnvdimm hides the struct device for regions and nvdimm devices inside
of an opaque structure so this patch adds accessors for each to allow
the of_nvdimm driver to set the of_node pointer.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
drivers/nvdimm/dimm_devs.c | 6 ++++++
drivers/nvdimm/region_devs.c | 6 ++++++
include/linux/libnvdimm.h | 2 ++
3 files changed, 14 insertions(+)
From: Oliver O'Halloran <oohall@gmail.com> Date: 2017-06-27 10:29:09
Adds powerpc64 implementations of:
memcpy_flushcache()
arch_wb_cache_pmem()
arch_invalidate_pmem()
Which form the architecture-specific portition of the persistent memory
API. These functions provide cache-management primitives for the DAX
drivers and libNVDIMM.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
This should go on to of the ZONE_DEVICE patches. If you want a full tree
there's one here that's based on next-20170626 with Dan's libnvdimm-pending
branch merged in: https://github.com/oohal/linux/tree/ppc-nvdimm-4.13
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/pmem.h | 42 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
create mode 100644 arch/powerpc/include/asm/pmem.h
From: Oliver O'Halloran <oohall@gmail.com> Date: 2017-06-27 10:29:11
Scan the devicetree for nonvolatile-memory buses and instantiate a
platform device for them.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
arch/powerpc/platforms/powernv/opal.c | 3 +++
1 file changed, 3 insertions(+)
From: Dan Williams <hidden> Date: 2017-07-10 23:53:36
On Tue, Jun 27, 2017 at 3:28 AM, Oliver O'Halloran [off-list ref] wrote:
struct device contains the ->of_node pointer so that devices can be
assoicated with the device-tree node that created them on DT platforms.
libnvdimm hides the struct device for regions and nvdimm devices inside
of an opaque structure so this patch adds accessors for each to allow
the of_nvdimm driver to set the of_node pointer.
I'd rather go the other way and pass in the of_node to the bus and
dimm registration routines. It's a generic property of the device so
we should handle it like other generic device properties that get set
at initialization time like 'attr_groups' in nvdimm_bus_descriptor, or
a new parameter to nvdimm_create().
From: Dan Williams <hidden> Date: 2017-07-11 00:00:23
On Tue, Jun 27, 2017 at 3:28 AM, Oliver O'Halloran [off-list ref] wrote:
Adds powerpc64 implementations of:
memcpy_flushcache()
arch_wb_cache_pmem()
arch_invalidate_pmem()
Which form the architecture-specific portition of the persistent memory
API. These functions provide cache-management primitives for the DAX
drivers and libNVDIMM.
Ok, now that we have commit 0aed55af8834 "x86, uaccess: introduce
copy_from_iter_flushcache for pmem / cache-bypass operations" upstream
that changes the model for how an architecture advertises
pmem-specific cache management routines. CONFIG_ARCH_HAS_PMEM_API
causes the pmem driver to try to link to these helpers rather than
dummy fallbacks:
arch_wb_cache_pmem
arch_invalidate_pmem
....and CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE indicates that the arch has
all the needed "flushcache" apis:
__copy_from_user_flushcache
memcpy_page_flushcache
memcpy_flushcache
From: Oliver <oohall@gmail.com> Date: 2017-07-11 04:38:21
On Tue, Jul 11, 2017 at 9:53 AM, Dan Williams [off-list ref] wrote:
On Tue, Jun 27, 2017 at 3:28 AM, Oliver O'Halloran [off-list ref] wrote:
quoted
struct device contains the ->of_node pointer so that devices can be
assoicated with the device-tree node that created them on DT platforms.
libnvdimm hides the struct device for regions and nvdimm devices inside
of an opaque structure so this patch adds accessors for each to allow
the of_nvdimm driver to set the of_node pointer.
I'd rather go the other way and pass in the of_node to the bus and
dimm registration routines. It's a generic property of the device so
we should handle it like other generic device properties that get set
at initialization time like 'attr_groups' in nvdimm_bus_descriptor, or
a new parameter to nvdimm_create().
Sure. I just figured it would be preferable to keep firmware specific
details inside the firmware driver rather than adding #ifdef CONFIG_OF
around the place. Do you have any objections to making nvdimm_create()
take a descriptor structure rather than adding a parameter?
From: Dan Williams <hidden> Date: 2017-07-11 07:36:27
On Mon, Jul 10, 2017 at 9:38 PM, Oliver [off-list ref] wrote:
On Tue, Jul 11, 2017 at 9:53 AM, Dan Williams [off-list ref] wrote:
quoted
On Tue, Jun 27, 2017 at 3:28 AM, Oliver O'Halloran [off-list ref] wrote:
quoted
struct device contains the ->of_node pointer so that devices can be
assoicated with the device-tree node that created them on DT platforms.
libnvdimm hides the struct device for regions and nvdimm devices inside
of an opaque structure so this patch adds accessors for each to allow
the of_nvdimm driver to set the of_node pointer.
I'd rather go the other way and pass in the of_node to the bus and
dimm registration routines. It's a generic property of the device so
we should handle it like other generic device properties that get set
at initialization time like 'attr_groups' in nvdimm_bus_descriptor, or
a new parameter to nvdimm_create().
Sure. I just figured it would be preferable to keep firmware specific
details inside the firmware driver rather than adding #ifdef CONFIG_OF
around the place. Do you have any objections to making nvdimm_create()
take a descriptor structure rather than adding a parameter?
I don't see why we need "#ifdef CONFIG_OF". It's just a "struct
of_node *" pointer that can be forward declared as "struct of_node;"
we don't need the full definition.
Yes, I'm fine with converting nvdimm_create() to a take a descriptor,