* [PATCH] daxctl: phys_index value 0 is valid
@ 2020-10-20 5:27 Aneesh Kumar K.V
2020-11-09 5:11 ` Aneesh Kumar K.V
0 siblings, 1 reply; 3+ messages in thread
From: Aneesh Kumar K.V @ 2020-10-20 5:27 UTC (permalink / raw)
To: linux-nvdimm, dan.j.williams, vishal.l.verma; +Cc: Aneesh Kumar K.V
On power platforms we can find
# cat /sys/devices/system/memory/memory0/phys_index
00000000
This results in
libdaxctl: memblock_in_dev: dax1.0: memory0: Unable to determine phys_index: Success
Avoid considering phys_index == 0 as error.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
daxctl/lib/libdaxctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
index ee4a069eb463..3cb89c755978 100644
--- a/daxctl/lib/libdaxctl.c
+++ b/daxctl/lib/libdaxctl.c
@@ -1229,7 +1229,7 @@ static int memblock_in_dev(struct daxctl_memory *mem, const char *memblock)
rc = sysfs_read_attr(ctx, path, buf);
if (rc == 0) {
phys_index = strtoul(buf, NULL, 16);
- if (phys_index == 0 || phys_index == ULONG_MAX) {
+ if (phys_index == ULONG_MAX) {
rc = -errno;
err(ctx, "%s: %s: Unable to determine phys_index: %s\n",
devname, memblock, strerror(-rc));
--
2.26.2
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] daxctl: phys_index value 0 is valid
2020-10-20 5:27 [PATCH] daxctl: phys_index value 0 is valid Aneesh Kumar K.V
@ 2020-11-09 5:11 ` Aneesh Kumar K.V
2020-11-09 19:08 ` Dan Williams
0 siblings, 1 reply; 3+ messages in thread
From: Aneesh Kumar K.V @ 2020-11-09 5:11 UTC (permalink / raw)
To: linux-nvdimm, dan.j.williams, vishal.l.verma
Hi All,
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> writes:
> On power platforms we can find
> # cat /sys/devices/system/memory/memory0/phys_index
> 00000000
>
> This results in
>
> libdaxctl: memblock_in_dev: dax1.0: memory0: Unable to determine phys_index: Success
>
> Avoid considering phys_index == 0 as error.
A gentle ping for this patch. Will appreciate a feedback on this
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---
> daxctl/lib/libdaxctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
> index ee4a069eb463..3cb89c755978 100644
> --- a/daxctl/lib/libdaxctl.c
> +++ b/daxctl/lib/libdaxctl.c
> @@ -1229,7 +1229,7 @@ static int memblock_in_dev(struct daxctl_memory *mem, const char *memblock)
> rc = sysfs_read_attr(ctx, path, buf);
> if (rc == 0) {
> phys_index = strtoul(buf, NULL, 16);
> - if (phys_index == 0 || phys_index == ULONG_MAX) {
> + if (phys_index == ULONG_MAX) {
> rc = -errno;
> err(ctx, "%s: %s: Unable to determine phys_index: %s\n",
> devname, memblock, strerror(-rc));
> --
> 2.26.2
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] daxctl: phys_index value 0 is valid
2020-11-09 5:11 ` Aneesh Kumar K.V
@ 2020-11-09 19:08 ` Dan Williams
0 siblings, 0 replies; 3+ messages in thread
From: Dan Williams @ 2020-11-09 19:08 UTC (permalink / raw)
To: Aneesh Kumar K.V; +Cc: linux-nvdimm
On Sun, Nov 8, 2020 at 9:11 PM Aneesh Kumar K.V
<aneesh.kumar@linux.ibm.com> wrote:
>
>
> Hi All,
>
> "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> writes:
>
> > On power platforms we can find
> > # cat /sys/devices/system/memory/memory0/phys_index
> > 00000000
> >
> > This results in
> >
> > libdaxctl: memblock_in_dev: dax1.0: memory0: Unable to determine phys_index: Success
> >
> > Avoid considering phys_index == 0 as error.
>
>
> A gentle ping for this patch. Will appreciate a feedback on this
Looks good to me. Apologies for the delay.
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-09 19:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 5:27 [PATCH] daxctl: phys_index value 0 is valid Aneesh Kumar K.V
2020-11-09 5:11 ` Aneesh Kumar K.V
2020-11-09 19:08 ` 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.