Re: [PATCH 2/9] lightnvm: pblk: recover partially written lines correctly

2017-10-03 Thread Javier González
& nr_lbas < nr_valid_lbas; i++) { > + for (i = data_start; i < data_end; i++) { > struct ppa_addr ppa; > int pos; > > -- > 2.7.4 LGTM. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 3/9] lightnvm: pblk: free full lines during recovery

2017-10-03 Thread Javier González
t; diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index eaf5397..f76583b 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -831,6 +831,7 @@ void pblk_gc_should_start(struct pblk *pblk); > void pblk_gc_should_stop(struct pblk *pblk); > void pbl

Re: [PATCH 4/9] lightnvm: pblk: start gc if needed during init

2017-10-03 Thread Javier González
start GC */ > + pblk_gc_should_kick(pblk); > + > return pblk; > > fail_stop_writer: > -- > 2.7.4 LGTM. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 5/6] lightnvm: pblk: free up mempool allocation for erases correctly

2017-10-03 Thread Javier González
> On 2 Oct 2017, at 19.18, Rakesh Pandit <rak...@tuxera.com> wrote: > > On Mon, Oct 02, 2017 at 03:25:10PM +0300, Rakesh Pandit wrote: >> On Mon, Oct 02, 2017 at 02:09:35PM +0200, Javier González wrote: >>>> On 1 Oct 2017, at 15.25, Rakesh Pandit <rak...

Re: [PATCH] lightnvm: pblk: use vfree_atomic when freeing line metadata

2017-10-03 Thread Javier González
> On 3 Oct 2017, at 16.43, Javier González <j...@lightnvm.io> wrote: > >> On 3 Oct 2017, at 16.20, Andrey Ryabinin <aryabi...@virtuozzo.com> wrote: >> >> >> >> On 10/03/2017 05:11 PM, Javier González wrote: >>>> On 3 Oct 201

Re: [PATCH] lightnvm: pblk: use vfree_atomic when freeing line metadata

