All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
@ 2017-04-25 21:16 ` Toshi Kani
  0 siblings, 0 replies; 10+ messages in thread
From: Toshi Kani @ 2017-04-25 21:16 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-kernel, linux-nvdimm

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) {
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
@ 2017-04-25 21:16 ` Toshi Kani
  0 siblings, 0 replies; 10+ messages in thread
From: Toshi Kani @ 2017-04-25 21:16 UTC (permalink / raw)
  To: dan.j.williams
  Cc: dave.jiang, vishal.l.verma, linux-nvdimm, linux-kernel, Toshi Kani

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) {

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
  2017-04-25 21:16 ` Toshi Kani
@ 2017-04-25 21:44   ` Vishal Verma
  -1 siblings, 0 replies; 10+ messages in thread
From: Vishal Verma @ 2017-04-25 21:44 UTC (permalink / raw)
  To: Toshi Kani; +Cc: linux-kernel, linux-nvdimm

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) {
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
@ 2017-04-25 21:44   ` Vishal Verma
  0 siblings, 0 replies; 10+ messages in thread
From: Vishal Verma @ 2017-04-25 21:44 UTC (permalink / raw)
  To: Toshi Kani; +Cc: dan.j.williams, dave.jiang, linux-nvdimm, linux-kernel

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) {

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
  2017-04-25 21:44   ` Vishal Verma
@ 2017-04-25 21:49     ` Kani, Toshimitsu
  -1 siblings, 0 replies; 10+ messages in thread
From: Kani, Toshimitsu @ 2017-04-25 21:49 UTC (permalink / raw)
  To: vishal.l.verma; +Cc: linux-kernel, linux-nvdimm

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) {
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
@ 2017-04-25 21:49     ` Kani, Toshimitsu
  0 siblings, 0 replies; 10+ messages in thread
From: Kani, Toshimitsu @ 2017-04-25 21:49 UTC (permalink / raw)
  To: vishal.l.verma
  Cc: dan.j.williams, linux-kernel, dave.jiang, linux-nvdimm@lists.01.org

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) {

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
  2017-04-25 21:49     ` Kani, Toshimitsu
@ 2017-04-25 22:22       ` Vishal Verma
  -1 siblings, 0 replies; 10+ messages in thread
From: Vishal Verma @ 2017-04-25 22:22 UTC (permalink / raw)
  To: Kani, Toshimitsu; +Cc: linux-kernel, linux-nvdimm

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>

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
@ 2017-04-25 22:22       ` Vishal Verma
  0 siblings, 0 replies; 10+ messages in thread
From: Vishal Verma @ 2017-04-25 22:22 UTC (permalink / raw)
  To: Kani, Toshimitsu
  Cc: Williams, Dan J, linux-kernel, Jiang, Dave, linux-nvdimm@lists.01.org

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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
  2017-04-25 22:22       ` Vishal Verma
@ 2017-04-25 22:57         ` Dan Williams
  -1 siblings, 0 replies; 10+ messages in thread
From: Dan Williams @ 2017-04-25 22:57 UTC (permalink / raw)
  To: Vishal Verma; +Cc: linux-kernel, linux-nvdimm

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.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison
@ 2017-04-25 22:57         ` Dan Williams
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Williams @ 2017-04-25 22:57 UTC (permalink / raw)
  To: Vishal Verma
  Cc: Kani, Toshimitsu, linux-kernel, Jiang, Dave, linux-nvdimm@lists.01.org

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-04-25 22:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 21:16 [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison Toshi Kani
2017-04-25 21:16 ` Toshi Kani
2017-04-25 21:44 ` Vishal Verma
2017-04-25 21:44   ` Vishal Verma
2017-04-25 21:49   ` Kani, Toshimitsu
2017-04-25 21:49     ` Kani, Toshimitsu
2017-04-25 22:22     ` Vishal Verma
2017-04-25 22:22       ` Vishal Verma
2017-04-25 22:57       ` Dan Williams
2017-04-25 22:57         ` Dan Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.