All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Arkadiusz Hiler <arkadiusz.hiler@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v6] drm/i915/guc: Simplify intel_guc_init_hw()
Date: Mon, 13 Mar 2017 11:38:15 +0200	[thread overview]
Message-ID: <1489397895.3001.6.camel@linux.intel.com> (raw)
In-Reply-To: <20170310114606.17793-1-arkadiusz.hiler@intel.com>

On pe, 2017-03-10 at 12:46 +0100, Arkadiusz Hiler wrote:
> Current version of intel_guc_init_hw() does a lot:
>  - cares about submission
>  - loads huc
>  - implement WA
> 
> This change offloads some of the logic to intel_uc_init_hw(), which now
> cares about the above.
> 
> v2: rename guc_hw_reset and fix typo in define name (M. Wajdeczko)
> v3: rename once again
> v4: remove spurious comments and add some style (J. Lahtinen)
> v5: flow changes, got rid of dead checks (M. Wajdeczko)
> v6: rebase
> 
> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
> Cc: Michal Winiarski <michal.winiarski@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

<SNIP>

> +int intel_uc_init_hw(struct drm_i915_private *dev_priv)
> +{
> +	int ret, attempts;
> +	const int guc_wa_hash_check_not_set_attempts = 3;

I wouldn't bother with this const, the Wa comment makes it pretty clear
already.

Extra newline here, too.

<SNIP>

> +fail:
> +	/*
> +	 * 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).
> +	 */
> +	DRM_ERROR("GuC init failed\n");
> +	if (i915.enable_guc_loading > 1 || i915.enable_guc_submission > 1)
> +		ret = -EIO;
> +	else
> +		ret = 0;
> +
> +	if (i915.enable_guc_submission) {
> +		i915.enable_guc_submission = 0;
> +		DRM_NOTE("Falling back from GuC submission to execlist mode\n");
> +	}
> +

I'd drop the above code to the bottom.

> +	i915_ggtt_disable_guc(dev_priv);
> +	intel_guc_release_interrupts(dev_priv);
> +	i915_guc_submission_disable(dev_priv);
> +	i915_guc_submission_fini(dev_priv);

And make this teardown oniony with some more labels.

With those changes, looks good to me.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-03-13  9:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 15:24 [PATCH v7 00/10] GuC Scrub vol. 1 Arkadiusz Hiler
2017-03-07 15:24 ` [PATCH 01/10] drm/i915/uc: Drop superfluous externs in intel_uc.h Arkadiusz Hiler
2017-03-07 15:24 ` [PATCH 02/10] drm/i915/huc: Add huc_to_i915 Arkadiusz Hiler
2017-03-07 15:24 ` [PATCH 03/10] drm/i915/uc: Rename intel_?uc_{setup, load}() to _init_hw() Arkadiusz Hiler
2017-03-07 15:24 ` [PATCH 04/10] drm/i915/uc: Move intel_uc_fw_fetch() to intel_uc.c Arkadiusz Hiler
2017-03-07 15:24 ` [PATCH 05/10] drm/i915/uc: Introduce intel_uc_init_fw() Arkadiusz Hiler
2017-03-07 15:24 ` [PATCH 06/10] drm/i915/guc: Extract param logic form guc_init_fw() Arkadiusz Hiler
2017-03-07 15:24 ` [PATCH 07/10] drm/i915/guc: Simplify intel_guc_init_hw() Arkadiusz Hiler
2017-03-10 11:46   ` [PATCH v6] " Arkadiusz Hiler
2017-03-10 12:11     ` Michal Wajdeczko
2017-03-13 12:43       ` Arkadiusz Hiler
2017-03-13  9:38     ` Joonas Lahtinen [this message]
2017-03-07 15:24 ` [PATCH 08/10] drm/i915/uc: Simplify firmware path handling Arkadiusz Hiler
2017-03-07 15:24 ` [PATCH 09/10] drm/i915/uc: Separate firmware selection and preparation Arkadiusz Hiler
2017-03-07 15:25 ` [PATCH 10/10] drm/i915/uc: Add params for specifying firmware Arkadiusz Hiler
2017-03-08  1:19   ` Srivatsa, Anusha
2017-03-08  9:23     ` Jani Nikula
2017-03-08 10:10       ` Arkadiusz Hiler
2017-03-08 10:02     ` Arkadiusz Hiler
2017-03-13  9:51       ` Joonas Lahtinen
2017-03-07 15:47 ` ✓ Fi.CI.BAT: success for GuC Scrub vol. 1 (rev10) Patchwork
2017-03-10 14:48 ` ✗ Fi.CI.BAT: warning for GuC Scrub vol. 1 (rev11) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489397895.3001.6.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=arkadiusz.hiler@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.