diff mbox series

[v2] cxl/mbox: Add debug messages for enabled mailbox commands

Message ID 20230125085728.234697-1-rrichter@amd.com
State Accepted
Commit ee611e5e6616f7981939cc0441a5fb531312c2b6
Headers show
Series [v2] cxl/mbox: Add debug messages for enabled mailbox commands | expand

Commit Message

Robert Richter Jan. 25, 2023, 8:57 a.m. UTC
Only unsupported mailbox commands are reported in debug messages. A
list of enabled commands is useful too. Change debug messages to also
report the opcodes of enabled commands. Esp. if card initialization
fails there is no way to get this information from userland.

On that occasion also add missing trailing newlines.

Signed-off-by: Robert Richter <rrichter@amd.com>
---
v2:
 * Changed message to "Opcode 0x%04x enabled\n". Updated patch
   description accordingly.

 drivers/cxl/core/mbox.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2

Comments

Jonathan Cameron Jan. 25, 2023, 10:29 a.m. UTC | #1
On Wed, 25 Jan 2023 09:57:28 +0100
Robert Richter <rrichter@amd.com> wrote:

> Only unsupported mailbox commands are reported in debug messages. A
> list of enabled commands is useful too. Change debug messages to also
> report the opcodes of enabled commands. Esp. if card initialization
> fails there is no way to get this information from userland.
> 
> On that occasion also add missing trailing newlines.
> 
> Signed-off-by: Robert Richter <rrichter@amd.com>
Fine with change in message
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
> v2:
>  * Changed message to "Opcode 0x%04x enabled\n". Updated patch
>    description accordingly.
> 
>  drivers/cxl/core/mbox.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index a48ade466d6a..202d49dd9911 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -629,11 +629,12 @@ static void cxl_walk_cel(struct cxl_dev_state *cxlds, size_t size, u8 *cel)
>  
>  		if (!cmd) {
>  			dev_dbg(cxlds->dev,
> -				"Opcode 0x%04x unsupported by driver", opcode);
> +				"Opcode 0x%04x unsupported by driver\n", opcode);
>  			continue;
>  		}
>  
>  		set_bit(cmd->info.id, cxlds->enabled_cmds);
> +		dev_dbg(cxlds->dev, "Opcode 0x%04x enabled\n", opcode);
>  	}
>  }
>  
> 
> base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
Alison Schofield Jan. 25, 2023, 3:52 p.m. UTC | #2
On Wed, Jan 25, 2023 at 09:57:28AM +0100, Robert Richter wrote:
> Only unsupported mailbox commands are reported in debug messages. A
> list of enabled commands is useful too. Change debug messages to also
> report the opcodes of enabled commands. Esp. if card initialization
> fails there is no way to get this information from userland.
> 
> On that occasion also add missing trailing newlines.
> 
> Signed-off-by: Robert Richter <rrichter@amd.com>
> ---
> v2:
>  * Changed message to "Opcode 0x%04x enabled\n". Updated patch
>    description accordingly.

Thanks Robert,
Reviewed-by: Alison Schofield <alison.schofield@intel.com>

> 
>  drivers/cxl/core/mbox.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index a48ade466d6a..202d49dd9911 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -629,11 +629,12 @@ static void cxl_walk_cel(struct cxl_dev_state *cxlds, size_t size, u8 *cel)
>  
>  		if (!cmd) {
>  			dev_dbg(cxlds->dev,
> -				"Opcode 0x%04x unsupported by driver", opcode);
> +				"Opcode 0x%04x unsupported by driver\n", opcode);
>  			continue;
>  		}
>  
>  		set_bit(cmd->info.id, cxlds->enabled_cmds);
> +		dev_dbg(cxlds->dev, "Opcode 0x%04x enabled\n", opcode);
>  	}
>  }
>  
> 
> base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
> -- 
> 2.30.2
>
Dan Williams Jan. 26, 2023, 11:58 p.m. UTC | #3
Robert Richter wrote:
> Only unsupported mailbox commands are reported in debug messages. A
> list of enabled commands is useful too. Change debug messages to also
> report the opcodes of enabled commands. Esp. if card initialization
> fails there is no way to get this information from userland.
> 
> On that occasion also add missing trailing newlines.
> 
> Signed-off-by: Robert Richter <rrichter@amd.com>
> ---
> v2:
>  * Changed message to "Opcode 0x%04x enabled\n". Updated patch
>    description accordingly.

Thanks Robert, replaced v1 with v2 in my tree. Should show up on
cxl/pending shortly.
diff mbox series

Patch

diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index a48ade466d6a..202d49dd9911 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -629,11 +629,12 @@  static void cxl_walk_cel(struct cxl_dev_state *cxlds, size_t size, u8 *cel)
 
 		if (!cmd) {
 			dev_dbg(cxlds->dev,
-				"Opcode 0x%04x unsupported by driver", opcode);
+				"Opcode 0x%04x unsupported by driver\n", opcode);
 			continue;
 		}
 
 		set_bit(cmd->info.id, cxlds->enabled_cmds);
+		dev_dbg(cxlds->dev, "Opcode 0x%04x enabled\n", opcode);
 	}
 }