mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 23:03:57 -04:00
Switch error injection testing from i915_inject_probe_failure to ALLOW_ERROR_INJECTION. Here taken out calls to i915_inject_probe_failure and changed to use ALLOW_ERROR_INJECTION for the same functions. Below functions are dropped from testing since I couldn't hit those at module bind time, testing these would just fail the tests. To include these in test would need to find way to cause resetting in i915 which would trigger these: intel_gvt_init intel_wopcm_init intel_uc_fw_upload intel_gt_init with expected -EIO (-EINVAL is tested) lrc_init_wa_ctx intel_huc_auth guc_check_version_range intel_uc_fw_fetch uc_fw_xfer __intel_uc_reset_hw guc_enable_communication uc_init_wopcm ..and all stages of __force_fw_fetch_failures Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com> Link: https://patch.msgid.link/20251216080754.221974-2-juhapekka.heikkila@gmail.com
47 lines
1.2 KiB
C
47 lines
1.2 KiB
C
// SPDX-License-Identifier: MIT
|
|
/*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#include <linux/device.h>
|
|
|
|
#include <drm/drm_drv.h>
|
|
#include <drm/drm_print.h>
|
|
|
|
#include "i915_drv.h"
|
|
#include "i915_reg.h"
|
|
#include "i915_utils.h"
|
|
|
|
void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint)
|
|
{
|
|
drm_notice(&i915->drm, "CI tainted: %#x by %pS\n",
|
|
taint, __builtin_return_address(0));
|
|
|
|
__add_taint_for_CI(taint);
|
|
}
|
|
|
|
bool i915_vtd_active(struct drm_i915_private *i915)
|
|
{
|
|
if (device_iommu_mapped(i915->drm.dev))
|
|
return true;
|
|
|
|
/* Running as a guest, we assume the host is enforcing VT'd */
|
|
return i915_run_as_guest();
|
|
}
|
|
|
|
bool i915_direct_stolen_access(struct drm_i915_private *i915)
|
|
{
|
|
/*
|
|
* Wa_22018444074
|
|
*
|
|
* Access via BAR can hang MTL, go directly to GSM/DSM,
|
|
* except for VM guests which won't have access to it.
|
|
*
|
|
* Normally this would not work but on MTL the system firmware
|
|
* should have relaxed the access permissions sufficiently.
|
|
* 0x138914==0x1 indicates that the firmware has done its job.
|
|
*/
|
|
return IS_METEORLAKE(i915) && !i915_run_as_guest() &&
|
|
intel_uncore_read(&i915->uncore, MTL_PCODE_STOLEN_ACCESS) == STOLEN_ACCESS_ALLOWED;
|
|
}
|