2017-10-03 Thread Javier González
> On 3 Oct 2017, at 16.07, Andrey Ryabinin wrote: > > > > On 10/03/2017 04:48 PM, Hans Holmberg wrote: >> From: Hans Holmberg >> >> The commit bf22e37a6413 ("mm: add vfree_atomic()") made vfree unsafe to >> call in atomic context (unless

Re: [PATCH] lightnvm: pblk: use vfree_atomic when freeing line metadata

2017-10-03 Thread Javier González
> On 3 Oct 2017, at 16.20, Andrey Ryabinin <aryabi...@virtuozzo.com> wrote: > > > > On 10/03/2017 05:11 PM, Javier González wrote: >>> On 3 Oct 2017, at 16.07, Andrey Ryabinin <aryabi...@virtuozzo.com> wrote: >>> >>> >>> &

[PATCH 3/3] nvme: fix eui_show() print format

2017-11-03 Thread Javier González
Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index ae8ab0a1ef0d..f05c81774abf 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvm

[PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Javier González
On the rw path, the ns is assumed to be set. However, a check is still done, inherited from the time the code resided at nvme_queue_rq(). Eliminate this check, which also eliminates a smatch complain for not doing proper NULL checks on ns. Signed-off-by: Javier González <jav...@cnexlabs.

[PATCH 0/3] nvme: small fixes reported by smatch

2017-11-03 Thread Javier González
Fix a number of small things reported by smatch on the nvme driver Javier González (3): nvme: do not check for ns on rw path nvme: compare NQN string with right size nvme: fix eui_show() print format drivers/nvme/host/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH 2/3] nvme: compare NQN string with right size

2017-11-03 Thread Javier González
Compare subnqns using NVMF_NQN_SIZE as it is < 256 Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index bd1d5ff911c9..ae8ab0a1ef

Re: [PATCH 2/3] nvme: compare NQN string with right size

2017-11-03 Thread Javier González
> On 3 Nov 2017, at 13.54, Christoph Hellwig <h...@lst.de> wrote: > > On Fri, Nov 03, 2017 at 11:02:49AM +0100, Javier González wrote: >> Compare subnqns using NVMF_NQN_SIZE as it is < 256 >> >> Signed-off-by: Javier González <jav...@cnexlabs.com> >

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Javier González
> On 3 Nov 2017, at 13.53, Christoph Hellwig wrote: > >> -if (ns && ns->ms && >> +if (ns->ms && >> (!ns->pi_type || ns->ms != sizeof(struct t10_pi_tuple)) && >> !blk_integrity_rq(req) && !blk_rq_is_passthrough(req)) >> return BLK_STS_NOTSUPP; >

Re: [PATCH 3/3] nvme: fix eui_show() print format

2017-11-04 Thread Javier González
> On 3 Nov 2017, at 16.16, Joe Perches <j...@perches.com> wrote: > > On Fri, 2017-11-03 at 13:55 +0100, Christoph Hellwig wrote: >> On Fri, Nov 03, 2017 at 11:02:50AM +0100, Javier González wrote: >>> Signed-off-by: Javier González <jav...@cnexlabs.com> >

[PATCH v2] nvme: compare NQN string with right size

2017-11-08 Thread Javier González
From: Javier González <j...@lightnvm.io> Copy subnqns using NVMF_NQN_SIZE as it is < 256 Changes since V1: - Fix commit message to indicate that it is a copy and not a comparison. Signed-off-by: Javier González <jav...@cnexlabs.com> Reviewed-by: Christoph Hellwig <h...@ls

[PATCH v2] nvme: fix eui_show() print format

2017-11-08 Thread Javier González
From: Javier González <j...@lightnvm.io> Fix print formatting, but keep the original output to prevent user breakage as suggested by Joe Perches. Change since v1: - Maintain the original output format printing spaces instead of dashes Signed-off-by: Javier González <jav...@cne

Re: [PATCH 3/3] nvme: fix eui_show() print format

2017-11-07 Thread Javier González
> On 7 Nov 2017, at 17.28, Christoph Hellwig <h...@lst.de> wrote: > > On Sat, Nov 04, 2017 at 12:22:20PM +0100, Javier González wrote: >>> Perhaps this should just become >>> >>>%8ph >>> >>> without D >> >> That w

Re: [PATCH] lightnvm: Convert timers to use timer_setup()

2017-10-25 Thread Javier González
> On 25 Oct 2017, at 20.24, Jens Axboe <ax...@kernel.dk> wrote: > >> On 10/25/2017 01:53 AM, Javier González wrote: >> One thing though: The patch does not apply on top of Jen's for-15/block. >> It is trivial, but here you have a version that applies. > >

fix pblk testing leftover

2017-10-24 Thread Javier González
Hi Jens, I just noticed a testing leftover that made it in one of this window's patches. Can you pick this up (and eventually squash it)? Thanks, Javier Javier González (1): lightnvm: pblk: remove testing leftover drivers/lightnvm/pblk.h | 5 - 1 file changed, 5 deletions(-) -- 2.7.4

[PATCH] lightnvm: pblk: remove testing leftover

2017-10-24 Thread Javier González
fixes: 8bd400204bd5 ("lightnvm: pblk: cleanup unused and static functions") Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk.h | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 6b64288de6

Re: [PATCH] lightnvm: Convert timers to use timer_setup()

2017-10-25 Thread Javier González
imer_list *t) > { > - struct rrpc *rrpc = (struct rrpc *)data; > + struct rrpc *rrpc = from_timer(rrpc, t, gc_timer); > > rrpc_gc_kick(rrpc); > mod_timer(>gc_timer, jiffies + msecs_to_jiffies(10)); > @@ -1063,7 +1063,7 @@ static int rrpc_gc_init(struct rrpc *rrpc)

[PATCH 05/11] lightnvm: pblk: warn in case of corrupted write buffer

2018-04-30 Thread Javier González
g the issue. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-rb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/lightnvm/pblk-rb.c b/drivers/lightnvm/pblk-rb.c index 7a632913475f..024a366a995c 100644 --- a/drivers/lightnvm/pblk-r

[V2 PATCH 00/11] lightnvm: pblk: small fixes

2018-04-30 Thread Javier González
A bunch of small fixes and extra checks for pblk. Non is critical, though ("lightnvm: pblk: check for chunk size before allocating it") might be nice to get into 4.17 as it is a fix for the 2.0 pblk patches. Javier Javier González (11): lightnvm: pblk: fail gracefully on line alloc. failure

[PATCH 07/11] lightnvm: pblk: remove unnecessary indirection

2018-04-30 Thread Javier González
Call nvm_submit_io directly and remove an unnecessary indirection on the read path. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-read.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/lightnvm/pblk-read.c b/d

[PATCH 11/11] lightnvm: pblk: remove dead function

2018-04-30 Thread Javier González
Remove dead function for manual sync. I/O Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 7 --- drivers/lightnvm/pblk.h | 1 - 2 files changed, 8 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c

[PATCH 03/11] lightnvm: pblk: check read lba on gc path

2018-04-30 Thread Javier González
Check that the lba stored in the LBA metadata is correct in the GC path too. This requires a new helper function to check random reads in the vector read. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-read.c | 39 +--

[PATCH 04/11] lightnvn: pblk: improve error msg on corrupted LBAs

2018-04-30 Thread Javier González
In the event of a mismatch between the read LBA and the metadata pointer reported by the device, improve the error message to be able to detect the offending physical address (PPA) mapped to the corrupted LBA. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-

[PATCH 06/11] lightnvm: pblk: return NVM_ error on failed submission

2018-04-30 Thread Javier González
Return a meaningful error when the sanity vector I/O check fails. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnv

[PATCH 01/11] lightnvm: pblk: fail gracefully on line alloc. failure

2018-04-30 Thread Javier González
In the event of a line failing to allocate, fail gracefully and stop the pipeline to avoid more write failing in the same place. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 5 + drivers/lightnvm/pblk-map.c

[PATCH 10/11] lightnvn: pass flag on graceful teardown to targets

2018-04-30 Thread Javier González
know when this happens. In the case of pblk, we pad the open line (close all open chunks) to improve data retention. In the event of an ungraceful shutdown, avoid this part and just clean up. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/core.c | 10 +-

[PATCH 08/11] lightnvm: pblk: remove unnecessary argument

2018-04-30 Thread Javier González
Remove unnecessary argument on pblk_line_free() Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 6 +++--- drivers/lightnvm/pblk-init.c | 2 +- drivers/lightnvm/pblk.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/d

[PATCH 09/11] lightnvm: pblk: check for chunk size before allocating it

2018-04-30 Thread Javier González
Do the check for the chunk state after making sure that the chunk type is supported. Fixes: 32ef9412c114 ("lightnvm: pblk: implement get log report chunk") Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 6 +++--- 1 file changed, 3

[PATCH 02/11] lightnvm: pblk: recheck for bad lines at runtime

2018-04-30 Thread Javier González
Bad blocks can grow at runtime. Check that the number of valid blocks in a line are within the sanity threshold before allocating the line for new writes. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 38 -- d

Re: [GIT PULL 24/25] lightnvm: pblk: add iostat support

2018-01-08 Thread Javier González
> On 8 Jan 2018, at 12.54, Christoph Hellwig <h...@infradead.org> wrote: > > On Fri, Jan 05, 2018 at 07:33:36PM +0100, Matias Bjørling wrote: >> On 01/05/2018 04:42 PM, Jens Axboe wrote: >>> On Fri, Jan 05 2018, Matias Bjørling wrote: >>>>

Re: [PATCH] lightnvm/pblk-gc: Delete an error message for a failed memory allocation in pblk_gc_line_prepare_ws()

2018-01-17 Thread Javier González
n[0], l_mg->emeta_alloc_type, > GFP_KERNEL); > -- > 2.15.1 Looks good to me. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH] lightnvm: remove chnl_offset in nvme_nvm_identity

