From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752074AbbD2Soh (ORCPT ); Wed, 29 Apr 2015 14:44:37 -0400 Received: from g4t3426.houston.hp.com ([15.201.208.54]:50060 "EHLO g4t3426.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbbD2Sod (ORCPT ); Wed, 29 Apr 2015 14:44:33 -0400 Message-ID: <1430331934.23761.100.camel@misato.fc.hp.com> Subject: Re: [Linux-nvdimm] [PATCH v2 10/20] pmem: use ida From: Toshi Kani To: Dan Williams Cc: linux-nvdimm@ml01.01.org, Christoph Hellwig , linux-kernel@vger.kernel.org Date: Wed, 29 Apr 2015 12:25:34 -0600 In-Reply-To: <20150428182506.35812.4007.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20150428181203.35812.60474.stgit@dwillia2-desk3.amr.corp.intel.com> <20150428182506.35812.4007.stgit@dwillia2-desk3.amr.corp.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dan, 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 emitted > 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); > if (!pmem) > goto out; > > + 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(). -Toshi