✗ CI.checkpatch: warning for drm/xe/vf: Post-migration recovery of GGTT nodes and CTB (rev2)
Patchwork
patchwork at emeril.freedesktop.org
Sat Nov 16 02:17:43 UTC 2024
== Series Details ==
Series: drm/xe/vf: Post-migration recovery of GGTT nodes and CTB (rev2)
URL : https://patchwork.freedesktop.org/series/141439/
State : warning
== Summary ==
+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
30ab6715fc09baee6cc14cb3c89ad8858688d474
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 92e00ec09ea2e7026264fbd635da4c9bde405270
Author: Tomasz Lis <tomasz.lis at intel.com>
Date: Sat Nov 16 03:12:38 2024 +0100
drm/xe/vf: Fixup CTB send buffer messages after migration
During post-migration recovery of a VF, it in necessary to update
GGTT references included in messages which are going to be sent
to GuC. GuC will start consuming messages after VF KMD will inform
it about fixups being done; before that, the VF KMD is expected
to update any H2G messages which are already in send buffer but
were not consumed by GuC.
Only a small subset of messages allowed for VFs have GGTT references
in them. This patch adds the functionality to parse the CTB send
ring buffer and shift addresses contained within.
While fixing the CTB content, ct->lock is not taken. This means
the only barier taken remains GGTT address lock - which is ok,
because only requests with GGTT addresses matter, but it also means
tail changes can happen during the CTB fixups execution (which may
be ignored as any new messages will not have anything to fix).
The GGTT address locking will be introduced in a future series.
Signed-off-by: Tomasz Lis <tomasz.lis at intel.com>
+ /mt/dim checkpatch 9a7388467f79fb74c67a2444c5b1add91652f89e drm-intel
4d2ba25c1794 drm/drm_mm: Safe macro for iterating through nodes in range
-:32: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'node__' - possible side-effects?
#32: FILE: include/drm/drm_mm.h:520:
+#define drm_mm_for_each_node_in_range_safe(node__, next__, mm__, start__, end__) \
+ for (node__ = __drm_mm_interval_first((mm__), (start__), (end__)-1), \
+ next__ = list_next_entry(node__, node_list); \
+ node__->start < (end__); \
+ node__ = next__, next__ = list_next_entry(next__, node_list))
-:32: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'next__' - possible side-effects?
#32: FILE: include/drm/drm_mm.h:520:
+#define drm_mm_for_each_node_in_range_safe(node__, next__, mm__, start__, end__) \
+ for (node__ = __drm_mm_interval_first((mm__), (start__), (end__)-1), \
+ next__ = list_next_entry(node__, node_list); \
+ node__->start < (end__); \
+ node__ = next__, next__ = list_next_entry(next__, node_list))
-:32: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'end__' - possible side-effects?
#32: FILE: include/drm/drm_mm.h:520:
+#define drm_mm_for_each_node_in_range_safe(node__, next__, mm__, start__, end__) \
+ for (node__ = __drm_mm_interval_first((mm__), (start__), (end__)-1), \
+ next__ = list_next_entry(node__, node_list); \
+ node__->start < (end__); \
+ node__ = next__, next__ = list_next_entry(next__, node_list))
-:33: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#33: FILE: include/drm/drm_mm.h:521:
+ for (node__ = __drm_mm_interval_first((mm__), (start__), (end__)-1), \
^
total: 0 errors, 0 warnings, 4 checks, 25 lines checked
7ad5c07295cc drm/xe/sriov: Shifting GGTT area post migration
-:45: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#45: FILE: drivers/gpu/drm/xe/xe_gt_sriov_vf.c:931:
+ xe_gt_sriov_info(gt, "GGTT base shifted from %#llx to %#llx\n",
+ old_base, old_base + ggtt_shift);
-:51: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#51: FILE: drivers/gpu/drm/xe/xe_gt_sriov_vf.c:937:
+static void xe_ggtt_mm_shift_nodes(struct xe_ggtt *ggtt, struct drm_mm_node *balloon_beg,
+ struct drm_mm_node *balloon_fin, s64 shift)
-:151: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#151: FILE: drivers/gpu/drm/xe/xe_gt_sriov_vf.c:1037:
+static void xe_ggtt_node_shift_nodes(struct xe_ggtt *ggtt, struct xe_ggtt_node *balloon_beg,
+ struct xe_ggtt_node *balloon_fin, s64 shift)
-:156: CHECK:BRACES: braces {} should be used on all arms of this statement
#156: FILE: drivers/gpu/drm/xe/xe_gt_sriov_vf.c:1042:
+ if (balloon_beg && balloon_beg->ggtt)
[...]
+ else {
[...]
-:158: CHECK:BRACES: Unbalanced braces around else statement
#158: FILE: drivers/gpu/drm/xe/xe_gt_sriov_vf.c:1044:
+ else {
-:166: CHECK:BRACES: braces {} should be used on all arms of this statement
#166: FILE: drivers/gpu/drm/xe/xe_gt_sriov_vf.c:1052:
+ if (balloon_fin && balloon_fin->ggtt)
[...]
+ else {
[...]
-:168: CHECK:BRACES: Unbalanced braces around else statement
#168: FILE: drivers/gpu/drm/xe/xe_gt_sriov_vf.c:1054:
+ else {
total: 0 errors, 0 warnings, 7 checks, 221 lines checked
92e00ec09ea2 drm/xe/vf: Fixup CTB send buffer messages after migration
-:87: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#87: FILE: drivers/gpu/drm/xe/xe_guc_ct.c:1636:
+static void ct_update_addresses_in_message(struct xe_guc_ct *ct,
+ struct iosys_map *cmds, u32 head,
-:95: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'p' may be better as '(p)' to avoid precedence issues
#95: FILE: drivers/gpu/drm/xe/xe_guc_ct.c:1644:
+#define read32(o, p) \
+do { \
+ xe_map_memcpy_from(xe, msg, cmds, (head + p) * sizeof(u32), \
+ 1 * sizeof(u32)); \
+ o = msg[0]; \
+} while (0)
-:101: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'p' - possible side-effects?
#101: FILE: drivers/gpu/drm/xe/xe_guc_ct.c:1650:
+#define fixup64(p) \
+do { \
+ xe_map_memcpy_from(xe, msg, cmds, (head + p) * sizeof(u32), \
+ 2 * sizeof(u32)); \
+ offset = make_u64(msg[1], msg[0]); \
+ offset += shift; \
+ msg[0] = lower_32_bits(offset); \
+ msg[1] = upper_32_bits(offset); \
+ xe_map_memcpy_to(xe, cmds, (head + p) * sizeof(u32), msg, 2 * sizeof(u32)); \
+} while (0)
-:101: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'p' may be better as '(p)' to avoid precedence issues
#101: FILE: drivers/gpu/drm/xe/xe_guc_ct.c:1650:
+#define fixup64(p) \
+do { \
+ xe_map_memcpy_from(xe, msg, cmds, (head + p) * sizeof(u32), \
+ 2 * sizeof(u32)); \
+ offset = make_u64(msg[1], msg[0]); \
+ offset += shift; \
+ msg[0] = lower_32_bits(offset); \
+ msg[1] = upper_32_bits(offset); \
+ xe_map_memcpy_to(xe, cmds, (head + p) * sizeof(u32), msg, 2 * sizeof(u32)); \
+} while (0)
-:194: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#194: FILE: drivers/gpu/drm/xe/xe_guc_ct.c:1743:
+ xe_gt_err(gt, "H2G channel has Invalid tail offset (%u >= %u)\n",
+ tail, size);
-:215: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#215: FILE: drivers/gpu/drm/xe/xe_guc_ct.c:1764:
+ xe_gt_err(gt, "Corrupted descriptor head=%u tail=%u\n",
+ head, tail);
total: 0 errors, 0 warnings, 6 checks, 218 lines checked
More information about the Intel-xe
mailing list