All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <m@bjorling.me>
To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-nvme@lists.infradead.org, axboe@fb.com
Cc: "Matias Bjørling" <m@bjorling.me>
Subject: [PATCH 07/13] lightnvm: check for NAND flash and its type
Date: Mon, 16 Nov 2015 15:34:41 +0100	[thread overview]
Message-ID: <1447684487-25539-8-git-send-email-m@bjorling.me> (raw)
In-Reply-To: <1447684487-25539-1-git-send-email-m@bjorling.me>

Only NAND flash with SLC and MLC is supported. Make sure to not try to
initialize TLC memory or other non-volatile memory types.

Signed-off-by: Matias Bjørling <m@bjorling.me>
---
 drivers/lightnvm/core.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index f659e60..0985a03 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -185,6 +185,16 @@ static int nvm_core_init(struct nvm_dev *dev)
 	dev->plane_mode = NVM_PLANE_SINGLE;
 	dev->max_rq_size = dev->ops->max_phys_sect * dev->sec_size;
 
+	if (grp->mtype != 0) {
+		pr_err("nvm: memory type not supported\n");
+		return -EINVAL;
+	}
+
+	if (grp->fmtype != 0 && grp->fmtype != 1) {
+		pr_err("nvm: flash type not supported\n");
+		return -EINVAL;
+	}
+
 	if (grp->mpos & 0x020202)
 		dev->plane_mode = NVM_PLANE_DOUBLE;
 	if (grp->mpos & 0x040404)
-- 
2.1.4


WARNING: multiple messages have this Message-ID (diff)
From: m@bjorling.me (Matias Bjørling)
Subject: [PATCH 07/13] lightnvm: check for NAND flash and its type
Date: Mon, 16 Nov 2015 15:34:41 +0100	[thread overview]
Message-ID: <1447684487-25539-8-git-send-email-m@bjorling.me> (raw)
In-Reply-To: <1447684487-25539-1-git-send-email-m@bjorling.me>

Only NAND flash with SLC and MLC is supported. Make sure to not try to
initialize TLC memory or other non-volatile memory types.

Signed-off-by: Matias Bj?rling <m at bjorling.me>
---
 drivers/lightnvm/core.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index f659e60..0985a03 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -185,6 +185,16 @@ static int nvm_core_init(struct nvm_dev *dev)
 	dev->plane_mode = NVM_PLANE_SINGLE;
 	dev->max_rq_size = dev->ops->max_phys_sect * dev->sec_size;
 
+	if (grp->mtype != 0) {
+		pr_err("nvm: memory type not supported\n");
+		return -EINVAL;
+	}
+
+	if (grp->fmtype != 0 && grp->fmtype != 1) {
+		pr_err("nvm: flash type not supported\n");
+		return -EINVAL;
+	}
+
 	if (grp->mpos & 0x020202)
 		dev->plane_mode = NVM_PLANE_DOUBLE;
 	if (grp->mpos & 0x040404)
-- 
2.1.4

  parent reply	other threads:[~2015-11-16 14:37 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 14:34 [PATCH 00/13] lightnvm updates for 4.4-rc2 Matias Bjørling
2015-11-16 14:34 ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 01/13] MAINTAINERS: Add linux-block list to LightNVM for patches Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 02/13] lightnvm: change max_phys_sect to uint Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 03/13] lightnvm: update bad block table format Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 04/13] lightnvm: update alignments for identify command Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 05/13] lightnvm: expose mccap in " Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 06/13] lightnvm: remove unused attrs in nvm_id structs Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` Matias Bjørling [this message]
2015-11-16 14:34   ` [PATCH 07/13] lightnvm: check for NAND flash and its type Matias Bjørling
2015-11-16 14:34 ` [PATCH 08/13] lightnvm: prematurely activate nvm_dev Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 09/13] lightnvm: prevent double free on init error Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 10/13] lightnvm: remove linear and device addr modes Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 11/13] nvme: missing ppaf copy Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 12/13] nvme: remove reserved double word Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 14:34 ` [PATCH 13/13] lightnvm: cleanup queue before target removal Matias Bjørling
2015-11-16 14:34   ` Matias Bjørling
2015-11-16 22:25 ` [PATCH 00/13] lightnvm updates for 4.4-rc2 Jens Axboe
2015-11-16 22:25   ` Jens Axboe

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=1447684487-25539-8-git-send-email-m@bjorling.me \
    --to=m@bjorling.me \
    --cc=axboe@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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.