linux-stable/drivers/lightnvm
Simon A. F. Lund 40267efddc lightnvm: expose device geometry through sysfs
For a host to access an Open-Channel SSD, it has to know its geometry,
so that it writes and reads at the appropriate device bounds.

Currently, the geometry information is kept within the kernel, and not
exported to user-space for consumption. This patch exposes the
configuration through sysfs and enables user-space libraries, such as
liblightnvm, to use the sysfs implementation to get the geometry of an
Open-Channel SSD.

The sysfs entries are stored within the device hierarchy, and can be
found using the "lightnvm" device type.

An example configuration looks like this:

/sys/class/nvme/
└── nvme0n1
   ├── capabilities: 3
   ├── device_mode: 1
   ├── erase_max: 1000000
   ├── erase_typ: 1000000
   ├── flash_media_type: 0
   ├── media_capabilities: 0x00000001
   ├── media_type: 0
   ├── multiplane: 0x00010101
   ├── num_blocks: 1022
   ├── num_channels: 1
   ├── num_luns: 4
   ├── num_pages: 64
   ├── num_planes: 1
   ├── page_size: 4096
   ├── prog_max: 100000
   ├── prog_typ: 100000
   ├── read_max: 10000
   ├── read_typ: 10000
   ├── sector_oob_size: 0
   ├── sector_size: 4096
   ├── media_manager: gennvm
   ├── ppa_format: 0x380830082808001010102008
   ├── vendor_opcode: 0
   ├── max_phys_secs: 64
   └── version: 1

Signed-off-by: Simon A. F. Lund <slund@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
2016-09-21 07:57:31 -06:00
..
core.c lightnvm: expose device geometry through sysfs 2016-09-21 07:57:31 -06:00
gennvm.c lightnvm: fix lun offset calculation for mark blk 2016-07-07 08:51:52 -06:00
gennvm.h lightnvm: move target mgmt into media mgr 2016-07-07 08:51:52 -06:00
Kconfig lightnvm: NVM should depend on HAS_DMA 2016-09-21 07:56:10 -06:00
lightnvm.h lightnvm: expose device geometry through sysfs 2016-09-21 07:57:31 -06:00
Makefile lightnvm: expose device geometry through sysfs 2016-09-21 07:57:31 -06:00
rrpc.c block: get rid of bio_rw and READA 2016-07-20 17:37:01 -06:00
rrpc.h lightnvm: make rrpc_map_page call nvm_get_blk outside locks 2016-07-07 08:51:52 -06:00
sysblk.c lightnvm: Make functions not used by ouside static 2016-07-07 08:51:52 -06:00
sysfs.c lightnvm: expose device geometry through sysfs 2016-09-21 07:57:31 -06:00