Skip to contentSkip to conversation

libndctl, dimm: Don't require an xlat function

PATCH In review Oliver O'Halloran 4 participants 5 messages Jan 30, 2019 1 message not in the archive libnvdimm: non-volatile memory device

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libndctl, dimm: Don't require an xlat function

commit 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation") has the unfortunate side effect of making all NDCTL commands fail with -ENOMSG unless an xlat_firmware_status function is defined for the DIMM family. This means that none of the DIMM label manipulation commands work anymore, unless you happen to be using an Intel DIMM.

Cc Vishal Verma <[email protected]>
Fixes 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation")
---
 ndctl/lib/libndctl.c | 3 +++
 1 file changed, 3 insertions(+)
ndctl/lib/libndctl.c +3 -0
index 06f835d76117..80d107394a74 100644
@@ -2846,6 +2846,9 @@ NDCTL_EXPORT int ndctl_cmd_submit_xlat(struct ndctl_cmd *cmd)
 	 * useful), then the xlat function is available separately as well.
 	 */
 	xlat_rc = ndctl_cmd_xlat_firmware_status(cmd);
+	if (xlat_rc == -ENOMSG)
+		return rc;
+
 	return (xlat_rc == 0) ? rc : xlat_rc;
 }
 
Signature · 6 lines
2.20.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
#1 lore raw
Quoted 20 lines · Oliver O'Halloran

commit 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation") has the unfortunate side effect of making all NDCTL commands fail with -ENOMSG unless an xlat_firmware_status function is defined for the DIMM family. This means that none of the DIMM label manipulation commands work anymore, unless you happen to be using an Intel DIMM.

Cc Vishal Verma <[email protected]>
Fixes 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation")
---
 ndctl/lib/libndctl.c | 3 +++
 1 file changed, 3 insertions(+)
ndctl/lib/libndctl.c +0 -0
index 06f835d76117..80d107394a74 100644

ndctl/lib/libndctl.c NDCTL_EXPORT int ndctl_cmd_submit_xlat(struct ndctl_cmd *cmd) · line 2851

Quoted 6 lines
ndctl/lib/libndctl.c +3 -0
@@ -2846,6 +2846,9 @@ NDCTL_EXPORT int ndctl_cmd_submit_xlat(struct ndctl_cmd *cmd)
         * useful), then the xlat function is available separately as well.
         */
        xlat_rc = ndctl_cmd_xlat_firmware_status(cmd);
+       if (xlat_rc == -ENOMSG)
+               return rc;
+

Ah, good point, however I think we should do this instead:

ndctl/lib/libndctl.c +0 -0
index 830b791339d2..2fa89162e05e 100644
@@ -2710,7 +2710,7 @@ NDCTL_EXPORT int

ndctl_cmd_xlat_firmware_status(struct ndctl_cmd *cmd)

        struct ndctl_dimm_ops *ops = dimm ? dimm->ops : NULL;

        if (!dimm || !ops || !ops->xlat_firmware_status)
-               return -ENOMSG;
+               return 0;
        return ops->xlat_firmware_status(cmd);

}

A failure to translate just means proceed with the information that we *do* have, not a failure.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

maintainer
#2 lore raw
Quoted 44 lines · Dan Williams
Quoted 19 lines · Oliver O'Halloran

commit 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation") has the unfortunate side effect of making all NDCTL commands fail with -ENOMSG unless an xlat_firmware_status function is defined for the DIMM family. This means that none of the DIMM label manipulation commands work anymore, unless you happen to be using an Intel DIMM.

Cc Vishal Verma <[email protected]>
Fixes 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation")
---
 ndctl/lib/libndctl.c | 3 +++
 1 file changed, 3 insertions(+)
ndctl/lib/libndctl.c +0 -0
index 06f835d76117..80d107394a74 100644

ndctl/lib/libndctl.c NDCTL_EXPORT int ndctl_cmd_submit_xlat(struct ndctl_cmd *cmd) · line 2851

Quoted 6 lines
ndctl/lib/libndctl.c +3 -0
@@ -2846,6 +2846,9 @@ NDCTL_EXPORT int ndctl_cmd_submit_xlat(struct ndctl_cmd *cmd)
         * useful), then the xlat function is available separately as well.
         */
        xlat_rc = ndctl_cmd_xlat_firmware_status(cmd);
+       if (xlat_rc == -ENOMSG)
+               return rc;
+

Ah, good point, however I think we should do this instead:

ndctl/lib/libndctl.c +1 -1
index 830b791339d2..2fa89162e05e 100644
@@ -2710,7 +2710,7 @@ NDCTL_EXPORT int
 ndctl_cmd_xlat_firmware_status(struct ndctl_cmd *cmd)
        struct ndctl_dimm_ops *ops = dimm ? dimm->ops : NULL;
 
        if (!dimm || !ops || !ops->xlat_firmware_status)
-               return -ENOMSG;
+               return 0;
        return ops->xlat_firmware_status(cmd);
 }
Quoted 2 lines

