✗ CI.checkpatch: warning for drm/xe/vf: Allow to inject VF provisioning errors (rev2)

Patchwork patchwork at emeril.freedesktop.org
Fri May 23 07:51:35 UTC 2025


== Series Details ==

Series: drm/xe/vf: Allow to inject VF provisioning errors (rev2)
URL   : https://patchwork.freedesktop.org/series/147731/
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
202708c00696422fd217223bb679a353a5936e23
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 1fbe9245f2b20e7ab6b034bbe2d16c70348ba81c
Author: Satyanarayana K V P <satyanarayana.k.v.p at intel.com>
Date:   Fri May 23 13:06:32 2025 +0530

    drm/xe/vf: Allow to inject VF provisioning errors
    
    In unlikely event, due to PF malfunction or misconfiguration, VF may
    receive incomplete or invalid configuration and it must be prepared
    to handle such cases without causing a crash.
    
    Since we believe that our PF implementation will not provide invalid VF
    config, reuse existing FUNCTION_ERROR_INJECTION framework to alter VF
    provisioning to verify driver reaction to unexpected or invalid
    configurations.
    
    However we can't use FUNCTION_ERROR_INJECTION directly on functions that
    query VF provisioning, as all detected error conditions will cause
    immediate abort. Instead define dummy functions, where we could inject
    error using FUNCTION_ERROR_INJECTION framework, and any errors from these
    functions will be used to adjust the received valid provisioning data into
    the invalid one.
    
    The following errors are recognized by these functions and to trigger
    specific provisioning misconfiguration.
    
    -ENODATA (-61)  : Force resource size to zero (unprovisioned)
    -EREMCHG (-78)  : Force resource size smaller than received (should be
                      harmless until driver detects inconsistency)
    -EINVAL  (-22)  : Force resource location invalid (like GGTT base
                      below WOPCM)
    -ENOSPC  (-28)  : Force resource size bigger than HW limit
    -EDQUOT  (-122) : Force resource size larger than received (will cause use
                      of unassigned part of the resource)
    -ESRMNT  (-69)  : Force resource size larger than received with invalid
                      base address. (Will cause use of unassigned part of the
                      resource).
    
    Using the combination of "times" and "space" parameters provided by fault
    injection framework, fault can be injected into the provisioning of
    ggtt/lmem/ctx/dbs.
    
    Steps to inject fault using "times" and "space" are given below.
    
    |=============|=============|==================|===============|
    |   space     |     times   | fault for IGFX   |fault for DGFX |
    |=============|=============|==================|===============|
    |    1        |      1      |    GGTT          |    GGTT       |
    |=============|=============|==================|===============|
    |    2        |      1      |    context       |    lmem       |
    |=============|=============|==================|===============|
    |    3        |      1      |    doorbells     |    context    |
    |=============|=============|==================|===============|
    |    4        |      1      |     NA           |    doorbells  |
    |=============|=============|==================|===============|
    
    Fault can be injected with below steps (using GGTT resource and -ENODATA
    error as an example)
    
    $ FAILFUNC=xe_should_fail_vf_provisioning
    
    $ echo $FAILFUNC    > /sys/kernel/debug/fail_function/inject
    $ printf %#x -61    > /sys/kernel/debug/fail_function/$FAILFUNC/retval
    $ echo 100          > /sys/kernel/debug/fail_function/probability
    $ echo 1            > /sys/kernel/debug/fail_function/space
    $ echo 1            > /sys/kernel/debug/$FAILTYPE/times
    
    Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p at intel.com>
    Suggested-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
    Acked-by: Lucas De Marchi <lucas.demarchi at intel.com>
+ /mt/dim checkpatch 1bb9b646d6ead84cf3f16c724f7bca2cad161839 drm-intel
1fbe9245f2b2 drm/xe/vf: Allow to inject VF provisioning errors
-:132: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#132: 
new file mode 100644

-:149: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'NAME' - possible side-effects?
#149: FILE: drivers/gpu/drm/xe/xe_gt_sriov_vf_tweaks.c:13:
+#define DEFINE_FAIL_FUNC(NAME)  \
+	static noinline int NAME(void)  \
+	{                               \
+		return 0;               \
+	}                               \
+	ALLOW_ERROR_INJECTION(NAME, ERRNO)

-:149: WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#149: FILE: drivers/gpu/drm/xe/xe_gt_sriov_vf_tweaks.c:13:
+#define DEFINE_FAIL_FUNC(NAME)  \
+	static noinline int NAME(void)  \
+	{                               \
+		return 0;               \
+	}                               \
+	ALLOW_ERROR_INJECTION(NAME, ERRNO)

total: 0 errors, 2 warnings, 1 checks, 293 lines checked




More information about the Intel-xe mailing list