1. 07 7月, 2016 8 次提交
  2. 07 5月, 2016 12 次提交
  3. 19 3月, 2016 2 次提交
  4. 04 3月, 2016 4 次提交
  5. 05 2月, 2016 1 次提交
    • M
      lightnvm: allow to force mm initialization · bf643185
      Matias Bjørling 提交于
      System block allows the device to initialize with its configured media
      manager. The system blocks is written to disk, and read again when media
      manager is determined. For this to work, the backend must store the
      data. Device drivers, such as null_blk, does not have any backend
      storage. This patch allows the media manager to be initialized without a
      storage backend.
      
      It also fix incorrect configuration of capabilities in null_blk, as it
      does not support get/set bad block interface.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      bf643185
  6. 12 1月, 2016 13 次提交
    • M
      lightnvm: introduce factory reset · 8b4970c4
      Matias Bjørling 提交于
      Now that a device can be managed using the system blocks, a method to
      reset the device is necessary as well. This patch introduces logic to
      reset the device easily to factory state and exposes it through an
      ioctl.
      
      The ioctl takes the following flags:
      
        NVM_FACTORY_ERASE_ONLY_USER
            By default all blocks, except host-reserved blocks are erased upon
            factory reset. Instead of this, only erase host-reserved blocks.
        NVM_FACTORY_RESET_HOST_BLKS
            Mark host-reserved blocks to be erased and set their type to free.
        NVM_FACTORY_RESET_GRWN_BBLKS
            Mark "grown bad blocks" to be erased and set their type to free.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      8b4970c4
    • M
      lightnvm: use system block for mm initialization · b7692076
      Matias Bjørling 提交于
      Use system block information to register the appropriate media manager.
      This enables the LightNVM subsystem to instantiate a media manager
      selected by the user, instead of relying on automatic detection by each
      media manager loaded in the kernel.
      
      A device must now be initialized before it can proceed to initialize its
      media manager. Upon initialization, the configured media manager is
      automatically initialized as well.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      b7692076
    • M
      lightnvm: introduce ioctl to initialize device · 55696154
      Matias Bjørling 提交于
      Based on the previous patch, we now introduce an ioctl to initialize the
      device using nvm_init_sysblock and create the necessary system blocks.
      The user may specify the media manager that they wish to instantiate on
      top. Default from user-space will be "gennvm".
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      55696154
    • M
      lightnvm: core on-disk initialization · e3eb3799
      Matias Bjørling 提交于
      An Open-Channel SSD shall be initialized before use. To initialize, we
      define an on-disk format, that keeps a small set of metadata to bring up
      the media manager on top of the device.
      
      The initial step is introduced to allow a user to format the disks for a
      given media manager. During format, a system block is stored on one to
      three separate luns on the device. Each lun has the system block
      duplicated. During initialization, the system block can be retrieved and
      the appropriate media manager can initialized.
      
      The on-disk format currently covers (struct nvm_system_block):
      
       - Magic value "NVMS".
       - Monotonic increasing sequence number.
       - The physical block erase count.
       - Version of the system block format.
       - Media manager type.
       - Media manager superblock physical address.
      
      The interface provides three functions to manage the system block:
      
       int nvm_init_sysblock(struct nvm_dev *, struct nvm_sb_info *)
       int nvm_get_sysblock(struct nvm *dev, struct nvm_sb_info *)
       int nvm_update_sysblock(struct nvm *dev, struct nvm_sb_info *)
      
      Each implement a part of the logic to manage the system block. The
      initialization creates the first system blocks and mark them on the
      device. Get retrieves the latest system block by scanning all pages in
      the associated system blocks. The update sysblock writes new metadata
      and allocates new block if necessary.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      e3eb3799
    • M
      lightnvm: introduce mlc lower page table mappings · ca5927e7
      Matias Bjørling 提交于
      NAND MLC memories have both lower and upper pages. When programming,
      both of these must be written, before data can be read. However,
      these lower and upper pages might not placed at even and odd flash
      pages, but can be skipped. Therefore each flash memory has its lower
      pages defined, which can then be used when programming and to know when
      padding are necessary.
      
      This patch implements the lower page definition in the specification,
      and exposes it through a simple lookup table at dev->lptbl.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      ca5927e7
    • M
      lightnvm: add mccap support · f9a99950
      Matias Bjørling 提交于
      Some flash media has extended capabilities, such as programming SLC
      pages on MLC/TLC flash, erase/program suspend, scramble and encryption.
      MCCAP is introduced to detect support for these capabilities in the
      command set.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      f9a99950
    • J
      lightnvm: manage open and closed blocks separately · ff0e498b
      Javier González 提交于
      LightNVM targets need to know the state of the flash block when doing
      flash optimizations. An example is implementing a write buffer to
      respect the flash page size. Currently, block state is not accounted
      for; the media manager only differentiates among free, bad and in-use
      blocks.
      
      This patch adds the logic in the generic media manager to enable
      targets manage blocks into open and close separately, and it implements
      such management in rrpc. It also adds a set of flags to describe the
      state of the block (open, closed, free, bad).
      
      In order to avoid taking two locks (nvm_lun and rrpc_lun) consecutively,
      we introduce lockless get_/put_block primitives so that the open and
      close list locks and future common logic is handled within the nvm_lun
      lock.
      Signed-off-by: NJavier González <javier@cnexlabs.com>
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      ff0e498b
    • M
      lightnvm: introduce nvm_submit_ppa · 09719b62
      Matias Bjørling 提交于
      Internal logic for both core and media managers, does not have a
      backing bio for issuing I/Os. Introduce nvm_submit_ppa to allow raw
      I/Os to be submitted to the underlying device driver.
      
      The function request the device, ppa, data buffer and its length and
      will submit the I/O synchronously to the device. The return value may
      therefore be used to detect any errors regarding the issued I/O.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      09719b62
    • M
      lightnvm: move rq->error to nvm_rq->error · 72d256ec
      Matias Bjørling 提交于
      Instead of passing request error into the LightNVM modules, incorporate
      it into the nvm_rq.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      72d256ec
    • M
      lightnvm: support multiple ppas in nvm_erase_ppa · 81e681d3
      Matias Bjørling 提交于
      Sometimes a user want to erase multiple PPAs at the same time. Extend
      nvm_erase_ppa to take multiple ppas and number of ppas to be erased.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      81e681d3
    • M
      lightnvm: sectors first in ppa list · 556755e9
      Matias Bjørling 提交于
      The Westlake controller requires that the PPA list has sectors defined
      sequentially. Currently, the PPA list is created with planes first, then
      sectors. Change this to sectors first, then planes.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      556755e9
    • M
      lightnvm: refactor end_io functions for sync · 91276162
      Matias Bjørling 提交于
      To implement sync I/O support within the LightNVM core, the end_io
      functions are refactored to take an end_io function pointer instead of
      testing for initialized media manager, followed by calling its end_io
      function.
      
      Sync I/O can then be implemented using a callback that signal I/O
      completion. This is similar to the logic found in blk_to_execute_io().
      By implementing it this way, the underlying device I/Os submission logic
      is abstracted away from core, targets, and media managers.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      91276162
    • M
      lightnvm: refactor rqd ppa list into set/free · abd805ec
      Matias Bjørling 提交于
      A device may be driven in single, double or quad plane mode. In that
      case, the rqd must have either one, two, or four PPAs set for a single
      PPA sent to the device. Refactor this logic into their own
      functions to be shared by program/erase/read in the core.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      abd805ec