From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com ([134.134.136.20]:12560 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbcAGN0T (ORCPT ); Thu, 7 Jan 2016 08:26:19 -0500 Date: Thu, 7 Jan 2016 15:26:14 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Daniel Vetter Cc: DRI Development , Intel Graphics Development , Patrik Jakobsson , Imre Deak , Jani Nikula , Meelis Roos , Chris Wilson , stable , Daniel Vetter Subject: Re: [PATCH] drm/i915: Init power domains early in driver load Message-ID: <20160107132614.GC4437@intel.com> References: <1452157856-27360-1-git-send-email-daniel.vetter@ffwll.ch> <1452167061-27252-1-git-send-email-daniel.vetter@ffwll.ch> <20160107125226.GA4437@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On Thu, Jan 07, 2016 at 02:15:50PM +0100, Daniel Vetter wrote: > On Thu, Jan 7, 2016 at 1:52 PM, Ville Syrj�l� > wrote: > > On Thu, Jan 07, 2016 at 12:44:21PM +0100, Daniel Vetter wrote: > >> Since > >> > >> commit ac9b8236551d1177fd07b56aef9b565d1864420d > >> Author: Ville Syrj�l� > >> 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). > >> > >> Cc: Ville Syrj�l� > >> Cc: Patrik Jakobsson > >> Cc: Imre Deak > >> Cc: Jani Nikula > >> Cc: Meelis Roos > >> Cc: Chris Wilson > >> Fixes: ac9b8236551d ("drm/i915: Introduce a gmbus power domain") > >> Cc: stable@vger.kernel.org > >> References: http://www.spinics.net/lists/intel-gfx/msg83075.html > >> Tested-by: Meelis Roos > >> Signed-off-by: Daniel Vetter > >> --- > >> drivers/gpu/drm/i915/i915_dma.c | 11 +++++------ > >> 1 file changed, 5 insertions(+), 6 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c > >> index 988a3806512a..490d8b0d931e 100644 > >> --- a/drivers/gpu/drm/i915/i915_dma.c > >> +++ b/drivers/gpu/drm/i915/i915_dma.c > >> @@ -398,7 +398,6 @@ static int i915_load_modeset_init(struct drm_device *dev) > >> if (ret) > >> goto cleanup_vga_switcheroo; > >> > >> - intel_power_domains_init_hw(dev_priv, false); > >> > >> intel_csr_ucode_init(dev_priv); > >> > >> @@ -1025,6 +1024,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) > >> > >> intel_irq_init(dev_priv); > >> intel_uncore_sanitize(dev); > >> + intel_power_domains_init(dev_priv); > >> + intel_power_domains_init_hw(dev_priv); > > > > I think intel_init_dpio() needs to be moved too. We need to know the > > DPIO IOSF ports before attempting to talk to the PHY (which can happen > > from intel_power_domains_init_hw()). > > Ugh, will change. I think I placed the dpio init in the current place so that it sits next to intel_device_info_runtime_init(). Doing a lot of hw bashing before all this runtime device info stuff has been set up seems rather wrong to me. > > > I'm also wondering why we're doing gmbus init this early. We shouldn't > > need it until modeset init. > > Anyone can access the gmbus controller once we register it. Userspace > can (like what seems to happen on Meelis' box), but also the i2c core > has some auto-probed stuff in some configs afaik. Sure, but I don't see any reason why we'd need to init it that early. The only requirement is that we need to init before we ourselves use it, which I think means we don't actually need it until output setup. And gmbus being a component of the display engine means the init should really be part of the modeset init. So I tend to think the better fix would be to move gmbus init to happen later. -- Ville Syrj�l� Intel OTC