diff mbox series

[v2] lightnvm: pblk: ignore the smeta oob area scan

Message ID 1540510706-32603-1-git-send-email-zjwu@marvell.com (mailing list archive)
State New, archived
Headers show
Series [v2] lightnvm: pblk: ignore the smeta oob area scan | expand

Commit Message

Zhoujie Wu Oct. 25, 2018, 11:38 p.m. UTC
The smeta area l2p mapping is empty, and actually the
recovery procedure only need to restore data sector's l2p
mapping. So ignore the smeta oob scan.

Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
---
v2: Modified based on suggestion from Hans. The smeta may not start from
paddr 0 if the first block is bad. Use pblk_line_smeta_start to calculate
the smeta start address.

 drivers/lightnvm/pblk-recovery.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Matias Bjorling Oct. 26, 2018, 8:08 a.m. UTC | #1
On 10/26/2018 01:38 AM, Zhoujie Wu wrote:
> The smeta area l2p mapping is empty, and actually the
> recovery procedure only need to restore data sector's l2p
> mapping. So ignore the smeta oob scan.
> 
> Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
> ---
> v2: Modified based on suggestion from Hans. The smeta may not start from
> paddr 0 if the first block is bad. Use pblk_line_smeta_start to calculate
> the smeta start address.
> 
>   drivers/lightnvm/pblk-recovery.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
> index 5740b75..0fbd30e 100644
> --- a/drivers/lightnvm/pblk-recovery.c
> +++ b/drivers/lightnvm/pblk-recovery.c
> @@ -334,6 +334,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>   			       struct pblk_recov_alloc p)
>   {
>   	struct nvm_tgt_dev *dev = pblk->dev;
> +	struct pblk_line_meta *lm = &pblk->lm;
>   	struct nvm_geo *geo = &dev->geo;
>   	struct ppa_addr *ppa_list;
>   	struct pblk_sec_meta *meta_list;
> @@ -342,12 +343,12 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>   	void *data;
>   	dma_addr_t dma_ppa_list, dma_meta_list;
>   	__le64 *lba_list;
> -	u64 paddr = 0;
> +	u64 paddr = pblk_line_smeta_start(pblk, line) + lm->smeta_sec;
>   	bool padded = false;
>   	int rq_ppas, rq_len;
>   	int i, j;
>   	int ret;
> -	u64 left_ppas = pblk_sec_in_open_line(pblk, line);
> +	u64 left_ppas = pblk_sec_in_open_line(pblk, line) - lm->smeta_sec;
>   
>   	if (pblk_line_wp_is_unbalanced(pblk, line))
>   		pblk_warn(pblk, "recovering unbalanced line (%d)\n", line->id);
> 

Looks good to me. Hans, can I add your reviewed by?
Javier Gonzalez Oct. 26, 2018, 8:42 a.m. UTC | #2
> On 26 Oct 2018, at 01.35, Zhoujie Wu <zjwu@marvell.com> wrote:
> 
> The smeta area l2p mapping is empty, and actually the
> recovery procedure only need to restore data sector's l2p
> mapping. So ignore the smeta oob scan.
> 
> Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
> ---
> v2: Modified based on suggestion from Hans. The smeta may not start from
> paddr 0 if the first block is bad. Use pblk_line_smeta_start to calculate
> the smeta start address.
> 
> drivers/lightnvm/pblk-recovery.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
> index 5740b75..0fbd30e 100644
> --- a/drivers/lightnvm/pblk-recovery.c
> +++ b/drivers/lightnvm/pblk-recovery.c
> @@ -334,6 +334,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>                   struct pblk_recov_alloc p)
> {
>    struct nvm_tgt_dev *dev = pblk->dev;
> +    struct pblk_line_meta *lm = &pblk->lm;
>    struct nvm_geo *geo = &dev->geo;
>    struct ppa_addr *ppa_list;
>    struct pblk_sec_meta *meta_list;
> @@ -342,12 +343,12 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>    void *data;
>    dma_addr_t dma_ppa_list, dma_meta_list;
>    __le64 *lba_list;
> -    u64 paddr = 0;
> +    u64 paddr = pblk_line_smeta_start(pblk, line) + lm->smeta_sec;
>    bool padded = false;
>    int rq_ppas, rq_len;
>    int i, j;
>    int ret;
> -    u64 left_ppas = pblk_sec_in_open_line(pblk, line);
> +    u64 left_ppas = pblk_sec_in_open_line(pblk, line) - lm->smeta_sec;
> 
>    if (pblk_line_wp_is_unbalanced(pblk, line))
>        pblk_warn(pblk, "recovering unbalanced line (%d)\n", line->id);
> -- 
> 1.9.1
> 

Looks good to me.

Reviewed-by: Javier González <javier@javigon.com>
Hans Holmberg Oct. 26, 2018, 11:49 a.m. UTC | #3
Yes, please do.

Reviewed-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
On Fri, Oct 26, 2018 at 10:08 AM Matias Bjørling <mb@lightnvm.io> wrote:
>
> On 10/26/2018 01:38 AM, Zhoujie Wu wrote:
> > The smeta area l2p mapping is empty, and actually the
> > recovery procedure only need to restore data sector's l2p
> > mapping. So ignore the smeta oob scan.
> >
> > Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
> > ---
> > v2: Modified based on suggestion from Hans. The smeta may not start from
> > paddr 0 if the first block is bad. Use pblk_line_smeta_start to calculate
> > the smeta start address.
> >
> >   drivers/lightnvm/pblk-recovery.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
> > index 5740b75..0fbd30e 100644
> > --- a/drivers/lightnvm/pblk-recovery.c
> > +++ b/drivers/lightnvm/pblk-recovery.c
> > @@ -334,6 +334,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
> >                              struct pblk_recov_alloc p)
> >   {
> >       struct nvm_tgt_dev *dev = pblk->dev;
> > +     struct pblk_line_meta *lm = &pblk->lm;
> >       struct nvm_geo *geo = &dev->geo;
> >       struct ppa_addr *ppa_list;
> >       struct pblk_sec_meta *meta_list;
> > @@ -342,12 +343,12 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
> >       void *data;
> >       dma_addr_t dma_ppa_list, dma_meta_list;
> >       __le64 *lba_list;
> > -     u64 paddr = 0;
> > +     u64 paddr = pblk_line_smeta_start(pblk, line) + lm->smeta_sec;
> >       bool padded = false;
> >       int rq_ppas, rq_len;
> >       int i, j;
> >       int ret;
> > -     u64 left_ppas = pblk_sec_in_open_line(pblk, line);
> > +     u64 left_ppas = pblk_sec_in_open_line(pblk, line) - lm->smeta_sec;
> >
> >       if (pblk_line_wp_is_unbalanced(pblk, line))
> >               pblk_warn(pblk, "recovering unbalanced line (%d)\n", line->id);
> >
>
> Looks good to me. Hans, can I add your reviewed by?
Matias Bjorling Oct. 26, 2018, 6:46 p.m. UTC | #4
On 10/26/2018 01:49 PM, Hans Holmberg wrote:
> Yes, please do.
> 
> Reviewed-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
> On Fri, Oct 26, 2018 at 10:08 AM Matias Bjørling <mb@lightnvm.io> wrote:
>>
>> On 10/26/2018 01:38 AM, Zhoujie Wu wrote:
>>> The smeta area l2p mapping is empty, and actually the
>>> recovery procedure only need to restore data sector's l2p
>>> mapping. So ignore the smeta oob scan.
>>>
>>> Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
>>> ---
>>> v2: Modified based on suggestion from Hans. The smeta may not start from
>>> paddr 0 if the first block is bad. Use pblk_line_smeta_start to calculate
>>> the smeta start address.
>>>
>>>    drivers/lightnvm/pblk-recovery.c | 5 +++--
>>>    1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
>>> index 5740b75..0fbd30e 100644
>>> --- a/drivers/lightnvm/pblk-recovery.c
>>> +++ b/drivers/lightnvm/pblk-recovery.c
>>> @@ -334,6 +334,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>>>                               struct pblk_recov_alloc p)
>>>    {
>>>        struct nvm_tgt_dev *dev = pblk->dev;
>>> +     struct pblk_line_meta *lm = &pblk->lm;
>>>        struct nvm_geo *geo = &dev->geo;
>>>        struct ppa_addr *ppa_list;
>>>        struct pblk_sec_meta *meta_list;
>>> @@ -342,12 +343,12 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>>>        void *data;
>>>        dma_addr_t dma_ppa_list, dma_meta_list;
>>>        __le64 *lba_list;
>>> -     u64 paddr = 0;
>>> +     u64 paddr = pblk_line_smeta_start(pblk, line) + lm->smeta_sec;
>>>        bool padded = false;
>>>        int rq_ppas, rq_len;
>>>        int i, j;
>>>        int ret;
>>> -     u64 left_ppas = pblk_sec_in_open_line(pblk, line);
>>> +     u64 left_ppas = pblk_sec_in_open_line(pblk, line) - lm->smeta_sec;
>>>
>>>        if (pblk_line_wp_is_unbalanced(pblk, line))
>>>                pblk_warn(pblk, "recovering unbalanced line (%d)\n", line->id);
>>>
>>
>> Looks good to me. Hans, can I add your reviewed by?

Thanks. Applied for 4.21/5.1.
diff mbox series

Patch

diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
index 5740b75..0fbd30e 100644
--- a/drivers/lightnvm/pblk-recovery.c
+++ b/drivers/lightnvm/pblk-recovery.c
@@ -334,6 +334,7 @@  static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
 			       struct pblk_recov_alloc p)
 {
 	struct nvm_tgt_dev *dev = pblk->dev;
+	struct pblk_line_meta *lm = &pblk->lm;
 	struct nvm_geo *geo = &dev->geo;
 	struct ppa_addr *ppa_list;
 	struct pblk_sec_meta *meta_list;
@@ -342,12 +343,12 @@  static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
 	void *data;
 	dma_addr_t dma_ppa_list, dma_meta_list;
 	__le64 *lba_list;
-	u64 paddr = 0;
+	u64 paddr = pblk_line_smeta_start(pblk, line) + lm->smeta_sec;
 	bool padded = false;
 	int rq_ppas, rq_len;
 	int i, j;
 	int ret;
-	u64 left_ppas = pblk_sec_in_open_line(pblk, line);
+	u64 left_ppas = pblk_sec_in_open_line(pblk, line) - lm->smeta_sec;
 
 	if (pblk_line_wp_is_unbalanced(pblk, line))
 		pblk_warn(pblk, "recovering unbalanced line (%d)\n", line->id);