All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Cheng-mean Liu <soccerl@microsoft.com>,
	Matthew Wilcox <mawilcox@microsoft.com>,
	linux-nvdimm@lists.01.org
Subject: [PATCH] nvdimm: Remove minimum size requirement
Date: Mon, 10 Jul 2017 11:32:48 -0700	[thread overview]
Message-ID: <20170710183248.2417-1-willy@infradead.org> (raw)

From: Matthew Wilcox <mawilcox@microsoft.com>

There was no need to have a minimum size of 4MB for NV-DIMMs; it was
just a sanity check.  Keep a check that it's at least one page in size
because we really can't add less than a page to the memory map.  Promote
the print statement from 'debug' level to 'warning', since there was no
information for my colleague who stumbled over this problem while
attempting to add a 2MB chunk of memory.

Reported-by: Cheng-mean Liu <soccerl@microsoft.com>
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
---
 drivers/nvdimm/namespace_devs.c | 6 +++---
 include/uapi/linux/ndctl.h      | 4 ----
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 5f1c6756e57c..95169308078a 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1689,9 +1689,9 @@ struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev)
 	}
 
 	size = nvdimm_namespace_capacity(ndns);
-	if (size < ND_MIN_NAMESPACE_SIZE) {
-		dev_dbg(&ndns->dev, "%pa, too small must be at least %#x\n",
-				&size, ND_MIN_NAMESPACE_SIZE);
+	if (size < PAGE_SIZE) {
+		dev_warn(&ndns->dev, "%pa, too small must be at least %ld\n",
+				&size, PAGE_SIZE);
 		return ERR_PTR(-ENODEV);
 	}
 
diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
index 6d3c54264d8e..3ad1623bb585 100644
--- a/include/uapi/linux/ndctl.h
+++ b/include/uapi/linux/ndctl.h
@@ -299,10 +299,6 @@ enum nd_driver_flags {
 	ND_DRIVER_DAX_PMEM	  = 1 << ND_DEVICE_DAX_PMEM,
 };
 
-enum {
-	ND_MIN_NAMESPACE_SIZE = 0x00400000,
-};
-
 enum ars_masks {
 	ARS_STATUS_MASK = 0x0000FFFF,
 	ARS_EXT_STATUS_SHIFT = 16,
-- 
2.11.0

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

             reply	other threads:[~2017-07-10 18:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 18:32 Matthew Wilcox [this message]
2017-07-10 18:41 ` [PATCH] nvdimm: Remove minimum size requirement Dan Williams
2017-07-10 20:30   ` Matthew Wilcox
     [not found]     ` <20170710203012.GB22476-PfSpb0PWhxZc2C7mugBRk2EX/6BAtgUQ@public.gmane.org>
2017-07-10 20:32       ` Cheng-mean Liu (SOCCER)
2017-07-10 20:32     ` Dan Williams
2017-07-12 15:04       ` Matthew Wilcox
2017-07-12 17:13         ` Dan Williams
     [not found]           ` <CAPcyv4h_=L=F9Gtf9NARH1vV4L0GBtRaUiSjZH-j5OeAdkV5Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-13  5:49             ` Socer Liu
2017-07-14  0:13               ` Dan Williams
     [not found]                 ` <CAPcyv4jhGSo4RZtiXHKFNwzYwM_YcfoVZx0d4V=iLzdX622rKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-07 18:09                   ` Cheng-mean Liu (SOCCER)
2017-08-07 18:13                     ` Dan Williams
2017-08-31 22:30                       ` Dan Williams
     [not found]                         ` <CAPcyv4iA1ObGd9miPSOCc=YRziAxWXhC9NSL_TDo97g2t=dp_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-01 15:44                           ` Socer Liu
     [not found] <1447312903.5521261.1505950873135.ref@mail.yahoo.com>
2017-09-20 23:41 ` Soccer Liu
     [not found]   ` <1447312903.5521261.1505950873135-sAHhhX/85wgbqTNvkayDYw@public.gmane.org>
2018-01-02 22:23     ` Cheng-mean Liu (SOCCER)

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=20170710183248.2417-1-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mawilcox@microsoft.com \
    --cc=soccerl@microsoft.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: link
Be 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.