All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa, Anusha" <anusha.srivatsa@intel.com>
To: "Wajdeczko, Michal" <Michal.Wajdeczko@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/huc: Simplify intel_huc_init_hw()
Date: Mon, 3 Apr 2017 18:51:10 +0000	[thread overview]
Message-ID: <83F5C7385F545743AD4FB2A62F75B073019AA6E2@ORSMSX108.amr.corp.intel.com> (raw)
In-Reply-To: <20170331115709.181940-1-michal.wajdeczko@intel.com>

I like the changes, definitely simplifies things.

>-----Original Message-----
>From: Wajdeczko, Michal
>Sent: Friday, March 31, 2017 4:57 AM
>To: intel-gfx@lists.freedesktop.org
>Cc: Wajdeczko, Michal <Michal.Wajdeczko@intel.com>; Srivatsa, Anusha
><anusha.srivatsa@intel.com>; Hiler, Arkadiusz <arkadiusz.hiler@intel.com>;
>Ursulin, Tvrtko <tvrtko.ursulin@intel.com>
>Subject: [PATCH] drm/i915/huc: Simplify intel_huc_init_hw()
>
>On last guc/huc cleanup series we've simplified guc init hw function but missed
>the one for the huc. While here, change its signature as we don't care about huc
>loading status.
>
>Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
>Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
>Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Reviewed-by: Anusha Srivatsa <anusha.srivatsa@intel.com>

> drivers/gpu/drm/i915/intel_huc.c | 48 +++++++---------------------------------
> drivers/gpu/drm/i915/intel_uc.h  |  2 +-
> 2 files changed, 9 insertions(+), 41 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/intel_huc.c b/drivers/gpu/drm/i915/intel_huc.c
>index 9ee8196..385cacb 100644
>--- a/drivers/gpu/drm/i915/intel_huc.c
>+++ b/drivers/gpu/drm/i915/intel_huc.c
>@@ -186,68 +186,36 @@ void intel_huc_select_fw(struct intel_huc *huc)
>  * earlier call to intel_huc_init(), so here we need only check that
>  * is succeeded, and then transfer the image to the h/w.
>  *
>- * Return:	non-zero code on error
>  */
>-int intel_huc_init_hw(struct intel_huc *huc)
>+void intel_huc_init_hw(struct intel_huc *huc)
> {
> 	struct drm_i915_private *dev_priv = huc_to_i915(huc);
> 	int err;
>
>-	if (huc->fw.fetch_status == INTEL_UC_FIRMWARE_NONE)
>-		return 0;
>-
> 	DRM_DEBUG_DRIVER("%s fw status: fetch %s, load %s\n",
> 		huc->fw.path,
> 		intel_uc_fw_status_repr(huc->fw.fetch_status),
> 		intel_uc_fw_status_repr(huc->fw.load_status));
>
>-	if (huc->fw.fetch_status == INTEL_UC_FIRMWARE_SUCCESS &&
>-	    huc->fw.load_status == INTEL_UC_FIRMWARE_FAIL)
>-		return -ENOEXEC;
>+	if (huc->fw.fetch_status != INTEL_UC_FIRMWARE_SUCCESS)
>+		return;
>
> 	huc->fw.load_status = INTEL_UC_FIRMWARE_PENDING;
>
>-	switch (huc->fw.fetch_status) {
>-	case INTEL_UC_FIRMWARE_FAIL:
>-		/* something went wrong :( */
>-		err = -EIO;
>-		goto fail;
>-
>-	case INTEL_UC_FIRMWARE_NONE:
>-	case INTEL_UC_FIRMWARE_PENDING:
>-	default:
>-		/* "can't happen" */
>-		WARN_ONCE(1, "HuC fw %s invalid fetch_status %s [%d]\n",
>-			huc->fw.path,
>-			intel_uc_fw_status_repr(huc->fw.fetch_status),
>-			huc->fw.fetch_status);
>-		err = -ENXIO;
>-		goto fail;
>-
>-	case INTEL_UC_FIRMWARE_SUCCESS:
>-		break;
>-	}
>-
> 	err = huc_ucode_xfer(dev_priv);
>-	if (err)
>-		goto fail;
>
>-	huc->fw.load_status = INTEL_UC_FIRMWARE_SUCCESS;
>+	huc->fw.load_status = err ?
>+		INTEL_UC_FIRMWARE_FAIL : INTEL_UC_FIRMWARE_SUCCESS;
>
> 	DRM_DEBUG_DRIVER("%s fw status: fetch %s, load %s\n",
> 		huc->fw.path,
> 		intel_uc_fw_status_repr(huc->fw.fetch_status),
> 		intel_uc_fw_status_repr(huc->fw.load_status));
>
>-	return 0;
>-
>-fail:
>-	if (huc->fw.load_status == INTEL_UC_FIRMWARE_PENDING)
>-		huc->fw.load_status = INTEL_UC_FIRMWARE_FAIL;
>-
>-	DRM_ERROR("Failed to complete HuC uCode load with ret %d\n", err);
>+	if (huc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
>+		DRM_ERROR("Failed to complete HuC uCode load with ret
>%d\n", err);
>
>-	return err;
>+	return;
> }
>
> /**
>diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
>index 4b7f73a..2f0229d 100644
>--- a/drivers/gpu/drm/i915/intel_uc.h
>+++ b/drivers/gpu/drm/i915/intel_uc.h
>@@ -266,7 +266,7 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)
>
> /* intel_huc.c */
> void intel_huc_select_fw(struct intel_huc *huc); -int intel_huc_init_hw(struct
>intel_huc *huc);
>+void intel_huc_init_hw(struct intel_huc *huc);
> void intel_guc_auth_huc(struct drm_i915_private *dev_priv);
>
> #endif
>--
>2.7.4

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

      parent reply	other threads:[~2017-04-03 18:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 11:57 [PATCH] drm/i915/huc: Simplify intel_huc_init_hw() Michal Wajdeczko
2017-03-31 12:58 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-04-04 13:25   ` Tvrtko Ursulin
2017-04-03 18:51 ` Srivatsa, Anusha [this message]

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=83F5C7385F545743AD4FB2A62F75B073019AA6E2@ORSMSX108.amr.corp.intel.com \
    --to=anusha.srivatsa@intel.com \
    --cc=Michal.Wajdeczko@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.