linux-stable/drivers/nvdimm
Dan Williams 18515942d6 libnvdimm: register nvdimm_bus devices with an nd_bus driver
A recent effort to add a new nvdimm bus provider attribute highlighted a
race between interrogating nvdimm_bus->nd_desc and nvdimm_bus tear down.
The typical way to handle these races is to take the device_lock() in
the attribute method and validate that the device is still active.  In
order for a device to be 'active' it needs to be associated with a
driver.  So, we create the small boilerplate for a driver and register
nvdimm_bus devices on the 'nvdimm_bus_type' bus.

A result of this change is that ndbusX devices now appear under
/sys/bus/nd/devices.  In fact this makes /sys/class/nd somewhat
redundant, but removing that will need to take a long deprecation period
given its use by ndctl binaries in the field.

This change naturally pulls code from drivers/nvdimm/core.c to
drivers/nvdimm/bus.c, so it is a nice code organization clean-up as
well.

Cc: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2016-07-23 11:06:33 -07:00
..
blk.c libnvdimm: use devm_add_action_or_reset() 2016-06-15 14:59:17 -07:00
btt.c Merge branch 'for-4.7/libnvdimm' into libnvdimm-for-next 2016-05-18 10:06:48 -07:00
btt.h libnvdimm, btt: consolidate arena validation 2015-08-14 13:43:04 -04:00
btt_devs.c libnvdimm, pmem, pfn: make pmem_rw_bytes generic and refactor pfn setup 2016-04-22 12:26:23 -07:00
bus.c libnvdimm: register nvdimm_bus devices with an nd_bus driver 2016-07-23 11:06:33 -07:00
claim.c libnvdimm, pmem: use nvdimm_flush() for namespace I/O writes 2016-07-12 15:13:48 -07:00
core.c libnvdimm: register nvdimm_bus devices with an nd_bus driver 2016-07-23 11:06:33 -07:00
dax_devs.c libnvdimm, dax: autodetect support 2016-05-20 22:02:57 -07:00
dimm.c libnvdimm: pmem label sets and namespace instantiation. 2015-06-24 21:24:10 -04:00
dimm_devs.c libnvdimm, nfit: move flush hint mapping to region-device driver-data 2016-07-11 15:09:26 -07:00
e820.c libnvdimm: move ->module to struct nvdimm_bus_descriptor 2016-07-21 20:03:19 -07:00
Kconfig libnvdimm: introduce devm_nvdimm_memremap(), convert nfit_spa_map() users 2016-07-07 17:11:09 -07:00
label.c libnvdimm: infrastructure for btt devices 2015-06-25 04:20:04 -04:00
label.h libnvdimm: write blk label set 2015-06-24 21:24:10 -04:00
Makefile libnvdimm, dax: introduce device-dax infrastructure 2016-05-09 15:35:42 -07:00
namespace_devs.c libnvdimm, dax: introduce device-dax infrastructure 2016-05-09 15:35:42 -07:00
nd-core.h libnvdimm: move ->module to struct nvdimm_bus_descriptor 2016-07-21 20:03:19 -07:00
nd.h libnvdimm: cycle flush hints 2016-07-11 16:16:03 -07:00
pfn.h libnvdimm, dax: autodetect support 2016-05-20 22:02:57 -07:00
pfn_devs.c Merge branch 'for-4.7/dax' into libnvdimm-for-next 2016-05-21 12:33:04 -07:00
pmem.c pmem: clarify a debug print in pmem_clear_poison 2016-07-23 11:06:33 -07:00
pmem.h pmem: kill __pmem address space 2016-07-12 19:25:38 -07:00
region.c libnvdimm: keep region data alive over namespace removal 2016-07-11 16:13:41 -07:00
region_devs.c libnvdimm: cycle flush hints 2016-07-11 16:16:03 -07:00