Thanks for the update. This version of the patchset enumerates our NFIT
table properly. :-)
On Tue, 2015-04-28 at 14:25 -0400, Dan Williams wrote:
In preparation for the pmem driver attaching to pmem-namespaces
by libnd, convert it to use an ida instead of an always increasing
atomic index. This provides a bit of stability to pmem device names in
the presence of driver re-bind events.
@@ -122,20 +123,26 @@ static struct pmem_device *pmem_alloc(struct
device *dev, struct resource *res)
struct pmem_device *pmem;
struct gendisk *disk;
- int idx, err;
+ int err;
err = -ENOMEM;
pmem = kzalloc(sizeof(*pmem), GFP_KERNEL);
+ pmem->id = ida_simple_get(&pmem_ida, 0, 0, GFP_KERNEL);
nd_pmem_probe() is called asynchronously via async_schedule_domain
(). We have seen a case that the region#->pmem# binding becomes
inconsistent across a reboot when there are 8 NVDIMM cards (reported by
Robert Elliott). This leads user to access a wrong device.
I think pmem id needs to be assigned before async_schedule_domain(), and
cascaded to nd_pmem_probe().