Skip to contentSkip to conversation

lightnvm: do not load L2P table if not supported

PATCH Applied Javier González 2 participants 2 messages Mar 2, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lightnvm: do not load L2P table if not supported

An Open-Channel SSD can work on two modes: (i) hybrid mode, where the L2P table is maintained both by the host and by the device; and (ii) full host-based, where the L2P table is uniquely maintained by the host. The current rrpc target operates on hybrid mode.

In the advent of a new target implementing the full host-based mode, do not assume that the L2P table must be loaded on the generic media manager; check device properties loaded on the identify command instead.

---
 drivers/lightnvm/gennvm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/lightnvm/gennvm.c +3 -0
index 42c1c2a..0625d42 100644
@@ -257,6 +257,9 @@ static int gennvm_blocks_init(struct nvm_dev *dev, struct gen_nvm *gn)
 		}
 	}
 
+	if (!(dev->identity.dom & NVM_RSP_L2P))
+		return 0;
+
 	if (dev->ops->get_l2p_tbl) {
 		ret = dev->ops->get_l2p_tbl(dev, 0, dev->total_secs,
 							gennvm_block_map, dev);
Signature · 1 line
2.5.0
#1 lore raw
Quoted 20 lines · Javier González

An Open-Channel SSD can work on two modes: (i) hybrid mode, where the L2P table is maintained both by the host and by the device; and (ii) full host-based, where the L2P table is uniquely maintained by the host. The current rrpc target operates on hybrid mode.

In the advent of a new target implementing the full host-based mode, do not assume that the L2P table must be loaded on the generic media manager; check device properties loaded on the identify command instead.

---
  drivers/lightnvm/gennvm.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/lightnvm/gennvm.c +0 -0
index 42c1c2a..0625d42 100644

drivers/lightnvm/gennvm.c static int gennvm_blocks_init(struct nvm_dev *dev, struct gen_nvm *gn) · line 265

Quoted 9 lines
drivers/lightnvm/gennvm.c +3 -0
@@ -257,6 +257,9 @@ static int gennvm_blocks_init(struct nvm_dev *dev, struct gen_nvm *gn)
  		}
  	}
 
+	if (!(dev->identity.dom & NVM_RSP_L2P))
+		return 0;
+
  	if (dev->ops->get_l2p_tbl) {
  		ret = dev->ops->get_l2p_tbl(dev, 0, dev->total_secs,
  							gennvm_block_map, dev);

Thanks, applied for 4.6.