[03/11] drm/i915: keep power domains init/remove calls at the same level

Submitted by Jani Nikula on Oct. 7, 2019, 3:09 p.m.

Details

Message ID 78db9ee138d961e5dee01813269aecfa61bc1d66.1570460714.git.jani.nikula@intel.com
State New
Headers show
Series "drm/i915: modeset probe/remove cleanup" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Jani Nikula Oct. 7, 2019, 3:09 p.m.
Move intel_power_domains_init_hw() call one level higher, to be on the
same level as all the other intel_power_domains_*() calls in the
probe/remove paths.

This also moves the power domain hw init earlier in the sequence, along
with the dependent intel_update_rawclk() call. As far as I can tell
there should not be any other dependencies on the initalization that's
now done after these calls (vblank init, bios init, vga register).

Cc: Imre Deak <imre.deak@intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 0abfece20c57..16ac5e88e1ec 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -289,11 +289,6 @@  static int i915_driver_modeset_probe(struct drm_i915_private *i915)
 	if (ret)
 		goto out;
 
-	/* must happen before intel_power_domains_init_hw() on VLV/CHV */
-	intel_update_rawclk(i915);
-
-	intel_power_domains_init_hw(i915, false);
-
 	intel_csr_ucode_init(i915);
 
 	ret = intel_irq_install(i915);
@@ -336,7 +331,6 @@  static int i915_driver_modeset_probe(struct drm_i915_private *i915)
 	intel_irq_uninstall(i915);
 cleanup_csr:
 	intel_csr_ucode_fini(i915);
-	intel_power_domains_driver_remove(i915);
 	intel_vga_unregister(i915);
 out:
 	return ret;
@@ -1493,6 +1487,11 @@  int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret < 0)
 		goto out_cleanup_mmio;
 
+	/* must happen before intel_power_domains_init_hw() on VLV/CHV */
+	intel_update_rawclk(i915);
+
+	intel_power_domains_init_hw(i915, false);
+
 	ret = i915_driver_modeset_probe(i915);
 	if (ret < 0)
 		goto out_cleanup_hw;
@@ -1506,6 +1505,7 @@  int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	return 0;
 
 out_cleanup_hw:
+	intel_power_domains_driver_remove(i915);
 	i915_driver_hw_remove(i915);
 	i915_ggtt_driver_release(i915);
 out_cleanup_mmio:

Comments

On Mon, 07 Oct 2019, Jani Nikula <jani.nikula@intel.com> wrote:
> Move intel_power_domains_init_hw() call one level higher, to be on the
> same level as all the other intel_power_domains_*() calls in the
> probe/remove paths.
>
> This also moves the power domain hw init earlier in the sequence, along
> with the dependent intel_update_rawclk() call. As far as I can tell
> there should not be any other dependencies on the initalization that's
> now done after these calls (vblank init, bios init, vga register).

As Imre told me, the power domain code depends on both the vga and bios
inits. Drawing board, here we go again.

BR,
Jani.


>
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 0abfece20c57..16ac5e88e1ec 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -289,11 +289,6 @@ static int i915_driver_modeset_probe(struct drm_i915_private *i915)
>  	if (ret)
>  		goto out;
>  
> -	/* must happen before intel_power_domains_init_hw() on VLV/CHV */
> -	intel_update_rawclk(i915);
> -
> -	intel_power_domains_init_hw(i915, false);
> -
>  	intel_csr_ucode_init(i915);
>  
>  	ret = intel_irq_install(i915);
> @@ -336,7 +331,6 @@ static int i915_driver_modeset_probe(struct drm_i915_private *i915)
>  	intel_irq_uninstall(i915);
>  cleanup_csr:
>  	intel_csr_ucode_fini(i915);
> -	intel_power_domains_driver_remove(i915);
>  	intel_vga_unregister(i915);
>  out:
>  	return ret;
> @@ -1493,6 +1487,11 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (ret < 0)
>  		goto out_cleanup_mmio;
>  
> +	/* must happen before intel_power_domains_init_hw() on VLV/CHV */
> +	intel_update_rawclk(i915);
> +
> +	intel_power_domains_init_hw(i915, false);
> +
>  	ret = i915_driver_modeset_probe(i915);
>  	if (ret < 0)
>  		goto out_cleanup_hw;
> @@ -1506,6 +1505,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	return 0;
>  
>  out_cleanup_hw:
> +	intel_power_domains_driver_remove(i915);
>  	i915_driver_hw_remove(i915);
>  	i915_ggtt_driver_release(i915);
>  out_cleanup_mmio: