Commit a8c14f53 authored by Tomer Tayar's avatar Tomer Tayar Committed by Oded Gabbay

accel/habanalabs: improve readability of engines idle mask print

Remove leading zeroes when printing the idle mask to make it clearer.
Signed-off-by: default avatarTomer Tayar <ttayar@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
parent 66116a39
...@@ -380,18 +380,17 @@ bool hl_ctrl_device_operational(struct hl_device *hdev, ...@@ -380,18 +380,17 @@ bool hl_ctrl_device_operational(struct hl_device *hdev,
static void print_idle_status_mask(struct hl_device *hdev, const char *message, static void print_idle_status_mask(struct hl_device *hdev, const char *message,
u64 idle_mask[HL_BUSY_ENGINES_MASK_EXT_SIZE]) u64 idle_mask[HL_BUSY_ENGINES_MASK_EXT_SIZE])
{ {
u32 pad_width[HL_BUSY_ENGINES_MASK_EXT_SIZE] = {}; if (idle_mask[3])
dev_err(hdev->dev, "%s (mask %#llx_%016llx_%016llx_%016llx)\n",
BUILD_BUG_ON(HL_BUSY_ENGINES_MASK_EXT_SIZE != 4); message, idle_mask[3], idle_mask[2], idle_mask[1], idle_mask[0]);
else if (idle_mask[2])
pad_width[3] = idle_mask[3] ? 16 : 0; dev_err(hdev->dev, "%s (mask %#llx_%016llx_%016llx)\n",
pad_width[2] = idle_mask[2] || pad_width[3] ? 16 : 0; message, idle_mask[2], idle_mask[1], idle_mask[0]);
pad_width[1] = idle_mask[1] || pad_width[2] ? 16 : 0; else if (idle_mask[1])
pad_width[0] = idle_mask[0] || pad_width[1] ? 16 : 0; dev_err(hdev->dev, "%s (mask %#llx_%016llx)\n",
message, idle_mask[1], idle_mask[0]);
dev_err(hdev->dev, "%s (mask %0*llx_%0*llx_%0*llx_%0*llx)\n", else
message, pad_width[3], idle_mask[3], pad_width[2], idle_mask[2], dev_err(hdev->dev, "%s (mask %#llx)\n", message, idle_mask[0]);
pad_width[1], idle_mask[1], pad_width[0], idle_mask[0]);
} }
static void hpriv_release(struct kref *ref) static void hpriv_release(struct kref *ref)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment