Skip to content

Commit 79c901c

Browse files
jnikulajlahtine-intel
authored andcommitted
drm/i915: taint kernel when force probing unsupported devices
For development and testing purposes, the i915.force_probe module parameter and DRM_I915_FORCE_PROBE kconfig option allow probing of devices that aren't supported by the driver. The i915.force_probe module parameter is "unsafe" and setting it taints the kernel. However, using the kconfig option does not. Always taint the kernel when force probing a device that is not supported. v2: Drop "depends on EXPERT" to avoid build breakage (kernel test robot) Fixes: 7ef5ef5 ("drm/i915: add force_probe module parameter to replace alpha_support") Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Dave Airlie <airlied@gmail.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230504103508.1818540-1-jani.nikula@intel.com (cherry picked from commit 3312bb4) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
1 parent 0ff8002 commit 79c901c

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

drivers/gpu/drm/i915/Kconfig

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ config DRM_I915_FORCE_PROBE
6262
This is the default value for the i915.force_probe module
6363
parameter. Using the module parameter overrides this option.
6464

65-
Force probe the i915 for Intel graphics devices that are
66-
recognized but not properly supported by this kernel version. It is
67-
recommended to upgrade to a kernel version with proper support as soon
68-
as it is available.
65+
Force probe the i915 driver for Intel graphics devices that are
66+
recognized but not properly supported by this kernel version. Force
67+
probing an unsupported device taints the kernel. It is recommended to
68+
upgrade to a kernel version with proper support as soon as it is
69+
available.
6970

7071
It can also be used to block the probe of recognized and fully
7172
supported devices.
@@ -75,7 +76,8 @@ config DRM_I915_FORCE_PROBE
7576
Use "<pci-id>[,<pci-id>,...]" to force probe the i915 for listed
7677
devices. For example, "4500" or "4500,4571".
7778

78-
Use "*" to force probe the driver for all known devices.
79+
Use "*" to force probe the driver for all known devices. Not
80+
recommended.
7981

8082
Use "!" right before the ID to block the probe of the device. For
8183
example, "4500,!4571" forces the probe of 4500 and blocks the probe of

drivers/gpu/drm/i915/i915_pci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,12 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
13441344
return -ENODEV;
13451345
}
13461346

1347+
if (intel_info->require_force_probe) {
1348+
dev_info(&pdev->dev, "Force probing unsupported Device ID %04x, tainting kernel\n",
1349+
pdev->device);
1350+
add_taint(TAINT_USER, LOCKDEP_STILL_OK);
1351+
}
1352+
13471353
/* Only bind to function 0 of the device. Early generations
13481354
* used function 1 as a placeholder for multi-head. This causes
13491355
* us confusion instead, especially on the systems where both

0 commit comments

Comments
 (0)