2018-01-30 Thread Javier González
hanged, remove > them. > > Signed-off-by: Matias Bjørling <m...@lightnvm.io> > --- > drivers/nvme/host/lightnvm.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > Looks good. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 1/2] lightnvm: remove mlc pairs structure

2018-01-30 Thread Javier González
> On 30 Jan 2018, at 21.26, Matias Bjørling wrote: > > The known implementations of the 1.2 specification, and upcoming 2.0 > implementation all expose a sequential list of pages to write. > Remove the data structure, as it is no longer needed. > > Signed-off-by: Matias

Re: [PATCH 2/2] lightnvm: remove multiple groups in 1.2 data structure

2018-01-30 Thread Javier González
> On 30 Jan 2018, at 21.26, Matias Bjørling wrote: > > Only one id group from the 1.2 specification is supported. Make > sure that only the first group is accessible. > > Signed-off-by: Matias Bjørling > --- > drivers/nvme/host/lightnvm.c | 5 +++-- > 1 file

[PATCH 3/5] lightnvm: pblk: export write amplification counters to sysfs

2018-01-30 Thread Javier González
emeta sector of each written line. There is plenty of space in the first emeta sector, so we don't need to bump the major version of the line data format. Signed-off-by: Hans Holmberg <hans.holmb...@cnexlabs.com> Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pb

