All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Imre Deak <imre.deak@intel.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 1/2] drm/i915: kill intel_resume_prepare()
Date: Mon, 3 Nov 2014 12:13:47 +0100	[thread overview]
Message-ID: <20141103111347.GL26941@phenom.ffwll.local> (raw)
In-Reply-To: <1414507634.8635.44.camel@intelbox>

On Tue, Oct 28, 2014 at 04:47:14PM +0200, Imre Deak wrote:
> On Tue, 2014-10-28 at 11:43 -0200, Paulo Zanoni wrote:
> > 2014-10-28 11:12 GMT-02:00 Imre Deak <imre.deak@intel.com>:
> > > On Mon, 2014-10-27 at 17:54 -0200, Paulo Zanoni wrote:
> > >> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > >>
> > >> Because, really, the abstraction is not working for us. It is nice for
> > >> VLV, but doesn't add anything useful on SNB/HSW/BDW. We want to change
> > >> this code due to a recently-discovered bug, but we can't seem to find
> > >> a nice solution that repects the current abstraction. So let's kill
> > >> intel_resume_prepare() and its friends, and add an equivalent
> > >> implementation to both its callers.
> > >>
> > >> Also, look at the diffstat!
> > >
> > > The reason for intel_resume_prepare() and intel_suspend_complete() was
> > > to contain platform dependent code in those and to share parts between
> > > the system and runtime suspend code, see the discussion at [1].
> > 
> > Well, IMHO we are just pretending to "share" the code paths between S3
> > and RPM because we still have the "bool rpm_resume" argument on the
> > current code. IMHO this is one of the biggest reasons why the code
> > became so complex: take a look at the second version of my patch, it
> > added even more "if (rpm_resume)" checks.
> 
> Yes, but that's one more thing we could try to remove at one point. For
> example intel_init_pch_refclk() in snb_resume_prepare() could be just as
> well called for both paths.
> 
> > I know that adding more
> > IS_VLV checks is not cool, but the S3 and RPM code paths are very
> > different here, and the VLV code even requires a really-weird
> > ordering. I _really_ think the code becomes much easier to
> > read/understand/modify by just killing intel_resume_prepare().
> > 
> > > I still
> > > think this is a good idea, but I admit we need to work on it more, by
> > > sharing more between the two paths. So for example instead of doing this
> > > revert now I would consider calling intel_uncore_early_sanitize() for
> > > both system and runtime resume.
> > 
> > That still wouldn't solve the ordering problem we have on S3. My goal
> > is just to fix a very simple bug with our function ordering...
> 
> I think it would by having in intel_resume_prepare():
> 
> if (IS_VALLEYVIEW(dev_priv))
> 	ret = vlv_resume_prepare(dev_priv, rpm_resume);
> intel_uncore_early_sanitize(dev,true);
> if (IS_HASWELL(dev_priv) ||IS_BROADWELL(dev_priv))
> 	hsw_disable_pc8(dev_priv);
> 
> and call it for both system and runtime resume.
> 
> > > But if that's not feasible and you want to go ahead with the removal
> > > then please also remove intel_suspend_complete(), leaving it in would be
> > > confusing imo.
> > 
> > I don't think so. It doesn't have all the "bool rpm_resume" confusion,
> > there's no function ordering issues with it, and both the S3 and RPM
> > versions are actually identical. I don't think killing it is relevant
> > to the bug we're trying to fix here, and I also don't think that
> > removing t would be an improvement to the code base.
> 
> It's confusing to call vlv_resume_prepare(), hsw_disable_pc8() from
> i915_drm_resume_early() directly and have to jump over some wrappers to
> find the corresponding vlv_suspend_complete(), hsw_enable_pc8() in
> i915_drm_suspend_complete(). But this is somewhat bikeshedding, so
> either way feel free to add on both patches:
> Reviewed-by: Imre Deak <imre.deak@intel.com>

Yeah that first attempt at unifying rpm and s3 didn't really pan out at
all. I guess we need to retry.

Meanwhile merged both patches to dinq.

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-11-03 11:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 19:01 [PATCH] drm/i915: run intel_uncore_early_sanitize earlier on resume on non-VLV Paulo Zanoni
2014-10-20 10:20 ` Imre Deak
2014-10-21 17:05   ` Daniel Vetter
2014-10-22 11:20     ` Imre Deak
2014-10-22 19:01       ` Paulo Zanoni
2014-10-23 10:56         ` [PATCH 1/2] drm/i915: kill intel_resume_prepare() Paulo Zanoni
2014-10-23 10:56           ` [PATCH 2/2] drm/i915: run hsw_disable_pc8() later on resume Paulo Zanoni
2014-10-23 12:13             ` Daniel Vetter
2014-10-27 19:54               ` [PATCH 1/2] drm/i915: kill intel_resume_prepare() Paulo Zanoni
2014-10-27 19:54                 ` [PATCH 2/2] drm/i915: run hsw_disable_pc8() later on resume Paulo Zanoni
2014-10-28 13:12                 ` [PATCH 1/2] drm/i915: kill intel_resume_prepare() Imre Deak
2014-10-28 13:43                   ` Paulo Zanoni
2014-10-28 14:47                     ` Imre Deak
2014-11-03 11:13                       ` Daniel Vetter [this message]
2014-10-23 12:16         ` [PATCH] drm/i915: run intel_uncore_early_sanitize earlier on resume on non-VLV 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=20141103111347.GL26941@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@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.