A failure to translate just means proceed with the information that we *do* have, not a failure.

Ah good catch and I agree. Dan, will you send a proper patch for this or shall I?

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

#3 lore raw
Quoted 47 lines · Vishal L
Quoted 44 lines · Dan Williams
Quoted 19 lines · Oliver O'Halloran

commit 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation") has the unfortunate side effect of making all NDCTL commands fail with -ENOMSG unless an xlat_firmware_status function is defined for the DIMM family. This means that none of the DIMM label manipulation commands work anymore, unless you happen to be using an Intel DIMM.

Cc Vishal Verma <[email protected]>
Fixes 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation")
---
 ndctl/lib/libndctl.c | 3 +++
 1 file changed, 3 insertions(+)
ndctl/lib/libndctl.c +0 -0
index 06f835d76117..80d107394a74 100644

ndctl/lib/libndctl.c NDCTL_EXPORT int ndctl_cmd_submit_xlat(struct ndctl_cmd *cmd) · line 2851

Quoted 6 lines
ndctl/lib/libndctl.c +3 -0
@@ -2846,6 +2846,9 @@ NDCTL_EXPORT int ndctl_cmd_submit_xlat(struct ndctl_cmd *cmd)
         * useful), then the xlat function is available separately as well.
         */
        xlat_rc = ndctl_cmd_xlat_firmware_status(cmd);
+       if (xlat_rc == -ENOMSG)
+               return rc;
+

Ah, good point, however I think we should do this instead:

ndctl/lib/libndctl.c +1 -1
index 830b791339d2..2fa89162e05e 100644
@@ -2710,7 +2710,7 @@ NDCTL_EXPORT int
 ndctl_cmd_xlat_firmware_status(struct ndctl_cmd *cmd)
        struct ndctl_dimm_ops *ops = dimm ? dimm->ops : NULL;
 
        if (!dimm || !ops || !ops->xlat_firmware_status)
-               return -ENOMSG;
+               return 0;
        return ops->xlat_firmware_status(cmd);
 }
Quoted 5 lines
Quoted 2 lines

A failure to translate just means proceed with the information that we *do* have, not a failure.

Ah good catch and I agree. Dan, will you send a proper patch for this or shall I?

Go for it :)
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

A message that is not in the archive (sent off-list or not yet received): CAPcyv4jGYVNbbNZ5Kaw7SpwhH=BW8bgDGcj-80m2XmAKD5-ZEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#5 lore raw
Quoted 60 lines

From: Linux-nvdimm <[email protected]> On Behalf Of Dan Williams
Sent: Wednesday, January 30, 2019 11:08 AM
To: Verma, Vishal L <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] libndctl, dimm: Don't require an xlat function

Quoted 4 lines · Vishal L
Quoted 1 line · Dan Williams

On Wed, Jan 30, 2019 at 2:27 AM Oliver O'Halloran <[email protected]>

Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines

commit 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation") has the unfortunate side effect of making all NDCTL commands fail with -ENOMSG unless an xlat_firmware_status function is defined for the DIMM family. This means that none of the DIMM label manipulation commands work anymore, unless you happen

to be

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

using an Intel DIMM.

Cc Vishal Verma <[email protected]>
Fixes 62bbfce3cb62 ("libndctl, intel: Add infrastructure for

firmware_status translation")

Quoted 10 lines
Quoted 10 lines

ndctl/lib/libndctl.c NDCTL_EXPORT int

Quoted 10 lines
---
 ndctl/lib/libndctl.c | 3 +++
 1 file changed, 3 insertions(+)
ndctl/lib/libndctl.c +0 -0
index 06f835d76117..80d107394a74 100644
@@ -2846,6 +2846,9 @@ NDCTL_EXPORT int

ndctl_cmd_submit_xlat(struct ndctl_cmd *cmd)

Quoted 24 lines
Quoted 24 lines

ndctl/lib/libndctl.c NDCTL_EXPORT int · line 2851

Quoted 6 lines
ndctl/lib/libndctl.c +3 -0
         * useful), then the xlat function is available separately as well.
         */
        xlat_rc = ndctl_cmd_xlat_firmware_status(cmd);
+       if (xlat_rc == -ENOMSG)
+               return rc;
+

Ah, good point, however I think we should do this instead:

ndctl/lib/libndctl.c +1 -1
index 830b791339d2..2fa89162e05e 100644
@@ -2710,7 +2710,7 @@ NDCTL_EXPORT int
 ndctl_cmd_xlat_firmware_status(struct ndctl_cmd *cmd)
        struct ndctl_dimm_ops *ops = dimm ? dimm->ops : NULL;
 
        if (!dimm || !ops || !ops->xlat_firmware_status)
-               return -ENOMSG;
+               return 0;
        return ops->xlat_firmware_status(cmd);
 }
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

A failure to translate just means proceed with the information that we *do* have, not a failure.

Ah good catch and I agree. Dan, will you send a proper patch for this or shall I?

Go for it :)

Glad to know this will be fixed soon.

Thanks,
-- Dexuan