diff mbox

acpi, nfit: print command names instead of numbers

Message ID 1467241230-15054-1-git-send-email-vishal.l.verma@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Verma, Vishal L June 29, 2016, 11 p.m. UTC
For the debug prints in acpi_nfit_ctl(), all the prints except the input
buffer dump printed the command name. Make this also do the same for
better readability.

Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 drivers/acpi/nfit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dan Williams June 29, 2016, 11:12 p.m. UTC | #1
On Wed, Jun 29, 2016 at 4:00 PM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> For the debug prints in acpi_nfit_ctl(), all the prints except the input
> buffer dump printed the command name. Make this also do the same for
> better readability.
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  drivers/acpi/nfit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

We used to do this, but nvdimm_cmd_name() currently only knows the
names for the "Intel" DSMs.  At a minimum we should force cmd_name to
"unknown" for the other formats until support is added.
Verma, Vishal L June 29, 2016, 11:19 p.m. UTC | #2
On Wed, 2016-06-29 at 16:12 -0700, Dan Williams wrote:
> On Wed, Jun 29, 2016 at 4:00 PM, Vishal Verma <vishal.l.verma@intel.co

> m> wrote:

> > 

> > For the debug prints in acpi_nfit_ctl(), all the prints except the

> > input

> > buffer dump printed the command name. Make this also do the same for

> > better readability.

> > 

> > Cc: Dan Williams <dan.j.williams@intel.com>

> > Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

> > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>

> > ---

> >  drivers/acpi/nfit.c | 4 ++--

> >  1 file changed, 2 insertions(+), 2 deletions(-)

> We used to do this, but nvdimm_cmd_name() currently only knows the

> names for the "Intel" DSMs.  At a minimum we should force cmd_name to

> "unknown" for the other formats until support is added.


Looks like both the cmd_name functions (for bus and dimm) already do
return 'unknown' when a match isn't found?
Dan Williams June 29, 2016, 11:22 p.m. UTC | #3
On Wed, Jun 29, 2016 at 4:19 PM, Verma, Vishal L
<vishal.l.verma@intel.com> wrote:
> On Wed, 2016-06-29 at 16:12 -0700, Dan Williams wrote:
>> On Wed, Jun 29, 2016 at 4:00 PM, Vishal Verma <vishal.l.verma@intel.co
>> m> wrote:
>> >
>> > For the debug prints in acpi_nfit_ctl(), all the prints except the
>> > input
>> > buffer dump printed the command name. Make this also do the same for
>> > better readability.
>> >
>> > Cc: Dan Williams <dan.j.williams@intel.com>
>> > Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
>> > ---
>> >  drivers/acpi/nfit.c | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> We used to do this, but nvdimm_cmd_name() currently only knows the
>> names for the "Intel" DSMs.  At a minimum we should force cmd_name to
>> "unknown" for the other formats until support is added.
>
> Looks like both the cmd_name functions (for bus and dimm) already do
> return 'unknown' when a match isn't found?

If the value is out of range, but if the cmd number is < 10 it will
print the Intel name which might be wrong.  nvdimm_cmd_name() needs to
take a new 'family id' parameter.
Jerry Hoemann June 30, 2016, 12:05 a.m. UTC | #4
On Wed, Jun 29, 2016 at 04:12:50PM -0700, Dan Williams wrote:
> On Wed, Jun 29, 2016 at 4:00 PM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> > For the debug prints in acpi_nfit_ctl(), all the prints except the input
> > buffer dump printed the command name. Make this also do the same for
> > better readability.
> >
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> > ---
> >  drivers/acpi/nfit.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> We used to do this, but nvdimm_cmd_name() currently only knows the
> names for the "Intel" DSMs.  At a minimum we should force cmd_name to
> "unknown" for the other formats until support is added.


nvdimm_cmd_name has entry:

                [ND_CMD_CALL] = "cmd_call",

The change was to display string version of cmd which should be in
the table.
diff mbox

Patch

diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 2215fc8..d35e3be 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -247,8 +247,8 @@  static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
 	}
 
 	if (IS_ENABLED(CONFIG_ACPI_NFIT_DEBUG)) {
-		dev_dbg(dev, "%s:%s cmd: %d: func: %d input length: %d\n",
-				__func__, dimm_name, cmd, func,
+		dev_dbg(dev, "%s:%s cmd: %s: func: %d input length: %d\n",
+				__func__, dimm_name, cmd_name, func,
 				in_buf.buffer.length);
 		print_hex_dump_debug("nvdimm in  ", DUMP_PREFIX_OFFSET, 4, 4,
 			in_buf.buffer.pointer,