All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Animesh Manna <animesh.manna@intel.com>
Cc: Suketu Shah <suketu.j.shah@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v4 2/8] drm/i915/skl: Add DC5 Trigger Sequence.
Date: Thu, 16 Apr 2015 12:48:56 +0300	[thread overview]
Message-ID: <1429177736.26416.29.camel@intel.com> (raw)
In-Reply-To: <1429176315.26416.18.camel@intel.com>

On to, 2015-04-16 at 12:25 +0300, Imre Deak wrote:
> On to, 2015-04-16 at 14:22 +0530, Animesh Manna wrote:
> >  [...]
> > @@ -223,11 +244,13 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  
> >  	if (!fw) {
> >  		i915_firmware_load_error_print(csr->fw_path, 0);
> > +		intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  		goto out;
> >  	}
> >  
> >  	if ((stepping == -ENODATA) || (substepping == -ENODATA)) {
> >  		DRM_ERROR("Unknown stepping info, firmware loading failed\n");
> > +		intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  		goto out;
> >  	}
> >  
> > @@ -237,6 +260,7 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  		(css_header->header_len * 4)) {
> >  		DRM_ERROR("Firmware has wrong CSS header length %u bytes\n",
> >  			(css_header->header_len * 4));
> > +		intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  		goto out;
> >  	}
> >  	readcount += sizeof(struct intel_css_header);
> > @@ -248,6 +272,7 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  		(package_header->header_len * 4)) {
> >  		DRM_ERROR("Firmware has wrong package header length %u bytes\n",
> >  			(package_header->header_len * 4));
> > +		intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  		goto out;
> >  	}
> >  	readcount += sizeof(struct intel_package_header);
> > @@ -268,6 +293,7 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  	}
> >  	if (dmc_offset == CSR_DEFAULT_FW_OFFSET) {
> >  		DRM_ERROR("Firmware not supported for %c stepping\n", stepping);
> > +		intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  		goto out;
> >  	}
> >  	readcount += dmc_offset;
> > @@ -277,6 +303,7 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  	if (sizeof(struct intel_dmc_header) != (dmc_header->header_len)) {
> >  		DRM_ERROR("Firmware has wrong dmc header length %u bytes\n",
> >  				(dmc_header->header_len));
> > +		intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  		goto out;
> >  	}
> >  	readcount += sizeof(struct intel_dmc_header);
> > @@ -285,6 +312,7 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  	if (dmc_header->mmio_count > ARRAY_SIZE(csr->mmioaddr)) {
> >  		DRM_ERROR("Firmware has wrong mmio count %u\n",
> >  						dmc_header->mmio_count);
> > +		intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  		goto out;
> >  	}
> >  	csr->mmio_count = dmc_header->mmio_count;
> > @@ -293,6 +321,7 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  			dmc_header->mmioaddr[i] > CSR_MMIO_END_RANGE) {
> >  			DRM_ERROR(" Firmware has wrong mmio address 0x%x\n",
> >  						dmc_header->mmioaddr[i]);
> > +			intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  			goto out;
> >  		}
> >  		csr->mmioaddr[i] = dmc_header->mmioaddr[i];
> > @@ -303,6 +332,7 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  	nbytes = dmc_header->fw_size * 4;
> >  	if (nbytes > CSR_MAX_FW_SIZE) {
> >  		DRM_ERROR("CSR firmware too big (%u) bytes\n", nbytes);
> > +		intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  		goto out;
> >  	}
> >  	csr->dmc_fw_size = dmc_header->fw_size;
> > @@ -310,6 +340,7 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  	csr->dmc_payload = kmalloc(nbytes, GFP_KERNEL);
> >  	if (!csr->dmc_payload) {
> >  		DRM_ERROR("Memory allocation failed for dmc payload\n");
> > +		intel_csr_load_status_set(dev_priv, FW_FAILED);
> >  		goto out;
> >  	}
> >  
> > @@ -327,6 +358,11 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  	/* load csr program during system boot, as needed for DC states */
> >  	intel_csr_load_program(dev);
> >  out:

Also, since you have to anyway change the patch: could you replace all
the above intel_csr_load_status_set(dev_priv, FW_FAILED); with one here
using a fw_loaded bool that you set after intel_csr_load_program?

> > +	/*
> > +	 * Release the runtime pm reference obtained when
> > +	 * CSR wasn't loaded.
> > +	 */
> > +	intel_runtime_pm_put(dev_priv);


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

  reply	other threads:[~2015-04-16  9:48 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16  8:52 [PATCH v4 0/8] Enable DC states for skl Animesh Manna
2015-04-16  8:52 ` [PATCH v4 1/8] drm/i915/skl: Add support to load SKL CSR firmware Animesh Manna
2015-04-16  9:18   ` Damien Lespiau
2015-04-16  9:21   ` Imre Deak
2015-04-16 11:59     ` Animesh Manna
2015-04-16 11:25       ` Imre Deak
2015-04-16 14:23         ` Animesh Manna
2015-04-16 15:20           ` Imre Deak
2015-04-28 14:45   ` Imre Deak
2015-04-29 17:29     ` [PATCH v5 " Animesh Manna
2015-04-30 13:02       ` Imre Deak
2015-05-04  9:30         ` Daniel Vetter
2015-05-04 10:31           ` Imre Deak
2015-05-04 12:54       ` Daniel Vetter
2015-04-16  8:52 ` [PATCH v4 2/8] drm/i915/skl: Add DC5 Trigger Sequence Animesh Manna
2015-04-16  9:25   ` Imre Deak
2015-04-16  9:48     ` Imre Deak [this message]
2015-04-17  5:59       ` Animesh Manna
2015-04-17  7:15         ` Imre Deak
2015-04-17 14:16           ` [PATCH v5 2/2] " Animesh Manna
2015-04-30 13:18             ` Imre Deak
2015-05-04  9:39             ` Daniel Vetter
2015-04-16  8:52 ` [PATCH v4 3/8] drm/i915/skl: Implement enable/disable for Display C5 state Animesh Manna
2015-04-30 13:21   ` Imre Deak
2015-04-16  8:52 ` [PATCH v4 4/8] drm/i915/skl: Assert the requirements to enter or exit DC5 Animesh Manna
2015-04-30 13:26   ` Imre Deak
2015-04-16  8:52 ` [PATCH v4 5/8] drm/i915/skl: Add DC6 Trigger sequence Animesh Manna
2015-04-30 13:41   ` Imre Deak
2015-05-04  9:44   ` Daniel Vetter
2015-05-04 13:05   ` Daniel Vetter
2015-04-16  8:52 ` [PATCH v4 6/8] Implement enable/disable for Display C6 state Animesh Manna
2015-04-30 13:45   ` Imre Deak
2015-04-16  8:52 ` [PATCH v4 7/8] drm/i915/skl: Assert the requirements to enter or exit DC6 Animesh Manna
2015-04-16  8:52 ` [PATCH v4 8/8] drm/i915/skl: Enable runtime PM Animesh Manna
2015-04-17  1:52   ` shuang.he
2015-04-30 13:47   ` Imre Deak
2015-05-04 13:12 ` [PATCH v4 0/8] Enable DC states for skl Daniel Vetter

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=1429177736.26416.29.camel@intel.com \
    --to=imre.deak@intel.com \
    --cc=animesh.manna@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=suketu.j.shah@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 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.