drm/xe/sysctrl: Add mailbox control state to error messages
Subsystems (2)
PATCH 1/1 drm/xe/sysctrl: Add mailbox control state to error messages
From: Anoop Vijay <[email protected]>
Include decoded mailbox control register information in mailbox busy, timeout and firmware error paths to provide additional context for failure debugging
--- drivers/gpu/drm/xe/xe_sysctrl_mailbox.c | 60 ++++++++++++++++++------- 1 file changed, 45 insertions(+), 15 deletions(-)
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +45 -15
@@ -7,6 +7,7 @@#include <linux/cleanup.h> #include <linux/minmax.h> #include <linux/slab.h> +#include <linux/sprintf.h> #include <linux/string.h> #include "regs/xe_sysctrl_regs.h"
@@ -36,17 +37,28 @@ struct xe_sysctrl_mailbox_msg_hdr { REG_FIELD_GET(SYSCTRL_HDR_RESULT_MASK, (hdr)->data)static int sysctrl_wait_bit_clear (struct xe_sysctrl *sc,u32 bit_mask, -unsigned int timeout_ms) +unsigned int timeout_ms,u32 *out_val) {return xe_mmio_wait32_not (sc->mmio,SYSCTRL_MB_CTRL , bit_mask, bit_mask, - timeout_ms *1000 ,NULL , false); + timeout_ms *1000 , out_val, false); }static int sysctrl_wait_bit_set (struct xe_sysctrl *sc,u32 bit_mask, -unsigned int timeout_ms) +unsigned int timeout_ms,u32 *out_val) {return xe_mmio_wait32 (sc->mmio,SYSCTRL_MB_CTRL , bit_mask, bit_mask, - timeout_ms *1000 ,NULL , false); + timeout_ms *1000 , out_val, false); +} + +static void sysctrl_mb_ctrl_desc (u32 ctrl_reg,char *buf,size_t size) +{ +scnprintf (buf, size, +"frame=%u/%u busy=%d resp=%d ctrl=%#010x" , + (u32 )REG_FIELD_GET (SYSCTRL_FRAME_CURRENT_MASK , ctrl_reg), + (u32 )REG_FIELD_GET (SYSCTRL_FRAME_TOTAL_MASK , ctrl_reg), + !!(ctrl_reg &SYSCTRL_MB_CTRL_RUN_BUSY ), + !!(ctrl_reg &SYSCTRL_MB_CTRL_RUN_BUSY_OUT ), + ctrl_reg); } static void sysctrl_write_frame(struct xe_sysctrl *sc, const void *frame,
@@ -128,17 +140,24 @@ static int sysctrl_send_frames(struct xe_sysctrl *sc,const u8 *mbox_cmd, size_t cmd_size, unsigned int timeout_ms) { + const struct xe_sysctrl_mailbox_msg_hdr *hdr = + (const struct xe_sysctrl_mailbox_msg_hdr *)mbox_cmd;struct xe_device *xe =sc_to_xe (sc);u32 ctrl_reg, total_frames, frame;size_t bytes_sent, frame_size; +char ctrl_desc[48 ];bool phase;int ret; total_frames =DIV_ROUND_UP (cmd_size,XE_SYSCTRL_MB_FRAME_SIZE ); - ret =sysctrl_wait_bit_clear (sc,SYSCTRL_MB_CTRL_RUN_BUSY , timeout_ms); + ret =sysctrl_wait_bit_clear (sc,SYSCTRL_MB_CTRL_RUN_BUSY , timeout_ms, &ctrl_reg);if (ret) { -xe_log_err (xe,SYSCTRL , ret,"Mailbox busy\n" ); +sysctrl_mb_ctrl_desc (ctrl_reg, ctrl_desc,sizeof (ctrl_desc)); +xe_log_err (xe,SYSCTRL , ret, +"Mailbox busy %#x.%#x %s\n" , + (u32 )XE_SYSCTRL_HDR_GROUP_ID (hdr), (u32 )XE_SYSCTRL_HDR_COMMAND (hdr), + ctrl_desc);return ret; }
@@ -159,9 +178,13 @@ static int sysctrl_send_frames(struct xe_sysctrl *sc,xe_mmio_write32 (sc->mmio,SYSCTRL_MB_CTRL , ctrl_reg); - ret =sysctrl_wait_bit_clear (sc,SYSCTRL_MB_CTRL_RUN_BUSY , timeout_ms); + ret =sysctrl_wait_bit_clear (sc,SYSCTRL_MB_CTRL_RUN_BUSY , timeout_ms, &ctrl_reg);if (ret) { -xe_log_err (xe,SYSCTRL , ret,"Frame %u acknowledgment timeout\n" , frame); +sysctrl_mb_ctrl_desc (ctrl_reg, ctrl_desc,sizeof (ctrl_desc)); +xe_log_err (xe,SYSCTRL , ret, +"Frame %u acknowledgment timeout %#x.%#x %s\n" , + frame, (u32 )XE_SYSCTRL_HDR_GROUP_ID (hdr), + (u32 )XE_SYSCTRL_HDR_COMMAND (hdr), ctrl_desc);return ret; }
@@ -171,17 +194,23 @@ static int sysctrl_send_frames(struct xe_sysctrl *sc,return 0 ; } -static int sysctrl_process_frame (struct xe_sysctrl *sc,void *out, -size_t frame_size,unsigned int timeout_ms, +static int sysctrl_process_frame (struct xe_sysctrl *sc, +const struct xe_sysctrl_mailbox_msg_hdr *req, +void *out,size_t frame_size,unsigned int timeout_ms,bool *done) {u32 curr_frame, total_frames, ctrl_reg;struct xe_device *xe =sc_to_xe (sc); +char ctrl_desc[48 ];int ret; - ret =sysctrl_wait_bit_set (sc,SYSCTRL_MB_CTRL_RUN_BUSY_OUT , timeout_ms); + ret =sysctrl_wait_bit_set (sc,SYSCTRL_MB_CTRL_RUN_BUSY_OUT , timeout_ms, &ctrl_reg);if (ret) { -xe_log_err (xe,SYSCTRL , ret,"Response frame timeout\n" ); +sysctrl_mb_ctrl_desc (ctrl_reg, ctrl_desc,sizeof (ctrl_desc)); +xe_log_err (xe,SYSCTRL , ret, +"Response frame timeout %#x.%#x %s\n" , + (u32 )XE_SYSCTRL_HDR_GROUP_ID (req), (u32 )XE_SYSCTRL_HDR_COMMAND (req), + ctrl_desc);return ret; }
@@ -219,7 +248,7 @@ static int sysctrl_receive_frames(struct xe_sysctrl *sc,while (!done && remain) { frame_size =min_t (size_t, remain,XE_SYSCTRL_MB_FRAME_SIZE ); - ret =sysctrl_process_frame (sc, out, frame_size, timeout_ms, + ret =sysctrl_process_frame (sc, req, out, frame_size, timeout_ms, &done);if (ret)return ret;
@@ -240,8 +269,9 @@ static int sysctrl_receive_frames(struct xe_sysctrl *sc, }if (XE_SYSCTRL_HDR_RESULT (hdr) !=0 ) { -xe_log_err (xe,SYSCTRL , -EIO ,"Firmware error: %#04x\n" , -XE_SYSCTRL_HDR_RESULT (hdr)); +xe_log_err (xe,SYSCTRL , -EIO ,"Firmware error: %#04x %#x.%#x\n" , + (u32 )XE_SYSCTRL_HDR_RESULT (hdr), + (u32 )XE_SYSCTRL_HDR_GROUP_ID (req), (u32 )XE_SYSCTRL_HDR_COMMAND (req));return -EIO ; }
Signature · 1 line
2.43.0
Quoted 9 lines · Vijay
From: Anoop Vijay <[email protected]>
Include decoded mailbox control register information in mailbox busy, timeout and firmware error paths to provide additional context for failure debugging
alan: snip
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c struct xe_sysctrl_mailbox_msg_hdr { · line 62
Quoted 11 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +10
-0+ +static void sysctrl_mb_ctrl_desc (u32 ctrl_reg,char *buf,size_t size) +{ +scnprintf (buf, size, +"frame=%u/%u busy=%d resp=%d ctrl=%#010x" , + (u32 )REG_FIELD_GET (SYSCTRL_FRAME_CURRENT_MASK , ctrl_reg), + (u32 )REG_FIELD_GET (SYSCTRL_FRAME_TOTAL_MASK , ctrl_reg), + !!(ctrl_reg &SYSCTRL_MB_CTRL_RUN_BUSY ), + !!(ctrl_reg &SYSCTRL_MB_CTRL_RUN_BUSY_OUT ), + ctrl_reg); }
alan: btw, are the meanings of the ctr_reg values based on a predefined hw-protocol spec? if so, could we include a helper for hex->string conversion? (ofc need to also check for size of the char_desc - which isnt in this function (dont want an overflow if future develoeprs decided to add more content). Im not too familiar with the mailbox register spec but from code i thought the same ctrl register bitmasks mean different things depending on read vs write - so might also need to have two helpers or extra param? I understand this provides little benefit for a developer who knows the code well, but provides a lot of efficiency when someone else is debugging the code.
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_send_frames(struct xe_sysctrl *sc, · line 147
Quoted 11 lines
static void sysctrl_write_frame(struct
xe_sysctrl*sc, const void *frame,drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +2
-0@@ -128,17 +140,24 @@ static int sysctrl_send_frames(struct xe_sysctrl *sc,const u8 *mbox_cmd, size_t cmd_size, unsigned int timeout_ms) { + const struct xe_sysctrl_mailbox_msg_hdr *hdr = + (const struct xe_sysctrl_mailbox_msg_hdr *)mbox_cmd;
alan: snip
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_send_frames(struct xe_sysctrl *sc, · line 200
Quoted 7 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +3
-2-static int sysctrl_process_frame (struct xe_sysctrl *sc,void *out, -size_t frame_size,unsigned int timeout_ms, +static int sysctrl_process_frame (struct xe_sysctrl *sc, +const struct xe_sysctrl_mailbox_msg_hdr *req, +void *out,size_t frame_size,unsigned int timeout_ms,bool *done)
alan: are we using 'done' in this function?
Quoted 8 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +1
-1{u32 curr_frame, total_frames, ctrl_reg;struct xe_device *xe =sc_to_xe (sc); +char ctrl_desc[48 ];int ret; - ret =sysctrl_wait_bit_set (sc,SYSCTRL_MB_CTRL_RUN_BUSY_OUT , timeout_ms);
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_send_frames(struct xe_sysctrl *sc, · line 215
Quoted 10 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +6
-1+ ret =sysctrl_wait_bit_set (sc,SYSCTRL_MB_CTRL_RUN_BUSY_OUT , timeout_ms, &ctrl_reg);if (ret) { -xe_log_err (xe,SYSCTRL , ret,"Response frame timeout\n" ); +sysctrl_mb_ctrl_desc (ctrl_reg, ctrl_desc,sizeof (ctrl_desc)); +xe_log_err (xe,SYSCTRL , ret, +"Response frame timeout %#x.%#x %s\n" , + (u32 )XE_SYSCTRL_HDR_GROUP_ID (req), (u32 )XE_SYSCTRL_HDR_COMMAND (req), + ctrl_desc);return ret; }
alan: snip
Quoted 22 lines · Alan Previn
Quoted 9 lines · Vijay
From: Anoop Vijay<[email protected]>
Include decoded mailbox control register information in mailbox busy, timeout and firmware error paths to provide additional context for failure debugging
alan: snip
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c struct xe_sysctrl_mailbox_msg_hdr { · line 62
Quoted 11 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +10
-0+ +static void sysctrl_mb_ctrl_desc (u32 ctrl_reg,char *buf,size_t size) +{ +scnprintf (buf, size, +"frame=%u/%u busy=%d resp=%d ctrl=%#010x" , + (u32 )REG_FIELD_GET (SYSCTRL_FRAME_CURRENT_MASK , ctrl_reg), + (u32 )REG_FIELD_GET (SYSCTRL_FRAME_TOTAL_MASK , ctrl_reg), + !!(ctrl_reg &SYSCTRL_MB_CTRL_RUN_BUSY ), + !!(ctrl_reg &SYSCTRL_MB_CTRL_RUN_BUSY_OUT ), + ctrl_reg); }
Quoted 8 lines
alan: btw, are the meanings of the
ctr_regvalues based on a predefined hw-protocol spec? if so, could we include a helper forhex->stringconversion? (ofc need to also check for size of thechar_desc- which isnt in this function (dont want an overflow if future develoeprs decided to add more content). Im not too familiar with the mailbox register spec but from code i thought the same ctrl register bitmasks mean different things depending on read vs write - so might also need to have two helpers or extra param? I understand this provides little benefit for a developer who knows the code well, but provides a lot of efficiency when someone else is debugging the code.
Control register fields are defined by mailbox protocol and have the same meaning in both Tx and Rx paths, so I don't think separate helpers are needed. The sysctrl_mb_ctrl_desc() helper intentionally reports both RUN_BUSY and RUN_BUSY_OUT to show full mailbox handshake state at the failure point. As for buffer safety, the helper takes destination buffer size and uses scnprintf(), which bounds the output to the supplied size, so there is no overflow risk.
Quoted 13 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_send_frames(struct xe_sysctrl *sc, · line 147
Quoted 11 lines
static void sysctrl_write_frame(struct
xe_sysctrl*sc, const void *frame,drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +2
-0@@ -128,17 +140,24 @@ static int sysctrl_send_frames(struct xe_sysctrl *sc,const u8 *mbox_cmd, size_t cmd_size, unsigned int timeout_ms) { + const struct xe_sysctrl_mailbox_msg_hdr *hdr = + (const struct xe_sysctrl_mailbox_msg_hdr *)mbox_cmd;alan: snip
Quoted 1 line
Quoted 7 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_send_frames(struct xe_sysctrl *sc, · line 200
Quoted 6 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +3
-2-static int sysctrl_process_frame (struct xe_sysctrl *sc,void *out, -size_t frame_size,unsigned int timeout_ms, +static int sysctrl_process_frame (struct xe_sysctrl *sc, +const struct xe_sysctrl_mailbox_msg_hdr *req, +void *out,size_t frame_size,unsigned int timeout_ms,bool *done)alan: are we using 'done' in this function?
Yes. |sysctrl_process_frame()| sets |*done| on the last frame (|curr_frame == total_frames|), which |sysctrl_receive_frames()| uses to terminate polling for multi-frame responses.
Thanks,
Anoop
Quoted 19 lines
Quoted 8 lines
{ u32 curr_frame, total_frames, ctrl_reg; struct xe_device *xe = sc_to_xe(sc);drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +1
-1+char ctrl_desc[48 ];int ret; - ret =sysctrl_wait_bit_set (sc,SYSCTRL_MB_CTRL_RUN_BUSY_OUT , timeout_ms);drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_send_frames(struct xe_sysctrl *sc, · line 215
Quoted 10 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +6
-1+ ret =sysctrl_wait_bit_set (sc,SYSCTRL_MB_CTRL_RUN_BUSY_OUT , timeout_ms, &ctrl_reg);if (ret) { -xe_log_err (xe,SYSCTRL , ret,"Response frame timeout\n" ); +sysctrl_mb_ctrl_desc (ctrl_reg, ctrl_desc,sizeof (ctrl_desc)); +xe_log_err (xe,SYSCTRL , ret, +"Response frame timeout %#x.%#x %s\n" , + (u32 )XE_SYSCTRL_HDR_GROUP_ID (req), (u32 )XE_SYSCTRL_HDR_COMMAND (req), + ctrl_desc);return ret; }alan: snip
Quoted 40 lines · Vijay
From: Anoop Vijay <[email protected]>
Include decoded mailbox control register information in mailbox busy, timeout and firmware error paths to provide additional context for failure debugging
Signed-off-by Anoop Vijay <[email protected]>---
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c| 60 ++++++++++++++++++-------1 file changed, 45 insertions(+), 15 deletions(-)drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +4
-3@@ -7,6 +7,7 @@#include <linux/cleanup.h> #include <linux/minmax.h> #include <linux/slab.h> +#include <linux/sprintf.h> #include <linux/string.h> #include "regs/xe_sysctrl_regs.h" @@ -36,17 +37,28 @@ struct xe_sysctrl_mailbox_msg_hdr { REG_FIELD_GET(SYSCTRL_HDR_RESULT_MASK, (hdr)->data)static int sysctrl_wait_bit_clear (struct xe_sysctrl *sc,u32 bit_mask, -unsigned int timeout_ms) +unsigned int timeout_ms,u32 *out_val) {return xe_mmio_wait32_not (sc->mmio,SYSCTRL_MB_CTRL , bit_mask, bit_mask, - timeout_ms *1000 ,NULL , false); + timeout_ms *1000 , out_val, false); }static int sysctrl_wait_bit_set (struct xe_sysctrl *sc,u32 bit_mask, -unsigned int timeout_ms) +unsigned int timeout_ms,u32 *out_val) { return xe_mmio_wait32(sc->mmio, SYSCTRL_MB_CTRL, bit_mask, bit_mask,
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c struct xe_sysctrl_mailbox_msg_hdr { · line 58
Quoted 10 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +9
-1- timeout_ms * 1000, NULL, false); + timeout_ms * 1000, out_val, false); +} + +static void sysctrl_mb_ctrl_desc (u32 ctrl_reg,char *buf,size_t size) +{ + scnprintf(buf, size, + "frame=%u/%u busy=%d resp=%d ctrl=%#010x", + (u32)REG_FIELD_GET(SYSCTRL_FRAME_CURRENT_MASK, ctrl_reg), + (u32)REG_FIELD_GET(SYSCTRL_FRAME_TOTAL_MASK, ctrl_reg),
REG_FIELD_GET is already doing a (U32), no need to do it here again.
Also move the format string to first line
scnprintf(buf, size, "frame=%u/%u busy=%d resp=%d ctrl=%#010x", REG_FIELD_GET(SYSCTRL_FRAME_CURRENT_MASK, ctrl_reg), REG_FIELD_GET(SYSCTRL_FRAME_TOTAL_MASK, ctrl_reg), !!(ctrl_reg & SYSCTRL_MB_CTRL_RUN_BUSY), !!(ctrl_reg & SYSCTRL_MB_CTRL_RUN_BUSY_OUT), ctrl_reg);
Quoted 20 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +6
-0+ !!(ctrl_reg &SYSCTRL_MB_CTRL_RUN_BUSY ), + !!(ctrl_reg &SYSCTRL_MB_CTRL_RUN_BUSY_OUT ), + ctrl_reg); } static void sysctrl_write_frame(struct xe_sysctrl *sc, const void *frame,@@ -128,17 +140,24 @@ static int sysctrl_send_frames(struct xe_sysctrl *sc,const u8 *mbox_cmd, size_t cmd_size, unsigned int timeout_ms) { + const struct xe_sysctrl_mailbox_msg_hdr *hdr = + (const struct xe_sysctrl_mailbox_msg_hdr *)mbox_cmd;struct xe_device *xe =sc_to_xe (sc);u32 ctrl_reg, total_frames, frame;size_t bytes_sent, frame_size; +char ctrl_desc[48 ];bool phase;int ret; total_frames =DIV_ROUND_UP (cmd_size,XE_SYSCTRL_MB_FRAME_SIZE );
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_send_frames(struct xe_sysctrl *sc, · line 160
Quoted 10 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +6
-2- ret =sysctrl_wait_bit_clear (sc,SYSCTRL_MB_CTRL_RUN_BUSY , timeout_ms); + ret =sysctrl_wait_bit_clear (sc,SYSCTRL_MB_CTRL_RUN_BUSY , timeout_ms, &ctrl_reg);if (ret) { -xe_log_err (xe,SYSCTRL , ret,"Mailbox busy\n" ); +sysctrl_mb_ctrl_desc (ctrl_reg, ctrl_desc,sizeof (ctrl_desc)); +xe_log_err (xe,SYSCTRL , ret, +"Mailbox busy %#x.%#x %s\n" , + (u32 )XE_SYSCTRL_HDR_GROUP_ID (hdr), (u32 )XE_SYSCTRL_HDR_COMMAND (hdr), + ctrl_desc);
same here (no (u32) and format message in first line)
xe_log_err(xe, SYSCTRL, ret, "Mailbox busy %#x.%#x %s\n", XE_SYSCTRL_HDR_GROUP_ID(hdr), XE_SYSCTRL_HDR_COMMAND(hdr), ctrl_desc);
Quoted 6 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +0
-0return ret; }@@ -159,9 +178,13 @@ static int sysctrl_send_frames(struct xe_sysctrl *sc,xe_mmio_write32 (sc->mmio,SYSCTRL_MB_CTRL , ctrl_reg);
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_send_frames(struct xe_sysctrl *sc, · line 187
Quoted 10 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +6
-2- ret =sysctrl_wait_bit_clear (sc,SYSCTRL_MB_CTRL_RUN_BUSY , timeout_ms); + ret =sysctrl_wait_bit_clear (sc,SYSCTRL_MB_CTRL_RUN_BUSY , timeout_ms, &ctrl_reg);if (ret) { -xe_log_err (xe,SYSCTRL , ret,"Frame %u acknowledgment timeout\n" , frame); +sysctrl_mb_ctrl_desc (ctrl_reg, ctrl_desc,sizeof (ctrl_desc)); +xe_log_err (xe,SYSCTRL , ret, +"Frame %u acknowledgment timeout %#x.%#x %s\n" , + frame, (u32 )XE_SYSCTRL_HDR_GROUP_ID (hdr), + (u32 )XE_SYSCTRL_HDR_COMMAND (hdr), ctrl_desc);
same here
Also, Would this print the frame twice? Once as 'frame' and once inside ctrl_desc? It looks like the one in ctrl_desc is the same Frame that you write to SYSCTRL_MB_CTRL. If so, you could drop the frame from the message:
xe_log_err(xe, SYSCTRL, ret, "Frame acknowledgment timeout %#x.%#x %s\n", XE_SYSCTRL_HDR_GROUP_ID(hdr), XE_SYSCTRL_HDR_COMMAND(hdr), ctrl_desc);
Quoted 18 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +4
-2return ret; }@@ -171,17 +194,23 @@ static int sysctrl_send_frames(struct xe_sysctrl *sc,return 0 ; } -static int sysctrl_process_frame (struct xe_sysctrl *sc,void *out, -size_t frame_size,unsigned int timeout_ms, +static int sysctrl_process_frame (struct xe_sysctrl *sc, +const struct xe_sysctrl_mailbox_msg_hdr *req, +void *out,size_t frame_size,unsigned int timeout_ms,bool *done) {u32 curr_frame, total_frames, ctrl_reg;struct xe_device *xe =sc_to_xe (sc); +char ctrl_desc[48 ];int ret;
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_send_frames(struct xe_sysctrl *sc, · line 213
Quoted 10 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +6
-2- ret =sysctrl_wait_bit_set (sc,SYSCTRL_MB_CTRL_RUN_BUSY_OUT , timeout_ms); + ret =sysctrl_wait_bit_set (sc,SYSCTRL_MB_CTRL_RUN_BUSY_OUT , timeout_ms, &ctrl_reg);if (ret) { -xe_log_err (xe,SYSCTRL , ret,"Response frame timeout\n" ); +sysctrl_mb_ctrl_desc (ctrl_reg, ctrl_desc,sizeof (ctrl_desc)); +xe_log_err (xe,SYSCTRL , ret, +"Response frame timeout %#x.%#x %s\n" , + (u32 )XE_SYSCTRL_HDR_GROUP_ID (req), (u32 )XE_SYSCTRL_HDR_COMMAND (req), + ctrl_desc);
and here
xe_log_err(xe, SYSCTRL, ret, "Response frame timeout %#x.%#x %s\n", XE_SYSCTRL_HDR_GROUP_ID(req), XE_SYSCTRL_HDR_COMMAND(req), ctrl_desc);
Quoted 13 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +1
-1return ret; }@@ -219,7 +248,7 @@ static int sysctrl_receive_frames(struct xe_sysctrl *sc,while (!done && remain) { frame_size =min_t (size_t, remain,XE_SYSCTRL_MB_FRAME_SIZE ); - ret =sysctrl_process_frame (sc, out, frame_size, timeout_ms, + ret =sysctrl_process_frame (sc, req, out, frame_size, timeout_ms, &done);if (ret)return ret;
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c static int sysctrl_receive_frames(struct xe_sysctrl *sc, · line 274
Quoted 8 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +3
-2@@ -240,8 +269,9 @@ static int sysctrl_receive_frames(struct xe_sysctrl *sc, }if (XE_SYSCTRL_HDR_RESULT (hdr) !=0 ) { -xe_log_err (xe,SYSCTRL , -EIO ,"Firmware error: %#04x\n" , -XE_SYSCTRL_HDR_RESULT (hdr)); +xe_log_err (xe,SYSCTRL , -EIO ,"Firmware error: %#04x %#x.%#x\n" , + (u32 )XE_SYSCTRL_HDR_RESULT (hdr), + (u32 )XE_SYSCTRL_HDR_GROUP_ID (req), (u32 )XE_SYSCTRL_HDR_COMMAND (req));
xe_log_err(xe, SYSCTRL, -EIO, "Firmware error: %#04x %#x.%#x\n", XE_SYSCTRL_HDR_RESULT(hdr), XE_SYSCTRL_HDR_GROUP_ID(req), XE_SYSCTRL_HDR_COMMAND(req));
OR
xe_log_err(xe, SYSCTRL, -EIO, "Firmware error: %#04x %#x.%#x\n", XE_SYSCTRL_HDR_RESULT(hdr), XE_SYSCTRL_HDR_GROUP_ID(req), XE_SYSCTRL_HDR_COMMAND(req));
Thanks,
Umesh
Quoted 6 lines
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c +0
-0return -EIO ; }Signature · 1 line
2.43.0