From: Dan Williams <dan.j.williams@intel.com> To: linux-nvdimm@lists.01.org Cc: willy@linux.intel.com, ross.zwisler@linux.intel.com, linux-kernel@vger.kernel.org Subject: [PATCH 1/9] libnvdimm, pfn: kill ND_PFN_ALIGN Date: Mon, 14 Dec 2015 18:14:34 -0800 [thread overview] Message-ID: <20151215021434.37090.56710.stgit@dwillia2-desk3.jf.intel.com> (raw) In-Reply-To: <20151215021428.37090.30720.stgit@dwillia2-desk3.jf.intel.com> The alignment constraint isn't necessary now that devm_memremap_pages() allows for unaligned mappings. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- drivers/nvdimm/nd.h | 7 ------- drivers/nvdimm/pfn_devs.c | 11 +---------- drivers/nvdimm/pmem.c | 15 --------------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index 417e521d299c..2ce428e9b584 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -29,13 +29,6 @@ enum { ND_MAX_LANES = 256, SECTOR_SHIFT = 9, INT_LBASIZE_ALIGNMENT = 64, -#if IS_ENABLED(CONFIG_NVDIMM_PFN) - ND_PFN_ALIGN = PAGES_PER_SECTION * PAGE_SIZE, - ND_PFN_MASK = ND_PFN_ALIGN - 1, -#else - ND_PFN_ALIGN = 0, - ND_PFN_MASK = 0, -#endif }; struct nvdimm_drvdata { diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index 71805a1aa0f3..96c122918ee1 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -241,10 +241,6 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn) if (!is_nd_pmem(nd_pfn->dev.parent)) return -ENODEV; - /* section alignment for simple hotplug */ - if (nvdimm_namespace_capacity(ndns) < ND_PFN_ALIGN) - return -ENODEV; - if (nvdimm_read_bytes(ndns, SZ_4K, pfn_sb, sizeof(*pfn_sb))) return -ENXIO; @@ -286,12 +282,7 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn) */ offset = le64_to_cpu(pfn_sb->dataoff); nsio = to_nd_namespace_io(&ndns->dev); - if (nsio->res.start & ND_PFN_MASK) { - dev_err(&nd_pfn->dev, - "init failed: %s not section aligned\n", - dev_name(&ndns->dev)); - return -EBUSY; - } else if (offset >= resource_size(&nsio->res)) { + if (offset >= resource_size(&nsio->res)) { dev_err(&nd_pfn->dev, "pfn array size exceeds capacity of %s\n", dev_name(&ndns->dev)); return -EBUSY; diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 8ee79893d2f5..520c00321dad 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -241,11 +241,6 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) if (rc == 0 || rc == -EBUSY) return rc; - /* section alignment for simple hotplug */ - if (nvdimm_namespace_capacity(ndns) < ND_PFN_ALIGN - || pmem->phys_addr & ND_PFN_MASK) - return -ENODEV; - nd_region = to_nd_region(nd_pfn->dev.parent); if (nd_region->ro) { dev_info(&nd_pfn->dev, @@ -326,16 +321,6 @@ static int nvdimm_namespace_attach_pfn(struct nd_namespace_common *ndns) if (rc) return rc; - if (PAGE_SIZE != SZ_4K) { - dev_err(dev, "only supported on systems with 4K PAGE_SIZE\n"); - return -ENXIO; - } - if (nsio->res.start & ND_PFN_MASK) { - dev_err(dev, "%s not memory hotplug section aligned\n", - dev_name(&ndns->dev)); - return -ENXIO; - } - pfn_sb = nd_pfn->pfn_sb; offset = le64_to_cpu(pfn_sb->dataoff); nd_pfn->mode = le32_to_cpu(nd_pfn->pfn_sb->mode);
WARNING: multiple messages have this Message-ID (diff)
From: Dan Williams <dan.j.williams@intel.com> To: linux-nvdimm@ml01.01.org Cc: willy@linux.intel.com, ross.zwisler@linux.intel.com, linux-kernel@vger.kernel.org Subject: [PATCH 1/9] libnvdimm, pfn: kill ND_PFN_ALIGN Date: Mon, 14 Dec 2015 18:14:34 -0800 [thread overview] Message-ID: <20151215021434.37090.56710.stgit@dwillia2-desk3.jf.intel.com> (raw) In-Reply-To: <20151215021428.37090.30720.stgit@dwillia2-desk3.jf.intel.com> The alignment constraint isn't necessary now that devm_memremap_pages() allows for unaligned mappings. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- drivers/nvdimm/nd.h | 7 ------- drivers/nvdimm/pfn_devs.c | 11 +---------- drivers/nvdimm/pmem.c | 15 --------------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index 417e521d299c..2ce428e9b584 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -29,13 +29,6 @@ enum { ND_MAX_LANES = 256, SECTOR_SHIFT = 9, INT_LBASIZE_ALIGNMENT = 64, -#if IS_ENABLED(CONFIG_NVDIMM_PFN) - ND_PFN_ALIGN = PAGES_PER_SECTION * PAGE_SIZE, - ND_PFN_MASK = ND_PFN_ALIGN - 1, -#else - ND_PFN_ALIGN = 0, - ND_PFN_MASK = 0, -#endif }; struct nvdimm_drvdata { diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index 71805a1aa0f3..96c122918ee1 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -241,10 +241,6 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn) if (!is_nd_pmem(nd_pfn->dev.parent)) return -ENODEV; - /* section alignment for simple hotplug */ - if (nvdimm_namespace_capacity(ndns) < ND_PFN_ALIGN) - return -ENODEV; - if (nvdimm_read_bytes(ndns, SZ_4K, pfn_sb, sizeof(*pfn_sb))) return -ENXIO; @@ -286,12 +282,7 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn) */ offset = le64_to_cpu(pfn_sb->dataoff); nsio = to_nd_namespace_io(&ndns->dev); - if (nsio->res.start & ND_PFN_MASK) { - dev_err(&nd_pfn->dev, - "init failed: %s not section aligned\n", - dev_name(&ndns->dev)); - return -EBUSY; - } else if (offset >= resource_size(&nsio->res)) { + if (offset >= resource_size(&nsio->res)) { dev_err(&nd_pfn->dev, "pfn array size exceeds capacity of %s\n", dev_name(&ndns->dev)); return -EBUSY; diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 8ee79893d2f5..520c00321dad 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -241,11 +241,6 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) if (rc == 0 || rc == -EBUSY) return rc; - /* section alignment for simple hotplug */ - if (nvdimm_namespace_capacity(ndns) < ND_PFN_ALIGN - || pmem->phys_addr & ND_PFN_MASK) - return -ENODEV; - nd_region = to_nd_region(nd_pfn->dev.parent); if (nd_region->ro) { dev_info(&nd_pfn->dev, @@ -326,16 +321,6 @@ static int nvdimm_namespace_attach_pfn(struct nd_namespace_common *ndns) if (rc) return rc; - if (PAGE_SIZE != SZ_4K) { - dev_err(dev, "only supported on systems with 4K PAGE_SIZE\n"); - return -ENXIO; - } - if (nsio->res.start & ND_PFN_MASK) { - dev_err(dev, "%s not memory hotplug section aligned\n", - dev_name(&ndns->dev)); - return -ENXIO; - } - pfn_sb = nd_pfn->pfn_sb; offset = le64_to_cpu(pfn_sb->dataoff); nd_pfn->mode = le32_to_cpu(nd_pfn->pfn_sb->mode);
next prev parent reply other threads:[~2015-12-15 2:14 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-12-15 2:14 [PATCH 0/9] libnvdimm, pfn updates for 4.5 Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:14 ` Dan Williams [this message] 2015-12-15 2:14 ` [PATCH 1/9] libnvdimm, pfn: kill ND_PFN_ALIGN Dan Williams 2015-12-15 2:14 ` [PATCH 2/9] libnvdimm, pfn: clean up pfn create parameters Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:14 ` [PATCH 3/9] libnvdimm, pfn: add 'align' attribute, default to HPAGE_SIZE Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:14 ` [PATCH 4/9] libnvdimm, pfn: add parent uuid validation Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:14 ` [PATCH 5/9] libnvdimm, pfn: fix pfn seed creation Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:15 ` [PATCH 6/9] libnvdimm, pfn: enable pfn sysfs interface unit testing Dan Williams 2015-12-15 2:15 ` Dan Williams 2015-12-15 2:15 ` [PATCH 7/9] libnvdimm, pfn: fix nd_pfn_validate() return value handling Dan Williams 2015-12-15 2:15 ` Dan Williams 2015-12-15 2:15 ` [PATCH 8/9] tools/testing/libnvdimm: cleanup mock resource lookup Dan Williams 2015-12-15 2:15 ` Dan Williams 2015-12-15 7:11 ` Dan Williams 2015-12-15 7:11 ` Dan Williams 2015-12-15 2:15 ` [PATCH 9/9] libnvdimm, pfn: move 'memory mode' indication to sysfs Dan Williams 2015-12-15 2:15 ` Dan Williams
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20151215021434.37090.56710.stgit@dwillia2-desk3.jf.intel.com \ --to=dan.j.williams@intel.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-nvdimm@lists.01.org \ --cc=ross.zwisler@linux.intel.com \ --cc=willy@linux.intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.