[PATCH 1/5] lightnvm: pblk: handle bad sectors in the emeta area correctly

2018-01-30 Thread Javier González
From: Hans Holmberg Unless we check if there are bad sectors in the entire emeta-area we risk ending up with valid bitmap / available sector count inconsistency. This results in lines with a bad chunk at the last LUN marked as bad, so go through the whole emeta area

[PATCH 4/5] lightnvm: pblk: add padding distribution sysfs attribute

2018-01-30 Thread Javier González
ed-off-by: Hans Holmberg <hans.holmb...@cnexlabs.com> Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 16 -- drivers/lightnvm/pblk-rb.c| 15 +- drivers/lightnvm/pblk-sysfs.c | 68 +++ drive

[PATCH 5/5] lightnvm: pblk: refactor bad block identification

2018-01-30 Thread Javier González
In preparation for the OCSSD 2.0 spec. bad block identification, refactor the current code to generalize bad block get/set functions and structures. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 213 +++ d

[PATCH 2/5] lightnvm: pblk: check data lines version on recovery

2018-01-30 Thread Javier González
com> Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 9 - drivers/lightnvm/pblk-recovery.c | 26 -- drivers/lightnvm/pblk.h | 16 ++-- 3 files changed, 46 insertions(+), 5 deletions(-) diff

Re: [PATCH 1/2] lightnvm: remove mlc pairs structure

2018-01-31 Thread Javier González
> On 31 Jan 2018, at 16.35, Matias Bjørling <m...@lightnvm.io> wrote: > > On 01/31/2018 03:00 AM, Javier González wrote: >>> On 30 Jan 2018, at 21.26, Matias Bjørling <m...@bjorling.me> wrote: >>> >>> The known implementations of the 1.2 specif

[PATCH 0/8] lightnvm: pblk: implement support for 2.0

2018-02-13 Thread Javier González
. Javier González (8): lightnvm: exposed generic geometry to targets lightnvm: show generic geometry in sysfs lightnvm: add support for 2.0 address format lightnvm: convert address based on spec. version lightnvm: implement get log report chunk helpers lightnvm: pblk: implement get log

[PATCH 1/8] lightnvm: exposed generic geometry to targets

2018-02-13 Thread Javier González
and populates a generic geometry that is then given to the targets on creation. Since the 2.0 geometry is much more abstract that 1.2, the generic geometry resembles 2.0, but it is not identical, as it needs to understand 1.2 abstractions too. Signed-off-by: Javier González <jav...@cnexlabs.

[PATCH 8/8] lightnvm: pblk: implement 2.0 support

2018-02-13 Thread Javier González
Implement 2.0 support in pblk. This includes the address formatting and mapping paths, as well as the sysfs entries for them. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 57 ++-- drivers/lightnvm/pblk-sysfs.c | 36 ++-- drivers/li

[PATCH 7/8] lightnvm: pblk: refactor init/exit sequences

