* [PATCH v4 0/3] GuC reset-and-retry patches (resend)
@ 2016-04-04 17:50 Dave Gordon
2016-04-04 17:50 ` [PATCH v4 1/3] drm/i915/guc: reset GuC and retry on firmware load failure Dave Gordon
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Dave Gordon @ 2016-04-04 17:50 UTC (permalink / raw)
To: intel-gfx
This is a resend, primarily for CI purposes. All patches to be
merged have already been reviewed. The final patch (NOT to be
merged) enables GuC loading and submission for testing purposes.
Arun Siluvery (1):
drm/i915/guc: reset GuC and retry on firmware load failure
Dave Gordon (2):
drm/i915/guc: always reset GuC before loading firmware
drm/i915: add enable_guc_loading parameter
drivers/gpu/drm/i915/i915_drv.h | 1 +
drivers/gpu/drm/i915/i915_gem.c | 1 -
drivers/gpu/drm/i915/i915_guc_reg.h | 11 ++-
drivers/gpu/drm/i915/i915_params.c | 14 ++-
drivers/gpu/drm/i915/i915_params.h | 3 +-
drivers/gpu/drm/i915/i915_reg.h | 1 +
drivers/gpu/drm/i915/intel_guc_loader.c | 147 ++++++++++++++++++++++----------
drivers/gpu/drm/i915/intel_uncore.c | 19 +++++
8 files changed, 144 insertions(+), 53 deletions(-)
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v4 1/3] drm/i915/guc: reset GuC and retry on firmware load failure
2016-04-04 17:50 [PATCH v4 0/3] GuC reset-and-retry patches (resend) Dave Gordon
@ 2016-04-04 17:50 ` Dave Gordon
2016-04-04 17:50 ` [PATCH v4 2/3] drm/i915/guc: always reset GuC before loading firmware Dave Gordon
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Dave Gordon @ 2016-04-04 17:50 UTC (permalink / raw)
To: intel-gfx
From: Arun Siluvery <arun.siluvery@linux.intel.com>
Due to timing issues in the HW, some of the status bits required for GuC
authentication occasionally don't get set; when that happens, the GuC
cannot be initialized and we will be left with a wedged GPU. The W/A
suggested is to perform a soft reset of the GuC and attempt to reload
the F/W again for few times before giving up.
As the failure is dependent on timing, tests performed by triggering
manual full gpu reset (i915_wedged) showed that we could sometimes hit
this after several thousand iterations, but sometimes tests ran even
longer without any issues. Reset and reload mechanism proved helpful
when we indeed hit f/w load failure, so it is better to include this
to improve driver stability.
This change implements the following WAs,
WaEnableuKernelHeaderValidFix:skl,bxt
WaEnableGuCBootHashCheckNotSet:skl,bxt
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Reviewed-by: Alex Dai <yu.dai@intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 1 +
drivers/gpu/drm/i915/i915_guc_reg.h | 1 +
drivers/gpu/drm/i915/i915_reg.h | 1 +
drivers/gpu/drm/i915/intel_guc_loader.c | 49 +++++++++++++++++++++++++++++++--
drivers/gpu/drm/i915/intel_uncore.c | 19 +++++++++++++
5 files changed, 69 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index dd18772..1847ef9 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2746,6 +2746,7 @@ extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
extern int intel_gpu_reset(struct drm_device *dev, u32 engine_mask);
extern bool intel_has_gpu_reset(struct drm_device *dev);
extern int i915_reset(struct drm_device *dev);
+extern int intel_guc_reset(struct drm_i915_private *dev_priv);
extern void intel_engine_init_hangcheck(struct intel_engine_cs *engine);
extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv);
extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_guc_reg.h b/drivers/gpu/drm/i915/i915_guc_reg.h
index e4ba582..94ceee5 100644
--- a/drivers/gpu/drm/i915/i915_guc_reg.h
+++ b/drivers/gpu/drm/i915/i915_guc_reg.h
@@ -27,6 +27,7 @@
/* Definitions of GuC H/W registers, bits, etc */
#define GUC_STATUS _MMIO(0xc000)
+#define GS_MIA_IN_RESET (1 << 0)
#define GS_BOOTROM_SHIFT 1
#define GS_BOOTROM_MASK (0x7F << GS_BOOTROM_SHIFT)
#define GS_BOOTROM_RSA_FAILED (0x50 << GS_BOOTROM_SHIFT)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 12f5103..f4ebf31 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -165,6 +165,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
#define GEN6_GRDOM_MEDIA (1 << 2)
#define GEN6_GRDOM_BLT (1 << 3)
#define GEN6_GRDOM_VECS (1 << 4)
+#define GEN9_GRDOM_GUC (1 << 5)
#define GEN8_GRDOM_MEDIA2 (1 << 7)
#define RING_PP_DIR_BASE(ring) _MMIO((ring)->mmio_base+0x228)
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index b4976f9..d84c560 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -353,6 +353,24 @@ static int guc_ucode_xfer(struct drm_i915_private *dev_priv)
return ret;
}
+static int i915_reset_guc(struct drm_i915_private *dev_priv)
+{
+ int ret;
+ u32 guc_status;
+
+ ret = intel_guc_reset(dev_priv);
+ if (ret) {
+ DRM_ERROR("GuC reset failed, ret = %d\n", ret);
+ return ret;
+ }
+
+ guc_status = I915_READ(GUC_STATUS);
+ WARN(!(guc_status & GS_MIA_IN_RESET),
+ "GuC status: 0x%x, MIA core expected to be in reset\n", guc_status);
+
+ return ret;
+}
+
/**
* intel_guc_ucode_load() - load GuC uCode into the device
* @dev: drm device
@@ -417,9 +435,36 @@ int intel_guc_ucode_load(struct drm_device *dev)
if (err)
goto fail;
+ /*
+ * WaEnableuKernelHeaderValidFix:skl,bxt
+ * For BXT, this is only upto B0 but below WA is required for later
+ * steppings also so this is extended as well.
+ */
+ /* WaEnableGuCBootHashCheckNotSet:skl,bxt */
err = guc_ucode_xfer(dev_priv);
- if (err)
- goto fail;
+ if (err) {
+ int retries = 3;
+
+ DRM_ERROR("GuC fw load failed, err=%d, attempting reset and retry\n", err);
+
+ while (retries--) {
+ err = i915_reset_guc(dev_priv);
+ if (err)
+ break;
+
+ err = guc_ucode_xfer(dev_priv);
+ if (!err) {
+ DRM_DEBUG_DRIVER("GuC fw reload succeeded after reset\n");
+ break;
+ }
+ DRM_DEBUG_DRIVER("GuC fw reload retries left: %d\n", retries);
+ }
+
+ if (err) {
+ DRM_ERROR("GuC fw reload attempt failed, ret=%d\n", err);
+ goto fail;
+ }
+ }
guc_fw->guc_fw_load_status = GUC_FIRMWARE_SUCCESS;
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index ac1c545..fbc1d21 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1673,6 +1673,25 @@ bool intel_has_gpu_reset(struct drm_device *dev)
return intel_get_gpu_reset(dev) != NULL;
}
+int intel_guc_reset(struct drm_i915_private *dev_priv)
+{
+ int ret;
+ unsigned long irqflags;
+
+ if (!i915.enable_guc_submission)
+ return -EINVAL;
+
+ intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
+ spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
+
+ ret = gen6_hw_domain_reset(dev_priv, GEN9_GRDOM_GUC);
+
+ spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
+ intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
+
+ return ret;
+}
+
bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv)
{
return check_for_unclaimed_mmio(dev_priv);
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v4 2/3] drm/i915/guc: always reset GuC before loading firmware
2016-04-04 17:50 [PATCH v4 0/3] GuC reset-and-retry patches (resend) Dave Gordon
2016-04-04 17:50 ` [PATCH v4 1/3] drm/i915/guc: reset GuC and retry on firmware load failure Dave Gordon
@ 2016-04-04 17:50 ` Dave Gordon
2016-04-04 17:50 ` [PATCH v4 3/3] DO NOT MERGE: add enable_guc_loading parameter Dave Gordon
2016-04-05 6:56 ` ✗ Fi.CI.BAT: failure for GuC reset-and-retry patches (resend) Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Dave Gordon @ 2016-04-04 17:50 UTC (permalink / raw)
To: intel-gfx
After a suspend-resume cycle, the resumed kernel has no idea what the
booted kernel may have done to the GuC before replacing itself with the
resumed image. In particular, it may have already loaded the GuC with
firmware, which will then cause this kernel's attempt to (re)load the
firmware to fail (GuC program memory is write-once!). The symptoms
(GuC firmware reload fails after hibernation) are further described
in the Bugzilla reference below.
So let's *always* reset the GuC just before (re)loading the firmware;
the hardware should then be in a well-known state, and we may even
avoid some of the issues arising from unpredictable timing.
Also added some more fields & values to the definition of the GUC_STATUS
register, which is the key diagnostic indicator if the GuC load fails.
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Reviewed-by: Arun Siluvery <arun.siluvery@linux.intel.com>
Cc: Alex Dai <yu.dai@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94390
---
drivers/gpu/drm/i915/i915_guc_reg.h | 12 ++++++++--
drivers/gpu/drm/i915/intel_guc_loader.c | 40 ++++++++++++++++-----------------
2 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_guc_reg.h b/drivers/gpu/drm/i915/i915_guc_reg.h
index 94ceee5..80786d9 100644
--- a/drivers/gpu/drm/i915/i915_guc_reg.h
+++ b/drivers/gpu/drm/i915/i915_guc_reg.h
@@ -27,10 +27,12 @@
/* Definitions of GuC H/W registers, bits, etc */
#define GUC_STATUS _MMIO(0xc000)
-#define GS_MIA_IN_RESET (1 << 0)
+#define GS_RESET_SHIFT 0
+#define GS_MIA_IN_RESET (0x01 << GS_RESET_SHIFT)
#define GS_BOOTROM_SHIFT 1
#define GS_BOOTROM_MASK (0x7F << GS_BOOTROM_SHIFT)
#define GS_BOOTROM_RSA_FAILED (0x50 << GS_BOOTROM_SHIFT)
+#define GS_BOOTROM_JUMP_PASSED (0x76 << GS_BOOTROM_SHIFT)
#define GS_UKERNEL_SHIFT 8
#define GS_UKERNEL_MASK (0xFF << GS_UKERNEL_SHIFT)
#define GS_UKERNEL_LAPIC_DONE (0x30 << GS_UKERNEL_SHIFT)
@@ -38,7 +40,13 @@
#define GS_UKERNEL_READY (0xF0 << GS_UKERNEL_SHIFT)
#define GS_MIA_SHIFT 16
#define GS_MIA_MASK (0x07 << GS_MIA_SHIFT)
-#define GS_MIA_CORE_STATE (1 << GS_MIA_SHIFT)
+#define GS_MIA_CORE_STATE (0x01 << GS_MIA_SHIFT)
+#define GS_MIA_HALT_REQUESTED (0x02 << GS_MIA_SHIFT)
+#define GS_MIA_ISR_ENTRY (0x04 << GS_MIA_SHIFT)
+#define GS_AUTH_STATUS_SHIFT 30
+#define GS_AUTH_STATUS_MASK (0x03 << GS_AUTH_STATUS_SHIFT)
+#define GS_AUTH_STATUS_BAD (0x01 << GS_AUTH_STATUS_SHIFT)
+#define GS_AUTH_STATUS_GOOD (0x02 << GS_AUTH_STATUS_SHIFT)
#define SOFT_SCRATCH(n) _MMIO(0xc180 + (n) * 4)
#define SOFT_SCRATCH_COUNT 16
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index d84c560..876e5da 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -387,7 +387,7 @@ int intel_guc_ucode_load(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
- int err = 0;
+ int retries, err = 0;
if (!i915.enable_guc_submission)
return 0;
@@ -441,29 +441,26 @@ int intel_guc_ucode_load(struct drm_device *dev)
* steppings also so this is extended as well.
*/
/* WaEnableGuCBootHashCheckNotSet:skl,bxt */
- err = guc_ucode_xfer(dev_priv);
- if (err) {
- int retries = 3;
-
- DRM_ERROR("GuC fw load failed, err=%d, attempting reset and retry\n", err);
-
- while (retries--) {
- err = i915_reset_guc(dev_priv);
- if (err)
- break;
-
- err = guc_ucode_xfer(dev_priv);
- if (!err) {
- DRM_DEBUG_DRIVER("GuC fw reload succeeded after reset\n");
- break;
- }
- DRM_DEBUG_DRIVER("GuC fw reload retries left: %d\n", retries);
- }
-
+ for (retries = 3; ; ) {
+ /*
+ * Always reset the GuC just before (re)loading, so
+ * that the state and timing are fairly predictable
+ */
+ err = i915_reset_guc(dev_priv);
if (err) {
- DRM_ERROR("GuC fw reload attempt failed, ret=%d\n", err);
+ DRM_ERROR("GuC reset failed, err %d\n", err);
goto fail;
}
+
+ err = guc_ucode_xfer(dev_priv);
+ if (!err)
+ break;
+
+ if (--retries == 0)
+ goto fail;
+
+ DRM_INFO("GuC fw load failed, err %d; will reset and "
+ "retry %d more time(s)\n", err, retries);
}
guc_fw->guc_fw_load_status = GUC_FIRMWARE_SUCCESS;
@@ -485,6 +482,7 @@ int intel_guc_ucode_load(struct drm_device *dev)
return 0;
fail:
+ DRM_ERROR("GuC firmware load failed, err %d\n", err);
if (guc_fw->guc_fw_load_status == GUC_FIRMWARE_PENDING)
guc_fw->guc_fw_load_status = GUC_FIRMWARE_FAIL;
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v4 3/3] DO NOT MERGE: add enable_guc_loading parameter
2016-04-04 17:50 [PATCH v4 0/3] GuC reset-and-retry patches (resend) Dave Gordon
2016-04-04 17:50 ` [PATCH v4 1/3] drm/i915/guc: reset GuC and retry on firmware load failure Dave Gordon
2016-04-04 17:50 ` [PATCH v4 2/3] drm/i915/guc: always reset GuC before loading firmware Dave Gordon
@ 2016-04-04 17:50 ` Dave Gordon
2016-04-05 6:56 ` ✗ Fi.CI.BAT: failure for GuC reset-and-retry patches (resend) Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Dave Gordon @ 2016-04-04 17:50 UTC (permalink / raw)
To: intel-gfx
Split the function of "enable_guc_submission" into two separate options.
The new one "enable_guc_loading" controls only the *fetching and loading*
of the GuC firmware image. The existing one is redefined to control only
the *use* of the GuC for batch submission once the firmware is loaded.
In addition, the degree of control has been refined from a simple bool
to an integer key, allowing several options:
-1 (default) whatever the platform default is
0 DISABLE don't load/use the GuC
1 BEST EFFORT try to load/use the GuC, fallback if not available
2 REQUIRE must load/use the GuC, else leave the GPU wedged
The new platform default (as coded here) will be to attempt to load
the GuC iff the device has a GuC that requires firmware, to attempt to
use it iff the device has a GuC that supports the submission protocol
(with or without firmware), and to fall back to execlist mode if any
required firmware cannot be found or fails to load.
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
---
drivers/gpu/drm/i915/i915_gem.c | 1 -
drivers/gpu/drm/i915/i915_params.c | 14 ++++-
drivers/gpu/drm/i915/i915_params.h | 3 +-
drivers/gpu/drm/i915/intel_guc_loader.c | 98 ++++++++++++++++++---------------
4 files changed, 67 insertions(+), 49 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index ca96fc1..da34db5 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4885,7 +4885,6 @@ int i915_gem_init_engines(struct drm_device *dev)
ret = intel_guc_ucode_load(dev);
if (ret) {
DRM_ERROR("Failed to initialize GuC, error %d\n", ret);
- ret = -EIO;
goto out;
}
}
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 1779f02..21f325b 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -54,7 +54,8 @@ struct i915_params i915 __read_mostly = {
.verbose_state_checks = 1,
.nuclear_pageflip = 0,
.edp_vswing = 0,
- .enable_guc_submission = false,
+ .enable_guc_loading = -1,
+ .enable_guc_submission = -1,
.guc_log_level = -1,
.enable_dp_mst = true,
.inject_load_failure = 0,
@@ -197,8 +198,15 @@ struct i915_params i915 __read_mostly = {
"(0=use value from vbt [default], 1=low power swing(200mV),"
"2=default swing(400mV))");
-module_param_named_unsafe(enable_guc_submission, i915.enable_guc_submission, bool, 0400);
-MODULE_PARM_DESC(enable_guc_submission, "Enable GuC submission (default:false)");
+module_param_named_unsafe(enable_guc_loading, i915.enable_guc_loading, int, 0400);
+MODULE_PARM_DESC(enable_guc_submission,
+ "Enable GuC firmware loading "
+ "(-1=auto [default], 0=never, 1=if available, 2=required)");
+
+module_param_named_unsafe(enable_guc_submission, i915.enable_guc_submission, int, 0400);
+MODULE_PARM_DESC(enable_guc_submission,
+ "Enable GuC submission "
+ "(-1=auto [default], 0=never, 1=if available, 2=required)");
module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
MODULE_PARM_DESC(guc_log_level,
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 02bc278..9f1d17b 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -45,6 +45,8 @@ struct i915_params {
int enable_ips;
int invert_brightness;
int enable_cmd_parser;
+ int enable_guc_loading;
+ int enable_guc_submission;
int guc_log_level;
int use_mmio_flip;
int mmio_debug;
@@ -57,7 +59,6 @@ struct i915_params {
bool load_detect_test;
bool reset;
bool disable_display;
- bool enable_guc_submission;
bool verbose_state_checks;
bool nuclear_pageflip;
bool enable_dp_mst;
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index 876e5da..2ec9cf1 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -387,49 +387,37 @@ int intel_guc_ucode_load(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
+ const char *fw_path = guc_fw->guc_fw_path;
int retries, err = 0;
- if (!i915.enable_guc_submission)
- return 0;
-
- DRM_DEBUG_DRIVER("GuC fw status: fetch %s, load %s\n",
+ DRM_DEBUG_DRIVER("GuC fw status: path %s, fetch %s, load %s\n",
+ fw_path,
intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status),
intel_guc_fw_status_repr(guc_fw->guc_fw_load_status));
- direct_interrupts_to_host(dev_priv);
+ /* Loading forbidden, or no firmware to load? */
+ if (!i915.enable_guc_loading)
+ goto fail;
+ if (fw_path == NULL)
+ goto fail;
+ if (*fw_path == '\0') {
+ DRM_ERROR("No GuC firmware known for this platform\n");
+ goto fail;
+ }
- if (guc_fw->guc_fw_fetch_status == GUC_FIRMWARE_NONE)
- return 0;
+ /* Fetch failed, or already fetched but failed to load? */
+ if (guc_fw->guc_fw_fetch_status != GUC_FIRMWARE_SUCCESS)
+ goto fail;
+ if (guc_fw->guc_fw_load_status == GUC_FIRMWARE_FAIL)
+ goto fail;
- if (guc_fw->guc_fw_fetch_status == GUC_FIRMWARE_SUCCESS &&
- guc_fw->guc_fw_load_status == GUC_FIRMWARE_FAIL)
- return -ENOEXEC;
+ direct_interrupts_to_host(dev_priv);
guc_fw->guc_fw_load_status = GUC_FIRMWARE_PENDING;
- DRM_DEBUG_DRIVER("GuC fw fetch status %s\n",
- intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status));
-
- switch (guc_fw->guc_fw_fetch_status) {
- case GUC_FIRMWARE_FAIL:
- /* something went wrong :( */
- err = -EIO;
- goto fail;
-
- case GUC_FIRMWARE_NONE:
- case GUC_FIRMWARE_PENDING:
- default:
- /* "can't happen" */
- WARN_ONCE(1, "GuC fw %s invalid guc_fw_fetch_status %s [%d]\n",
- guc_fw->guc_fw_path,
- intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status),
- guc_fw->guc_fw_fetch_status);
- err = -ENXIO;
- goto fail;
-
- case GUC_FIRMWARE_SUCCESS:
- break;
- }
+ DRM_DEBUG_DRIVER("GuC fw status: fetch %s, load %s\n",
+ intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status),
+ intel_guc_fw_status_repr(guc_fw->guc_fw_load_status));
err = i915_guc_submission_init(dev);
if (err)
@@ -483,6 +471,7 @@ int intel_guc_ucode_load(struct drm_device *dev)
fail:
DRM_ERROR("GuC firmware load failed, err %d\n", err);
+
if (guc_fw->guc_fw_load_status == GUC_FIRMWARE_PENDING)
guc_fw->guc_fw_load_status = GUC_FIRMWARE_FAIL;
@@ -490,6 +479,29 @@ int intel_guc_ucode_load(struct drm_device *dev)
i915_guc_submission_disable(dev);
i915_guc_submission_fini(dev);
+ /*
+ * We've failed to load the firmware :(
+ *
+ * Decide whether to disable GuC submission and fall back to
+ * execlist mode, and whether to hide the error by returning
+ * zero or to return -EIO, which the caller will treat as a
+ * nonfatal error (i.e. it doesn't prevent driver load, but
+ * marks the GPU as wedged until reset).
+ */
+ if (i915.enable_guc_loading > 1) {
+ err = -EIO;
+ } else if (HAS_GUC_SCHED(dev) && !HAS_GUC_UCODE(dev)) {
+ return 0;
+ } else if (i915.enable_guc_submission > 1) {
+ err = -EIO;
+ } else {
+ err = 0;
+ }
+
+ i915.enable_guc_submission = 0;
+
+ DRM_DEBUG_DRIVER("falling back to execlist mode, err %d\n", err);
+
return err;
}
@@ -631,8 +643,11 @@ void intel_guc_ucode_init(struct drm_device *dev)
struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
const char *fw_path;
- if (!HAS_GUC_SCHED(dev))
- i915.enable_guc_submission = false;
+ /* A negative value means "use platform default" */
+ if (i915.enable_guc_loading < 0)
+ i915.enable_guc_loading = HAS_GUC_UCODE(dev);
+ if (i915.enable_guc_submission < 0)
+ i915.enable_guc_submission = HAS_GUC_SCHED(dev);
if (!HAS_GUC_UCODE(dev)) {
fw_path = NULL;
@@ -641,26 +656,21 @@ void intel_guc_ucode_init(struct drm_device *dev)
guc_fw->guc_fw_major_wanted = 6;
guc_fw->guc_fw_minor_wanted = 1;
} else {
- i915.enable_guc_submission = false;
fw_path = ""; /* unknown device */
}
- if (!i915.enable_guc_submission)
- return;
-
guc_fw->guc_dev = dev;
guc_fw->guc_fw_path = fw_path;
guc_fw->guc_fw_fetch_status = GUC_FIRMWARE_NONE;
guc_fw->guc_fw_load_status = GUC_FIRMWARE_NONE;
+ /* Early (and silent) return if GuC loading is disabled */
+ if (!i915.enable_guc_loading)
+ return;
if (fw_path == NULL)
return;
-
- if (*fw_path == '\0') {
- DRM_ERROR("No GuC firmware known for this platform\n");
- guc_fw->guc_fw_fetch_status = GUC_FIRMWARE_FAIL;
+ if (*fw_path == '\0')
return;
- }
guc_fw->guc_fw_fetch_status = GUC_FIRMWARE_PENDING;
DRM_DEBUG_DRIVER("GuC firmware pending, path %s\n", fw_path);
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* ✗ Fi.CI.BAT: failure for GuC reset-and-retry patches (resend)
2016-04-04 17:50 [PATCH v4 0/3] GuC reset-and-retry patches (resend) Dave Gordon
` (2 preceding siblings ...)
2016-04-04 17:50 ` [PATCH v4 3/3] DO NOT MERGE: add enable_guc_loading parameter Dave Gordon
@ 2016-04-05 6:56 ` Patchwork
2016-04-05 12:03 ` Dave Gordon
3 siblings, 1 reply; 7+ messages in thread
From: Patchwork @ 2016-04-05 6:56 UTC (permalink / raw)
To: Dave Gordon; +Cc: intel-gfx
== Series Details ==
Series: GuC reset-and-retry patches (resend)
URL : https://patchwork.freedesktop.org/series/5287/
State : failure
== Summary ==
Series 5287v1 GuC reset-and-retry patches (resend)
http://patchwork.freedesktop.org/api/1.0/series/5287/revisions/1/mbox/
Test gem_ctx_switch:
Subgroup basic-default:
pass -> DMESG-WARN (skl-i7k-2)
Test gem_sync:
Subgroup basic-bsd:
pass -> DMESG-FAIL (ilk-hp8440p)
Test kms_flip:
Subgroup basic-flip-vs-dpms:
pass -> DMESG-WARN (ilk-hp8440p) UNSTABLE
Test kms_force_connector_basic:
Subgroup prune-stale-modes:
skip -> PASS (ilk-hp8440p)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (hsw-gt2)
Test pm_rpm:
Subgroup basic-pci-d3-state:
pass -> DMESG-WARN (bsw-nuc-2)
bdw-nuci7 total:196 pass:184 dwarn:0 dfail:0 fail:0 skip:12
bdw-ultra total:196 pass:175 dwarn:0 dfail:0 fail:0 skip:21
bsw-nuc-2 total:196 pass:158 dwarn:1 dfail:0 fail:0 skip:37
byt-nuc total:196 pass:161 dwarn:0 dfail:0 fail:0 skip:35
hsw-brixbox total:196 pass:174 dwarn:0 dfail:0 fail:0 skip:22
hsw-gt2 total:196 pass:179 dwarn:0 dfail:0 fail:0 skip:17
ilk-hp8440p total:196 pass:130 dwarn:1 dfail:1 fail:0 skip:64
ivb-t430s total:196 pass:171 dwarn:0 dfail:0 fail:0 skip:25
skl-i7k-2 total:196 pass:172 dwarn:1 dfail:0 fail:0 skip:23
snb-dellxps total:196 pass:162 dwarn:0 dfail:0 fail:0 skip:34
snb-x220t total:196 pass:162 dwarn:0 dfail:0 fail:1 skip:33
Results at /archive/results/CI_IGT_test/Patchwork_1794/
aedfaaef290af9c8df7d9f4adf22cbe21704d091 drm-intel-nightly: 2016y-04m-04d-13h-09m-54s UTC integration manifest
c7e3e58bc5509154a98e7c2fa1e433538f67c97a DO NOT MERGE: add enable_guc_loading parameter
87ce739817a1d65a3770c67d27560ea7377ad05e drm/i915/guc: always reset GuC before loading firmware
4f0836e699a720d8429de99f8d374e3a732a16f5 drm/i915/guc: reset GuC and retry on firmware load failure
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ✗ Fi.CI.BAT: failure for GuC reset-and-retry patches (resend)
2016-04-05 6:56 ` ✗ Fi.CI.BAT: failure for GuC reset-and-retry patches (resend) Patchwork
@ 2016-04-05 12:03 ` Dave Gordon
2016-04-05 12:32 ` Tvrtko Ursulin
0 siblings, 1 reply; 7+ messages in thread
From: Dave Gordon @ 2016-04-05 12:03 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: intel-gfx
On 05/04/16 07:56, Patchwork wrote:
> == Series Details ==
>
> Series: GuC reset-and-retry patches (resend)
> URL : https://patchwork.freedesktop.org/series/5287/
> State : failure
>
> == Summary ==
>
> Series 5287v1 GuC reset-and-retry patches (resend)
> http://patchwork.freedesktop.org/api/1.0/series/5287/revisions/1/mbox/
>
> Test gem_ctx_switch:
> Subgroup basic-default:
> pass -> DMESG-WARN (skl-i7k-2)
https://bugs.freedesktop.org/show_bug.cgi?id=93847
GuC is calling a sleeping function in atomic context
Fix in progress (unrelated to the reset-and-retry patches)
> Test gem_sync:
> Subgroup basic-bsd:
> pass -> DMESG-FAIL (ilk-hp8440p)
https://bugs.freedesktop.org/show_bug.cgi?id=94307
[BAT ILK] gem_sync/basic-bsd fails / hangcheck timer elapsed
Unrelated; being investigated by Gabriel Feceoru
> Test kms_flip:
> Subgroup basic-flip-vs-dpms:
> pass -> DMESG-WARN (ilk-hp8440p) UNSTABLE
https://bugs.freedesktop.org/show_bug.cgi?id=93787
[BAT ILK] sporadic fifo underruns in igt@kms_flip@basic-flip-vs-* on
ilk-hp8440p (edit)
Unrelated
> Test kms_force_connector_basic:
> Subgroup prune-stale-modes:
> skip -> PASS (ilk-hp8440p)
> Test kms_pipe_crc_basic:
> Subgroup suspend-read-crc-pipe-b:
> incomplete -> PASS (hsw-gt2)
> Test pm_rpm:
> Subgroup basic-pci-d3-state:
> pass -> DMESG-WARN (bsw-nuc-2)
https://bugs.freedesktop.org/show_bug.cgi?id=94164
[BAT BYT/BSW] Runtime PM: *ERROR* Unclaimed access detected prior to
suspending
Unrelated
> bdw-nuci7 total:196 pass:184 dwarn:0 dfail:0 fail:0 skip:12
> bdw-ultra total:196 pass:175 dwarn:0 dfail:0 fail:0 skip:21
> bsw-nuc-2 total:196 pass:158 dwarn:1 dfail:0 fail:0 skip:37
> byt-nuc total:196 pass:161 dwarn:0 dfail:0 fail:0 skip:35
> hsw-brixbox total:196 pass:174 dwarn:0 dfail:0 fail:0 skip:22
> hsw-gt2 total:196 pass:179 dwarn:0 dfail:0 fail:0 skip:17
> ilk-hp8440p total:196 pass:130 dwarn:1 dfail:1 fail:0 skip:64
> ivb-t430s total:196 pass:171 dwarn:0 dfail:0 fail:0 skip:25
> skl-i7k-2 total:196 pass:172 dwarn:1 dfail:0 fail:0 skip:23
> snb-dellxps total:196 pass:162 dwarn:0 dfail:0 fail:0 skip:34
> snb-x220t total:196 pass:162 dwarn:0 dfail:0 fail:1 skip:33
>
> Results at /archive/results/CI_IGT_test/Patchwork_1794/
>
> aedfaaef290af9c8df7d9f4adf22cbe21704d091 drm-intel-nightly: 2016y-04m-04d-13h-09m-54s UTC integration manifest
> c7e3e58bc5509154a98e7c2fa1e433538f67c97a DO NOT MERGE: add enable_guc_loading parameter
> 87ce739817a1d65a3770c67d27560ea7377ad05e drm/i915/guc: always reset GuC before loading firmware
> 4f0836e699a720d8429de99f8d374e3a732a16f5 drm/i915/guc: reset GuC and retry on firmware load failure
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ✗ Fi.CI.BAT: failure for GuC reset-and-retry patches (resend)
2016-04-05 12:03 ` Dave Gordon
@ 2016-04-05 12:32 ` Tvrtko Ursulin
0 siblings, 0 replies; 7+ messages in thread
From: Tvrtko Ursulin @ 2016-04-05 12:32 UTC (permalink / raw)
To: Dave Gordon; +Cc: intel-gfx
On 05/04/16 13:03, Dave Gordon wrote:
> On 05/04/16 07:56, Patchwork wrote:
>> == Series Details ==
>>
>> Series: GuC reset-and-retry patches (resend)
>> URL : https://patchwork.freedesktop.org/series/5287/
>> State : failure
>>
>> == Summary ==
>>
>> Series 5287v1 GuC reset-and-retry patches (resend)
>> http://patchwork.freedesktop.org/api/1.0/series/5287/revisions/1/mbox/
>>
>> Test gem_ctx_switch:
>> Subgroup basic-default:
>> pass -> DMESG-WARN (skl-i7k-2)
>
> https://bugs.freedesktop.org/show_bug.cgi?id=93847
> GuC is calling a sleeping function in atomic context
> Fix in progress (unrelated to the reset-and-retry patches)
>
>> Test gem_sync:
>> Subgroup basic-bsd:
>> pass -> DMESG-FAIL (ilk-hp8440p)
>
> https://bugs.freedesktop.org/show_bug.cgi?id=94307
> [BAT ILK] gem_sync/basic-bsd fails / hangcheck timer elapsed
> Unrelated; being investigated by Gabriel Feceoru
>
>> Test kms_flip:
>> Subgroup basic-flip-vs-dpms:
>> pass -> DMESG-WARN (ilk-hp8440p) UNSTABLE
>
> https://bugs.freedesktop.org/show_bug.cgi?id=93787
> [BAT ILK] sporadic fifo underruns in igt@kms_flip@basic-flip-vs-* on
> ilk-hp8440p (edit)
> Unrelated
>
>> Test kms_force_connector_basic:
>> Subgroup prune-stale-modes:
>> skip -> PASS (ilk-hp8440p)
>> Test kms_pipe_crc_basic:
>> Subgroup suspend-read-crc-pipe-b:
>> incomplete -> PASS (hsw-gt2)
>> Test pm_rpm:
>> Subgroup basic-pci-d3-state:
>> pass -> DMESG-WARN (bsw-nuc-2)
>
> https://bugs.freedesktop.org/show_bug.cgi?id=94164
> [BAT BYT/BSW] Runtime PM: *ERROR* Unclaimed access detected prior to
> suspending
> Unrelated
>
>> bdw-nuci7 total:196 pass:184 dwarn:0 dfail:0 fail:0
>> skip:12
>> bdw-ultra total:196 pass:175 dwarn:0 dfail:0 fail:0
>> skip:21
>> bsw-nuc-2 total:196 pass:158 dwarn:1 dfail:0 fail:0
>> skip:37
>> byt-nuc total:196 pass:161 dwarn:0 dfail:0 fail:0
>> skip:35
>> hsw-brixbox total:196 pass:174 dwarn:0 dfail:0 fail:0
>> skip:22
>> hsw-gt2 total:196 pass:179 dwarn:0 dfail:0 fail:0
>> skip:17
>> ilk-hp8440p total:196 pass:130 dwarn:1 dfail:1 fail:0
>> skip:64
>> ivb-t430s total:196 pass:171 dwarn:0 dfail:0 fail:0
>> skip:25
>> skl-i7k-2 total:196 pass:172 dwarn:1 dfail:0 fail:0
>> skip:23
>> snb-dellxps total:196 pass:162 dwarn:0 dfail:0 fail:0
>> skip:34
>> snb-x220t total:196 pass:162 dwarn:0 dfail:0 fail:1
>> skip:33
>>
>> Results at /archive/results/CI_IGT_test/Patchwork_1794/
>>
>> aedfaaef290af9c8df7d9f4adf22cbe21704d091 drm-intel-nightly:
>> 2016y-04m-04d-13h-09m-54s UTC integration manifest
>> c7e3e58bc5509154a98e7c2fa1e433538f67c97a DO NOT MERGE: add
>> enable_guc_loading parameter
>> 87ce739817a1d65a3770c67d27560ea7377ad05e drm/i915/guc: always reset
>> GuC before loading firmware
>> 4f0836e699a720d8429de99f8d374e3a732a16f5 drm/i915/guc: reset GuC and
>> retry on firmware load failure
1 and 2 merged, thanks for the patches and review!
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-04-05 12:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-04 17:50 [PATCH v4 0/3] GuC reset-and-retry patches (resend) Dave Gordon
2016-04-04 17:50 ` [PATCH v4 1/3] drm/i915/guc: reset GuC and retry on firmware load failure Dave Gordon
2016-04-04 17:50 ` [PATCH v4 2/3] drm/i915/guc: always reset GuC before loading firmware Dave Gordon
2016-04-04 17:50 ` [PATCH v4 3/3] DO NOT MERGE: add enable_guc_loading parameter Dave Gordon
2016-04-05 6:56 ` ✗ Fi.CI.BAT: failure for GuC reset-and-retry patches (resend) Patchwork
2016-04-05 12:03 ` Dave Gordon
2016-04-05 12:32 ` Tvrtko Ursulin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox