- 29 Feb, 2016 40 commits
-
-
Tim Gardner authored
BugLink: http://bugs.launchpad.net/bugs/1531539Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Christoph Hellwig authored
BugLink: http://bugs.launchpad.net/bugs/1531539 We already have the reserved flag, and a nowait flag awkwardly encoded as a gfp_t. Add a real flags argument to make the scheme more extensible and allow for a nicer calling convention. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 6f3b0e8b) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Jens Axboe authored
BugLink: http://bugs.launchpad.net/bugs/1531539 null_blk defines an empty version of this ops structure if CONFIG_NVM isn't set, but it doesn't know the type. Move those bits out of the protection of CONFIG_NVM in the main lightnvm include. Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit a7fd9a4f) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 8b4970c4) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit b7692076) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 55696154) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit e3eb3799) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit ca5927e7) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit f9a99950) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Javier González authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit ff0e498b) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 The get/set bad block interface defines good block, factory bad block, grown bad block, device reserved block, and host reserved block. Unfortunately the grown bad block was missing, leaving the offsets wrong for device and host side reserved blocks. This patch adds the missing type and corrects the offsets. Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit b5d4acd4) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Javier González authored
BugLink: http://bugs.launchpad.net/bugs/1531539 Currently, a rrpc block only points to its nvm_lun. If a user wants to find the associated rrpc lun, it will have to calculate the index and look it up manually. By referencing the rrpc lun directly, this step can be omitted, at the cost of a larger memory footprint. This is important for upcoming patches that implement write buffering in rrpc. Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit d7a64d27) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 09719b62) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 Instead of passing request error into the LightNVM modules, incorporate it into the nvm_rq. Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 72d256ec) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 81e681d3) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Wenwei Tao authored
BugLink: http://bugs.launchpad.net/bugs/1531539 There is no need to check whether dev's pages per block is beyond rrpc support every time we init a lun, we only need to check it once before enter the lun init loop. Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 4b79beb4) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 556755e9) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Wenwei Tao authored
BugLink: http://bugs.launchpad.net/bugs/1531539 This patch fix two issues in rrpc_lun_gc 1. prio_list is protected by rrpc_lun's lock not nvm_lun's, so acquire rlun's lock instead of lun's before operate on the list. 2. we delete block from prio_list before allocating gcb, but gcb allocation may fail, we end without putting it back to the list, this makes the block won't get reclaimed in the future. To solve this issue, delete block after gcb allocation. Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit b262924b) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Wenwei Tao authored
BugLink: http://bugs.launchpad.net/bugs/1531539 We delete a block from the gc list before reclaim it, so put it back to the list on its reclaim fail, otherwise this block will not get reclaimed and be programmable in the future. Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit d0ca798f) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Wenwei Tao authored
BugLink: http://bugs.launchpad.net/bugs/1531539 We should check last io completion status before starting another one. Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 2b11c1b2) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 During get_bb_tbl, a callback is used to allow an user-specific scan function to be called. The callback may return an error, and in that case, the return value is overridden. However, the callback error is needed when the fault is a user error and not a kernel error. For example, when a user tries to initialize the same device twice. The get_bb_tbl callback should be able to communicate this. Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 22513215) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 91276162) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit abd805ec) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Matias Bjørling authored
BugLink: http://bugs.launchpad.net/bugs/1531539 A device may function in single, dual or quad plane mode. The gennvm media manager manages this with explicit helpers. They convert a single ppa to 1, 2 or 4 separate ppas in a ppa list. To aid implementation of recovery and system blocks, this functionality can be moved directly into the core. Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 069368e9) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Wenwei Tao authored
BugLink: http://bugs.launchpad.net/bugs/1531539 When rrpc_write_ppalist_rq and rrpc_read_ppalist_rq succeed, we setup rq correctly, but nvm_submit_io may afterward fail since it cannot allocate request or nvme_nvm_command, we return error but forget to cleanup the previous work. Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit c27278bd) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Javier Gonzalez authored
BugLink: http://bugs.launchpad.net/bugs/1531539 The mempool allocation might fail. Make sure to return error when it does, instead of causing a kernel panic. Signed-off-by: Javier Gonzalez <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 3bfbc6ad) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Chao Yu authored
BugLink: http://bugs.launchpad.net/bugs/1531539 When initing bad block list in gennvm_block_bb, once we move bad block from free_list to bb_list, we should maintain both stat info nr_free_blocks and nr_bad_blocks. So this patch fixes to add missing operation related to nr_free_blocks. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit bdded155) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Wenwei Tao authored
BugLink: http://bugs.launchpad.net/bugs/1531539 Put bio when submission fails, since we get it before submission. And return error when backend device driver doesn't provide a submit_io method, thus we can end IO properly. Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 3cd485b1) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Andy Whitcroft authored
BugLink: http://bugs.launchpad.net/bugs/1536810Signed-off-by: Andy Whitcroft <apw@canonical.com>
-
Andy Whitcroft authored
This reverts commit fac8e7e04e5649ff40cb920385c95c7449a4f6f9. BugLink: http://bugs.launchpad.net/bugs/1538618Signed-off-by: Andy Whitcroft <apw@canonical.com>
-
Vipin K Parashar authored
BugLink: http://bugs.launchpad.net/bugs/1539102 Kernel prints respective warnings about various EPOW events for user information/action after parsing EPOW interrupts. At times below EPOW reset event warning is seen to be flooding kernel log over a period of time. May 25 03:46:34 alp kernel: Non critical power or cooling issue cleared May 25 03:46:52 alp kernel: Non critical power or cooling issue cleared May 25 03:53:48 alp kernel: Non critical power or cooling issue cleared May 25 03:55:46 alp kernel: Non critical power or cooling issue cleared May 25 03:56:34 alp kernel: Non critical power or cooling issue cleared May 25 03:59:04 alp kernel: Non critical power or cooling issue cleared May 25 04:02:01 alp kernel: Non critical power or cooling issue cleared These EPOW reset events are spurious in nature and are triggered by firmware without an actual EPOW event being reset. This patch avoids these multiple EPOW reset warnings by using a counter variable. This variable is incremented every time an EPOW event is reported. Upon receiving a EPOW reset event the same variable is checked to filter out spurious events and decremented accordingly. This patch also improves log messages to better describe EPOW event being reported. Merged adjacent log messages into single one to reduce number of lines printed per event. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> (cherry picked from commit b4af279a) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Tim Gardner authored
Ignore: yes Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Andy Whitcroft authored
Signed-off-by: Andy Whitcroft <apw@canonical.com>
-
Andy Whitcroft authored
In e56f81e0 "dm: refactor ioctl handling" the target specific ioctl operation was removed in favour of providing a mapping to the underlying device, to which ioctls are all assumed to apply. This prevents targets from having target specific ioctls. Introduce a new target_ioctl callback which (if present) is offered the command and arguments for processing. This callback can return -ENOTTY to indicate the ioctl should be passed on to the underlying device as normal. BugLink: http://bugs.launchpad.net/bugs/1538618Signed-off-by: Andy Whitcroft <apw@canonical.com>
-
Andy Whitcroft authored
From 15.10 onwards python2 is no longer the default python and is no longer installed by default. Switch to python3 which is. This delta is much larger than the nominal changes as inconsistent spacing is now an error. I have also corrected the use of loose strings as comments. BugLink: http://bugs.launchpad.net/bugs/1506521Signed-off-by: Andy Whitcroft <apw@canonical.com>
-
Dan Carpenter authored
The "> MAX_CONTEXT" should be ">= MAX_CONTEXT". Otherwise we go one step beyond the end of the cfg->ctx_tbl[] array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Manoj Kumar <manoj@linux.vnet.ibm.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit e37390be) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Tim Gardner authored
This reverts commit c8433a26b0dec49938c6007de4b232ad30af8616. Reverting in favor of upstream e37390beSigned-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Souvik Kumar Chakravarty authored
BugLink: http://bugs.launchpad.net/bugs/1520457 This implements debugfs interfaces for reading the telemetry samples from SSRAM and configuring firmware trace verbosity. Interface created under /sys/kernel/debug/telemetry soc_states: SoC Device and Low Power States pss_info: Info from the Primary SubSystem ioss_info: Info from IO SubSusytem pss_trace_verbosity: Read/Modify PSS F/W trace verbosity ioss_trace_verbosity: Read/Modify IOSS F/W trace verbosity. Signed-off-by: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com> (cherry picked from commit 87bee290) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Souvik Kumar Chakravarty authored
BugLink: http://bugs.launchpad.net/bugs/1520457 Telemetry platform driver implements the telemetry interfaces. Currently it supports ApolloLake. It uses the PUNIT and PMC IPC interfaces to configure the telemetry samples to read. The samples are read from a Secure SRAM region. Signed-off-by: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com> (cherry picked from commit 9d16b482) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-
Souvik Kumar Chakravarty authored
BugLink: http://bugs.launchpad.net/bugs/1520457 Telemetry Device is created by the pmc_ipc driver. Resources are populated according SSRAM region as indicated by the BIOS tables. Signed-off-by: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com> (cherry picked from commit 48c19170) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-