2018-02-13 Thread Javier González
Refactor init and exit sequences to improve readability. In the way, fix bad free ordering on the init error path. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 503 ++- 1 file changed, 254 insertions(+

[PATCH 5/8] lightnvm: implement get log report chunk helpers

2018-02-13 Thread Javier González
From: Javier González <jav...@javigon.com> The 2.0 spec provides a report chunk log page that can be retrieved using the stangard nvme get log page. This replaces the dedicated get/put bad block table in 1.2. This patch implements the helper functions to allow targets retrieve the chunk me

[PATCH 6/8] lightnvm: pblk: implement get log report chunk

2018-02-13 Thread Javier González
From: Javier González <jav...@javigon.com> In preparation of pblk supporting 2.0, implement the get log report chunk in pblk. This patch only replicates de bad block functionality as the rest of the metadata requires new pblk functionality (e.g., wear-index to implement wear-le

[PATCH 4/8] lightnvm: convert address based on spec. version

2018-02-13 Thread Javier González
Create the device ppa for both 1.2 and 2.0. Signed-off-by: Javier González <jav...@cnexlabs.com> --- include/linux/lightnvm.h | 52 +--- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/include/linux/lightnvm.h b/include/linux/ligh

[PATCH 2/8] lightnvm: show generic geometry in sysfs

2018-02-13 Thread Javier González
From: Javier González <jav...@javigon.com> Apart from showing the geometry returned by the different identify commands, provide the generic geometry too, as this is the geometry that targets will use to describe the device. Signed-off-by: Javier González <jav...@cnexlabs.com> ---

[PATCH 3/8] lightnvm: add support for 2.0 address format

2018-02-13 Thread Javier González
Add support for 2.0 address format. Also, align address bits for 1.2 and 2.0 to align. Signed-off-by: Javier González <jav...@cnexlabs.com> --- include/linux/lightnvm.h | 45 - 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/i

Re: [PATCH 6/8] lightnvm: pblk: implement get log report chunk

2018-02-15 Thread Javier González
> On 15 Feb 2018, at 02.59, Matias Bjørling <m...@lightnvm.io> wrote: > > On 02/13/2018 03:06 PM, Javier González wrote: >> From: Javier González <jav...@javigon.com> >> In preparation of pblk supporting 2.0, implement the get log report >> chunk in pbl

Re: [PATCH 5/8] lightnvm: implement get log report chunk helpers

2018-02-15 Thread Javier González
> On 15 Feb 2018, at 04.51, Matias Bjørling <m...@lightnvm.io> wrote: > > On 02/13/2018 03:06 PM, Javier González wrote: >> From: Javier González <jav...@javigon.com> >> The 2.0 spec provides a report chunk log page that can be retrieved >> using the st

[PATCH 06/20] lightnvm: add shorten OCSSD version in geo

2018-02-21 Thread Javier González
Create a shorten version to use in the generic geometry. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/nvme/host/lightnvm.c | 6 ++ include/linux/lightnvm.h | 8 2 files changed, 14 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvm

[PATCH 05/20] lightnvm: rename number of channels and luns

2018-02-21 Thread Javier González
Normalize nomenclature for naming number of channels and number of luns in order to improve readability. Use num_ch and num_lun. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/core.c | 69 ++-- drivers/lightnvm/pblk-

[PATCH 08/20] lightnvm: complete geo structure with maxoc*

2018-02-21 Thread Javier González
Complete the generic geometry structure with the maxoc and maxocpu felds, present in the 2.0 spec. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/nvme/host/lightnvm.c | 4 include/linux/lightnvm.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/nvm

[PATCH 02/20] lightnvm: add controller capabilities to 2.0

2018-02-21 Thread Javier González
Assign missing mccap value on 2.0 path Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/nvme/host/lightnvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index c81e64cc20d7..969bb874850c 100644 --- a/d

[PATCH 20/20] lightnvm: pblk: implement 2.0 support

2018-02-21 Thread Javier González
Implement 2.0 support in pblk. This includes the address formatting and mapping paths, as well as the sysfs entries for them. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 57 ++-- drivers/lightnvm/pblk-sysfs.c | 36 ++-- drivers/li

[PATCH 19/20] lightnvm: pblk: refactor init/exit sequences

2018-02-21 Thread Javier González
Refactor init and exit sequences to improve readability. In the way, fix bad free ordering on the init error path. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 503 ++- 1 file changed, 254 insertions(+

[PATCH 04/20] lightnvm: add minor version to generic geometry

2018-02-21 Thread Javier González
Separate the version between major and minor on the generic geometry. Also, add a "subversion" entry to sysfs to expose the minor version without breaking user space. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/core.c | 4 ++-- drivers/nvme

[PATCH 03/20] lightnvm: fix capabilities for 2.0 sysfs

2018-02-21 Thread Javier González
Both 1.2 and 2.0 specs define a field for media and controller capabilities. Also, 1.2 defines a separate field dedicated to device capabilities. In 2.0 sysfs, this values have been mixed. Revert them to the right value. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/nvm

[PATCH 09/20] lightnvm: use generic identify structure

2018-02-21 Thread Javier González
Create a generic identify structure to collect the identify information before knowing the spec. version. This forces different version paths to cast the structure to their spec structure, thus making the code less error prone and more maintainable. Signed-off-by: Javier González <

[PATCH 07/20] lightnvm: rename sect_* to sec_*

2018-02-21 Thread Javier González
Rename abbreviations for sector from sect_* to sec_* as most of the code uses this format and it is confusing when using the different structures. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 8 drivers/lightnvm/pblk-sysfs.c | 4 ++-- d

[PATCH 17/20] lightnvm: define chunk states

2018-02-21 Thread Javier González
ity checks. This state is transparent for the device. Signed-off-by: Javier González <jav...@cnexlabs.com> --- include/linux/lightnvm.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index bc43700c37ec..4df

[PATCH 16/20] lightnvm: implement get log report chunk helpers

2018-02-21 Thread Javier González
From: Javier González <jav...@javigon.com> The 2.0 spec provides a report chunk log page that can be retrieved using the stangard nvme get log page. This replaces the dedicated get/put bad block table in 1.2. This patch implements the helper functions to allow targets retrieve the chunk me

Re: [PATCH 0/3] pblk bugfixes

2018-02-21 Thread Javier González
race in pblk_rb_flush_point_set >> drivers/lightnvm/pblk-core.c | 7 --- >> drivers/lightnvm/pblk-init.c | 2 +- >> drivers/lightnvm/pblk-rb.c | 7 --- >> 3 files changed, 5 insertions(+), 11 deletions(-) > > Thanks Hans. Applied. You can add Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

[PATCH 01/20] lightnvm: simplify geometry structure.

2018-02-21 Thread Javier González
that are shared across instances. As we introduce support for 2.0, these structures allow to abstract spec. specific values and present a common geometry to targets. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/core.c | 137 +++- drivers/lightnvm/pblk-

[PATCH 18/20] lightnvm: pblk: implement get log report chunk

2018-02-21 Thread Javier González
From: Javier González <jav...@javigon.com> In preparation of pblk supporting 2.0, implement the get log report chunk in pblk. This patch only replicates de bad block functionality as the rest of the metadata requires new pblk functionality (e.g., wear-index to implement wear-le

[PATCH V2 00/20] lightnvm: pblk: implement 2.0 support

2018-02-21 Thread Javier González
the address formatting and mapping paths, as well as the sysfs entries for them. Javier Javier González (20): lightnvm: simplify geometry structure. lightnvm: add controller capabilities to 2.0 lightnvm: fix capabilities for 2.0 sysfs lightnvm: add minor version to generic geometry

[PATCH 12/20] lightnvm: complete 2.0 values in sysfs

2018-02-21 Thread Javier González
Add missing geometry values to sysfs. Namely, maxoc and maxocpu. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/nvme/host/lightnvm.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 70dc47

[PATCH 15/20] nvme: make nvme_get_log_ext available

2018-02-21 Thread Javier González
Make nvme_get_log_ext available outside of core.c. This is in preparation for using it in lightnvm.c Signed-off-by: Javier González <javier@cnexlabs.> --- drivers/nvme/host/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h

[PATCH 14/20] lightnvm: make address conversions depend on generic device

2018-02-21 Thread Javier González
On address conversions, use the generic device, instead of the target device. This allows to use conversions outside of the target's realm. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/core.c | 4 ++-- include/linux/lightnvm.h | 8 2 files chan

[PATCH 13/20] lightnvm: add support for 2.0 address format

2018-02-21 Thread Javier González
Add support for 2.0 address format. Also, align address bits for 1.2 and 2.0 to be able to operate on channel and luns without requiring a format conversion. Use a generic address format for this purpose. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/core.c

[PATCH 10/20] lightnvm: pblk: rename ppaf* to addrf*

2018-02-21 Thread Javier González
In preparation for 2.0 support in pblk, rename variables referring to the address format to addrf and reserve ppaf for the 1.2 path. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 8 drivers/lightnvm/pblk-sysfs.c | 4 ++-- drivers/li

[PATCH 11/20] lightnvm: pblk: check for supported version

2018-02-21 Thread Javier González
At this point, only 1.2 spec is supported, thus check for it. Also, since device-side L2P is only supported in the 1.2 spec, make sure to only check its value under 1.2. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 10 -- 1 file chan

Re: [PATCH 20/20] lightnvm: pblk: implement 2.0 support

2018-02-21 Thread Javier González
ier González <j...@lightnvm.io> wrote: > > Implement 2.0 support in pblk. This includes the address formatting and > mapping paths, as well as the sysfs entries for them. > > Signed-off-by: Javier González <jav...@cnexlabs.com> > --- > drivers/lightnvm/pblk-init.c |

Re: [PATCH 04/20] lightnvm: add minor version to generic geometry

2018-02-21 Thread Javier González
> On 22 Feb 2018, at 08.34, Matias Bjørling <m...@lightnvm.io> wrote: > > On 02/21/2018 10:26 AM, Javier González wrote: >> Separate the version between major and minor on the generic geometry. >> Also, add a "subversion" entry to sysfs to expose the minor v

Re: [PATCH 09/20] lightnvm: use generic identify structure

2018-02-21 Thread Javier González
> On 22 Feb 2018, at 08.47, Matias Bjørling <m...@lightnvm.io> wrote: > > On 02/21/2018 10:26 AM, Javier González wrote: >> Create a generic identify structure to collect the identify information >> before knowing the spec. version. This forces different version pat

Re: [PATCH 2/8] lightnvm: show generic geometry in sysfs

2018-02-19 Thread Javier González
>>> This breaks user-space. The intention is for user-space to decide >>> based on version id. Then it can either retrieve the 1.2 or 2.0 >>> attributes. The 2.0 attributes should not be available when a device >>> is 1.2. >>> >> Why does it break it? I'm only adding new entries. >> The

Re: [PATCH] lightnvm: fix memory leak in pblk_luns_init

2018-02-23 Thread Javier González
> On 23 Feb 2018, at 07.12, Matias Bjørling wrote: > > On 02/23/2018 12:03 AM, Huaicheng Li wrote: >> Please ignore my previous email as I found the memory is free'ed at >> pblk_init()'s error handling logic. >> Sorry for the interruption. >> On Thu, Feb 22, 2018 at 3:01 PM,

[PATCH] lightnvm: pblk: take write semaphore on metadata

2018-08-03 Thread Javier González
in the metdatada scheme could cause ordering issues. Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 14 -- drivers/lightnvm/pblk.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index

[PATCH 0/3] lightnvm: pblk: support variable OOB size

2018-08-29 Thread Javier González
for outlined metadata for the case where the reported OOB area is 0. It should be pretty simple to do that on top of these patches though. Thanks, Javier Javier González (3): lightnvm: use internal allocation for chunk log page lightnvm: do no update csecs and sos on 1.2 lightnvm: pblk: support

[PATCH V4] lightnvm: simplify geometry structure

2018-02-27 Thread Javier González
Sending this separately as it seems to be the controversial one. # Changes since V3 >From Matias: - Remove nvm_common_geo - Do appropriate renames when having a single geometry for device and targets Javier Javier González (1): lightnvm: simplify geometry structure. drivers/light

[PATCH] lightnvm: simplify geometry structure.

2018-02-27 Thread Javier González
values that are shared across instances. As we introduce support for 2.0, these structures allow to abstract spec. specific values and present a common geometry to targets. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/core.c | 114 + d

Re: [PATCH 17/19] lightnvm: pblk: implement get log report chunk

2018-02-27 Thread Javier González
> On 27 Feb 2018, at 19.46, Matias Bjørling <m...@lightnvm.io> wrote: > > On 02/27/2018 03:40 PM, Javier González wrote: >>> On 26 Feb 2018, at 20.04, Matias Bjørling <m...@lightnvm.io> wrote: > >>> Can you help me understand why you want to use The

Re: [PATCH V2] lightnvm: pblk: remove unused variable

2018-03-01 Thread Javier González
> On 1 Mar 2018, at 11.07, Matias Bjørling <m...@lightnvm.io> wrote: > > On 02/28/2018 04:57 PM, Javier González wrote: >> # Changes since V1: >> - Rebase on top of latest 2.0 changes >> Javier González (1): >> lightnvm: pblk: remove unused variab

Re: [PATCH 12/15] lightnvn: pblk: use generic address format

2018-03-01 Thread Javier González
> On 1 Mar 2018, at 11.41, Matias Bjørling <m...@lightnvm.io> wrote: > > On 02/28/2018 04:49 PM, Javier González wrote: >> Use the generic address format on common address manipulations. >> Signed-off-by: Javier González <jav...@cnexlabs.com> >> ---

[PATCH] lightnvm: pblk: refactor init/exit sequences

2018-03-01 Thread Javier González
Refactor init and exit sequences to eliminate dependencies among init modules and improve readability. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 415 +-- 1 file changed, 206 insertions(+), 209 del

[PATCH] lightnvm: pblk: refactor init/exit sequences

2018-03-01 Thread Javier González
Refactor init and exit sequences to eliminate dependencies among init modules and improve readability. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 412 +-- 1 file changed, 206 insertions(+), 206 del

[PATCH] lightnvm: pblk: refactor init/exit sequences

2018-03-01 Thread Javier González
be sending a V5 for it, this should not be a problem. Thanks, Javier Javier González (1): lightnvm: pblk: refactor init/exit sequences drivers/lightnvm/pblk-init.c | 412 +-- 1 file changed, 206 insertions(+), 206 deletions(-) -- 2.7.4

[PATCH V2] lightnvm: pblk: refactor init/exit sequences

2018-03-01 Thread Javier González
is probably what I should have done from the beginning. Since I'll be sending a V5 for it, this should not be a problem. Thanks, Javier Javier González (1): lightnvm: pblk: refactor init/exit sequences drivers/lightnvm/pblk-init.c | 415 +-- 1 file changed

Re: [PATCH] lightnvm: pblk: take bitmap alloc. out of critical section

2018-04-18 Thread Javier González
> On 17 Apr 2018, at 04.48, Matias Bjørling <m...@lightnvm.io> wrote: > > On 4/16/18 12:21 PM, Javier González wrote: >> Allocate line bitmaps outside of the line lock on line preparation. >> Signed-off-by: Javier González <jav...@cnexlabs.com> > > >

[PATCH] lightnvm: pblk: take bitmap alloc. out of critical section

2018-04-18 Thread Javier González
pblk allocates line bitmaps within the line lock unnecessarily. In order to take pressure out of the fast patch, allocate line bitmaps outside of this lock and refactor accordingly. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.

[PATCH V2] lightnvm: pblk: take bitmap alloc. out of critical section

2018-04-18 Thread Javier González
Changes since V1 - from Matias: - rename a function to line__reinit - propagate error code - improve commit message Javier González (1): lightnvm: pblk: take bitmap alloc. out of critical section drivers/lightnvm/pblk-core.c | 97 +--- 1 file changed

Re: [PATCH 08/11] lightnvm: pblk: remove unnecessary argument

2018-04-18 Thread Javier González
Javier > On 17 Apr 2018, at 05.12, Matias Bjørling <m...@lightnvm.io> wrote: > > On 4/16/18 12:25 PM, Javier González wrote: >> Remove unnecessary argument on pblk_line_free() > > Why was the argument no longer needed? You can see it is not used... It a straig

Re: [PATCH 03/11] lightnvm: pblk: check read lba on gc path

2018-04-18 Thread Javier González
> On 17 Apr 2018, at 05.03, Matias Bjørling <m...@lightnvm.io> wrote: > > On 4/16/18 12:25 PM, Javier González wrote: >> Check that the lba stored in the LBA metadata is correct in the GC path >> too. This requires a new helper function to check random reads in the &g

[PATCH] lightnvm: pblk: take bitmap alloc. out of critical section

2018-04-16 Thread Javier González
Allocate line bitmaps outside of the line lock on line preparation. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 96 +--- 1 file changed, 55 insertions(+), 41 deletions(-) diff --git a/drivers/lightnv

[PATCH] lightnvm: pblk: remove unnecessary bio_get/put

2018-04-16 Thread Javier González
oid pointer bouncing for the different read paths. Now, the incoming bio always resides in the read context and pblk's internal bios (if any) reside in rqd->bio. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-read.c | 57 +++-

<    1   2   3   4   5   6   7   8   9   10   >