Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1631004 > unrolled thread

[PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison

Started byToshi Kani <toshi.kani@hpe.com>
First post2017-04-25 23:20 +0200
Last post2017-04-26 01:00 +0200
Articles 5 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison Toshi Kani <toshi.kani@hpe.com> - 2017-04-25 23:20 +0200
    Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison Vishal Verma <vishal.l.verma@intel.com> - 2017-04-25 23:50 +0200
      Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison "Kani, Toshimitsu" <toshi.kani@hpe.com> - 2017-04-26 00:00 +0200
        Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison Vishal Verma <vishal.l.verma@intel.com> - 2017-04-26 00:30 +0200
          Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison Dan Williams <dan.j.williams@intel.com> - 2017-04-26 01:00 +0200

#1631004 — [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison

FromToshi Kani <toshi.kani@hpe.com>
Date2017-04-25 23:20 +0200
Subject[PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
Message-ID<tAg2m-1uc-25@gated-at.bofh.it>
nvdimm_clear_poison() expects a physical address, not an offset.
Fix nsio_rw_bytes() to call nvdimm_clear_poison() with a physical
address.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
---
 drivers/nvdimm/claim.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index ca6d572..0b31073 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -254,7 +254,8 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
 				&& (!ndns->claim || !is_nd_btt(ndns->claim))) {
 			long cleared;
 
-			cleared = nvdimm_clear_poison(&ndns->dev, offset, size);
+			cleared = nvdimm_clear_poison(&ndns->dev,
+					nsio->res.start + offset, size);
 			if (cleared < size)
 				rc = -EIO;
 			if (cleared > 0 && cleared / 512) {

[toc] | [next] | [standalone]


#1631022

FromVishal Verma <vishal.l.verma@intel.com>
Date2017-04-25 23:50 +0200
Message-ID<tAgvn-1HU-5@gated-at.bofh.it>
In reply to#1631004
On 04/25, Toshi Kani wrote:
> nvdimm_clear_poison() expects a physical address, not an offset.
> Fix nsio_rw_bytes() to call nvdimm_clear_poison() with a physical
> address.

Good catch!

> 
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  drivers/nvdimm/claim.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
> index ca6d572..0b31073 100644
> --- a/drivers/nvdimm/claim.c
> +++ b/drivers/nvdimm/claim.c
> @@ -254,7 +254,8 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
>  				&& (!ndns->claim || !is_nd_btt(ndns->claim))) {
>  			long cleared;
>  
> -			cleared = nvdimm_clear_poison(&ndns->dev, offset, size);
> +			cleared = nvdimm_clear_poison(&ndns->dev,
> +					nsio->res.start + offset, size);

Should we be using nsio->res.start here or nsio->addr ?

>  			if (cleared < size)
>  				rc = -EIO;
>  			if (cleared > 0 && cleared / 512) {

[toc] | [prev] | [next] | [standalone]


#1631027

From"Kani, Toshimitsu" <toshi.kani@hpe.com>
Date2017-04-26 00:00 +0200
Message-ID<tAgF3-1KR-1@gated-at.bofh.it>
In reply to#1631022
On Tue, 2017-04-25 at 15:44 -0600, Vishal Verma wrote:
> On 04/25, Toshi Kani wrote:
> > nvdimm_clear_poison() expects a physical address, not an offset.
> > Fix nsio_rw_bytes() to call nvdimm_clear_poison() with a physical
> > address.
> 
> Good catch!
> 
> > 
> > Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Cc: Dave Jiang <dave.jiang@intel.com>
> > Cc: Vishal Verma <vishal.l.verma@intel.com>
> > ---
> >  drivers/nvdimm/claim.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
> > index ca6d572..0b31073 100644
> > --- a/drivers/nvdimm/claim.c
> > +++ b/drivers/nvdimm/claim.c
> > @@ -254,7 +254,8 @@ static int nsio_rw_bytes(struct
> > nd_namespace_common *ndns,
> >  				&& (!ndns->claim ||
> > !is_nd_btt(ndns->claim))) {
> >  			long cleared;
> >  
> > -			cleared = nvdimm_clear_poison(&ndns->dev,
> > offset, size);
> > +			cleared = nvdimm_clear_poison(&ndns->dev,
> > +					nsio->res.start + offset,
> > size);
> 
> Should we be using nsio->res.start here or nsio->addr ?

nsio->addr is a virtual address.  We need to pass the physical address
of this range.

Thanks,
-Toshi


> 
> >  			if (cleared < size)
> >  				rc = -EIO;
> >  			if (cleared > 0 && cleared / 512) {

[toc] | [prev] | [next] | [standalone]


#1631033

FromVishal Verma <vishal.l.verma@intel.com>
Date2017-04-26 00:30 +0200
Message-ID<tAh85-29H-9@gated-at.bofh.it>
In reply to#1631027
On 04/25, Kani, Toshimitsu wrote:
> On Tue, 2017-04-25 at 15:44 -0600, Vishal Verma wrote:
> > On 04/25, Toshi Kani wrote:
[...]
> >
> > Should we be using nsio->res.start here or nsio->addr ?
> 
> nsio->addr is a virtual address.  We need to pass the physical address
> of this range.

I see - makes sense.
You can add
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>

[toc] | [prev] | [next] | [standalone]


#1631049

FromDan Williams <dan.j.williams@intel.com>
Date2017-04-26 01:00 +0200
Message-ID<tAhB7-2jd-7@gated-at.bofh.it>
In reply to#1631033
On Tue, Apr 25, 2017 at 3:22 PM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> On 04/25, Kani, Toshimitsu wrote:
>> On Tue, 2017-04-25 at 15:44 -0600, Vishal Verma wrote:
>> > On 04/25, Toshi Kani wrote:
> [...]
>> >
>> > Should we be using nsio->res.start here or nsio->addr ?
>>
>> nsio->addr is a virtual address.  We need to pass the physical address
>> of this range.
>
> I see - makes sense.
> You can add
> Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>

Thanks, applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web