public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v6] drm/i915/guc: Simplify intel_guc_init_hw()
Date: Mon, 13 Mar 2017 13:43:39 +0100	[thread overview]
Message-ID: <20170313124338.GA5550@ahiler-desk.igk.intel.com> (raw)
In-Reply-To: <20170310121106.GA102444@mwajdecz-MOBL1.ger.corp.intel.com>

On Fri, Mar 10, 2017 at 01:11:06PM +0100, Michal Wajdeczko wrote:
> On Fri, Mar 10, 2017 at 12:46:06PM +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
> 
> > @@ -397,42 +379,22 @@ int intel_guc_init_hw(struct intel_guc *guc)
> >  {
> >  	struct drm_i915_private *dev_priv = guc_to_i915(guc);
> >  	const char *fw_path = guc->fw.path;
> > -	int retries, ret, err;
> > +	int ret;
> >  
> >  	DRM_DEBUG_DRIVER("GuC fw status: path %s, fetch %s, load %s\n",
> >  		fw_path,
> >  		intel_uc_fw_status_repr(guc->fw.fetch_status),
> >  		intel_uc_fw_status_repr(guc->fw.load_status));
> >  
> > -	/* Loading forbidden, or no firmware to load? */
> > -	if (!i915.enable_guc_loading) {
> > -		err = 0;
> > -		goto fail;
> > -	} else if (fw_path == NULL) {
> > -		/* Device is known to have no uCode (e.g. no GuC) */
> > -		err = -ENXIO;
> > -		goto fail;
> > +	if (!fw_path) {
> > +		return -ENXIO;
> >  	} else if (*fw_path == '\0') {
> > -		/* Device has a GuC but we don't know what f/w to load? */
> >  		WARN(1, "No GuC firmware known for this platform!\n");
> > -		err = -ENODEV;
> > -		goto fail;
> > +		return -ENODEV;
> >  	}
> >  
> > -	/* Fetch failed, or already fetched but failed to load? */
> > -	if (guc->fw.fetch_status != INTEL_UC_FIRMWARE_SUCCESS) {
> > -		err = -EIO;
> > -		goto fail;
> > -	} else if (guc->fw.load_status == INTEL_UC_FIRMWARE_FAIL) {
> > -		err = -ENOEXEC;
> > -		goto fail;
> > -	}
> > -
> > -	guc_interrupts_release(dev_priv);
> > -	gen9_reset_guc_interrupts(dev_priv);
> > -
> > -	/* We need to notify the guc whenever we change the GGTT */
> > -	i915_ggtt_enable_guc(dev_priv);
> > +	if (guc->fw.fetch_status != INTEL_UC_FIRMWARE_SUCCESS)
> > +		return -EIO;
> 
> Above fw_path checks seem to be redundant as we also look for fetch status here.

Got rid of it in the path simplifying patch. Thanks.

> > @@ -63,6 +84,98 @@ void intel_uc_init_fw(struct drm_i915_private *dev_priv)
> >  	intel_guc_init_fw(&dev_priv->guc);
> >  }
> >  
> > +int intel_uc_init_hw(struct drm_i915_private *dev_priv)
> > +{
> > +	int ret, attempts;
> > +	const int guc_wa_hash_check_not_set_attempts = 3;
> 
> In all other places, we put const vars definitions as first statements.
> And maybe this const should be accompanied by the /* Wa */ comment
> that is shown below. Also changing prefix to "gen9" maybe helpful

Went with using it directly, as Joonas suggested. The current if-else
statement makes meaning obvious enough without having the need to name
it.

-- 
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-03-13 12:43 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 [this message]
2017-03-13  9:38     ` Joonas Lahtinen
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=20170313124338.GA5550@ahiler-desk.igk.intel.com \
    --to=arkadiusz.hiler@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox