All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: DRI Development <dri-devel@lists.freedesktop.org>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Patrik Jakobsson <patrik.jakobsson@linux.intel.com>,
	Imre Deak <imre.deak@intel.com>,
	Jani Nikula <jani.nikula@intel.com>, Meelis Roos <mroos@linux.ee>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	stable@vger.kernel.org, Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm/i915: Init power domains early in driver load
Date: Thu, 7 Jan 2016 16:32:56 +0200	[thread overview]
Message-ID: <20160107143256.GE4437@intel.com> (raw)
In-Reply-To: <1452174665-13025-1-git-send-email-daniel.vetter@ffwll.ch>

On Thu, Jan 07, 2016 at 02:51:05PM +0100, Daniel Vetter wrote:
> Since
> 
> commit ac9b8236551d1177fd07b56aef9b565d1864420d
> Author: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> Date:   Fri Nov 27 18:55:26 2015 +0200
> 
>     drm/i915: Introduce a gmbus power domain
> 
> gmbus also needs the power domain infrastructure right from the start,
> since as soon as we register the i2c controllers someone can use them.
> 
> v2: Adjust cleanup paths too (Chris).
> 
> v3: Rebase onto -nightly (totally bogus tree I had lying around) and
> also move dpio init head (Ville).
> 
> v4: Ville instead suggested to move gmbus setup later in the sequence,
> since it's only needed by the modeset code.
> 
> v5: Move even close to the actual user, right next to the comment that
> states where we really need gmbus (and interrupts!).
> 
> Cc: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Meelis Roos <mroos@linux.ee>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Fixes: ac9b8236551d ("drm/i915: Introduce a gmbus power domain")
> Cc: stable@vger.kernel.org
> References: http://www.spinics.net/lists/intel-gfx/msg83075.html
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> 
> Meelis, can you pls retest this one?
> 
> Thanks, Daniel
> ---
>  drivers/gpu/drm/i915/i915_dma.c      | 6 +++---
>  drivers/gpu/drm/i915/intel_display.c | 2 ++
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 988a3806512a..d70d96fe553b 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -406,6 +406,8 @@ static int i915_load_modeset_init(struct drm_device *dev)
>  	if (ret)
>  		goto cleanup_gem_stolen;
>  
> +	intel_setup_gmbus(dev);
> +
>  	/* Important: The output setup functions called by modeset_init need
>  	 * working irqs for e.g. gmbus and dp aux transfers. */
>  	intel_modeset_init(dev);
> @@ -455,6 +457,7 @@ cleanup_gem:
>  cleanup_irq:
>  	intel_guc_ucode_fini(dev);
>  	drm_irq_uninstall(dev);
> +	intel_teardown_gmbus(dev);
>  cleanup_gem_stolen:
>  	i915_gem_cleanup_stolen(dev);
>  cleanup_vga_switcheroo:
> @@ -1028,7 +1031,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>  
>  	/* Try to make sure MCHBAR is enabled before poking at it */
>  	intel_setup_mchbar(dev);
> -	intel_setup_gmbus(dev);
>  	intel_opregion_setup(dev);
>  
>  	i915_gem_load(dev);
> @@ -1101,7 +1103,6 @@ out_gem_unload:
>  	if (dev->pdev->msi_enabled)
>  		pci_disable_msi(dev->pdev);
>  
> -	intel_teardown_gmbus(dev);
>  	intel_teardown_mchbar(dev);
>  	pm_qos_remove_request(&dev_priv->pm_qos);
>  	destroy_workqueue(dev_priv->gpu_error.hangcheck_wq);
> @@ -1203,7 +1204,6 @@ int i915_driver_unload(struct drm_device *dev)
>  
>  	intel_csr_ucode_fini(dev_priv);
>  
> -	intel_teardown_gmbus(dev);
>  	intel_teardown_mchbar(dev);
>  
>  	destroy_workqueue(dev_priv->hotplug.dp_wq);
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 37945ddb4dad..ac0038bf4fbf 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -15971,6 +15971,8 @@ void intel_modeset_cleanup(struct drm_device *dev)
>  	mutex_lock(&dev->struct_mutex);
>  	intel_cleanup_gt_powersave(dev);
>  	mutex_unlock(&dev->struct_mutex);
> +
> +	intel_teardown_gmbus(dev);

The cleanup path is where things might still be a bit wonky. Should we be
doing this before turning off the interrupts? But then that might mean
that the hpd cleanup needs to be rehashed somewhat to make sure we shut
down hpd before unregistering gmbus. The whole init/cleanup sequence is
a bit of a mess tbh, so a major overhaul might be required to make it
actually sane.

In any case, I'm thinking this is at least no worse that what we had, so 
Reviewed-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>

>  }
>  
>  /*
> -- 
> 2.6.4

-- 
Ville Syrj�l�
Intel OTC

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Meelis Roos <mroos@linux.ee>, Jani Nikula <jani.nikula@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	stable@vger.kernel.org, Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm/i915: Init power domains early in driver load
Date: Thu, 7 Jan 2016 16:32:56 +0200	[thread overview]
Message-ID: <20160107143256.GE4437@intel.com> (raw)
In-Reply-To: <1452174665-13025-1-git-send-email-daniel.vetter@ffwll.ch>

On Thu, Jan 07, 2016 at 02:51:05PM +0100, Daniel Vetter wrote:
> Since
> 
> commit ac9b8236551d1177fd07b56aef9b565d1864420d
> Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Date:   Fri Nov 27 18:55:26 2015 +0200
> 
>     drm/i915: Introduce a gmbus power domain
> 
> gmbus also needs the power domain infrastructure right from the start,
> since as soon as we register the i2c controllers someone can use them.
> 
> v2: Adjust cleanup paths too (Chris).
> 
> v3: Rebase onto -nightly (totally bogus tree I had lying around) and
> also move dpio init head (Ville).
> 
> v4: Ville instead suggested to move gmbus setup later in the sequence,
> since it's only needed by the modeset code.
> 
> v5: Move even close to the actual user, right next to the comment that
> states where we really need gmbus (and interrupts!).
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Meelis Roos <mroos@linux.ee>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Fixes: ac9b8236551d ("drm/i915: Introduce a gmbus power domain")
> Cc: stable@vger.kernel.org
> References: http://www.spinics.net/lists/intel-gfx/msg83075.html
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> 
> Meelis, can you pls retest this one?
> 
> Thanks, Daniel
> ---
>  drivers/gpu/drm/i915/i915_dma.c      | 6 +++---
>  drivers/gpu/drm/i915/intel_display.c | 2 ++
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 988a3806512a..d70d96fe553b 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -406,6 +406,8 @@ static int i915_load_modeset_init(struct drm_device *dev)
>  	if (ret)
>  		goto cleanup_gem_stolen;
>  
> +	intel_setup_gmbus(dev);
> +
>  	/* Important: The output setup functions called by modeset_init need
>  	 * working irqs for e.g. gmbus and dp aux transfers. */
>  	intel_modeset_init(dev);
> @@ -455,6 +457,7 @@ cleanup_gem:
>  cleanup_irq:
>  	intel_guc_ucode_fini(dev);
>  	drm_irq_uninstall(dev);
> +	intel_teardown_gmbus(dev);
>  cleanup_gem_stolen:
>  	i915_gem_cleanup_stolen(dev);
>  cleanup_vga_switcheroo:
> @@ -1028,7 +1031,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>  
>  	/* Try to make sure MCHBAR is enabled before poking at it */
>  	intel_setup_mchbar(dev);
> -	intel_setup_gmbus(dev);
>  	intel_opregion_setup(dev);
>  
>  	i915_gem_load(dev);
> @@ -1101,7 +1103,6 @@ out_gem_unload:
>  	if (dev->pdev->msi_enabled)
>  		pci_disable_msi(dev->pdev);
>  
> -	intel_teardown_gmbus(dev);
>  	intel_teardown_mchbar(dev);
>  	pm_qos_remove_request(&dev_priv->pm_qos);
>  	destroy_workqueue(dev_priv->gpu_error.hangcheck_wq);
> @@ -1203,7 +1204,6 @@ int i915_driver_unload(struct drm_device *dev)
>  
>  	intel_csr_ucode_fini(dev_priv);
>  
> -	intel_teardown_gmbus(dev);
>  	intel_teardown_mchbar(dev);
>  
>  	destroy_workqueue(dev_priv->hotplug.dp_wq);
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 37945ddb4dad..ac0038bf4fbf 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -15971,6 +15971,8 @@ void intel_modeset_cleanup(struct drm_device *dev)
>  	mutex_lock(&dev->struct_mutex);
>  	intel_cleanup_gt_powersave(dev);
>  	mutex_unlock(&dev->struct_mutex);
> +
> +	intel_teardown_gmbus(dev);

The cleanup path is where things might still be a bit wonky. Should we be
doing this before turning off the interrupts? But then that might mean
that the hpd cleanup needs to be rehashed somewhat to make sure we shut
down hpd before unregistering gmbus. The whole init/cleanup sequence is
a bit of a mess tbh, so a major overhaul might be required to make it
actually sane.

In any case, I'm thinking this is at least no worse that what we had, so 
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  }
>  
>  /*
> -- 
> 2.6.4

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-07 14:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07  9:10 [PATCH] drm/i915: Init power domains early in driver load Daniel Vetter
2016-01-07  9:10 ` Daniel Vetter
2016-01-07  9:22 ` [Intel-gfx] " Chris Wilson
2016-01-07  9:22   ` Chris Wilson
2016-01-07 10:23 ` Meelis Roos
2016-01-07 10:23   ` Meelis Roos
2016-01-07 11:44 ` Daniel Vetter
2016-01-07 11:52   ` Chris Wilson
2016-01-07 11:52     ` Chris Wilson
2016-01-07 11:52   ` [Intel-gfx] " kbuild test robot
2016-01-07 11:52     ` kbuild test robot
2016-01-07 12:14   ` Jani Nikula
2016-01-07 12:14     ` Jani Nikula
2016-01-07 12:52   ` Ville Syrjälä
2016-01-07 12:52     ` Ville Syrjälä
2016-01-07 13:15     ` Daniel Vetter
2016-01-07 13:25       ` Jani Nikula
2016-01-07 13:25         ` Jani Nikula
2016-01-07 13:26       ` Ville Syrjälä
2016-01-07 13:26         ` Ville Syrjälä
2016-01-07 13:16 ` Daniel Vetter
2016-01-07 13:51 ` Daniel Vetter
2016-01-07 14:32   ` Ville Syrjälä [this message]
2016-01-07 14:32     ` Ville Syrjälä
2016-01-07 15:49   ` Meelis Roos
2016-01-07 19:41   ` Meelis Roos
2016-01-07 19:41     ` Meelis Roos
2016-01-11  9:12 ` ✗ failure: Fi.CI.BAT Patchwork
2016-01-13 10:55 [PATCH] drm/i915: Init power domains early in driver load 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=20160107143256.GE4437@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=mroos@linux.ee \
    --cc=patrik.jakobsson@linux.intel.com \
    --cc=stable@vger.kernel.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.