diff mbox

[1/2] drm/i915/vlv: Workaround a punit issue in DDR data rate for 1333.

Message ID 1383809007-19552-1-git-send-email-chon.ming.lee@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chon Ming Lee Nov. 7, 2013, 7:23 a.m. UTC
For DDR data rate reporting by Punit in PUNIT_GPU_FREQ_STS, the actual
data encoding is 00b=800, 01b=1066, 10b=1333, 11b=1333.

Some premium VLV sku will get the DDR_DATA_RATE set as 11.  As a result,
the turbo frequency reporting will be incorrect without this workaround.

Signed-off-by: Chon Ming Lee <chon.ming.lee@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

Comments

Ville Syrjala Nov. 7, 2013, 12:46 p.m. UTC | #1
On Thu, Nov 07, 2013 at 03:23:26PM +0800, Chon Ming Lee wrote:
> For DDR data rate reporting by Punit in PUNIT_GPU_FREQ_STS, the actual
> data encoding is 00b=800, 01b=1066, 10b=1333, 11b=1333.
> 
> Some premium VLV sku will get the DDR_DATA_RATE set as 11.  As a result,
> the turbo frequency reporting will be incorrect without this workaround.

Does that mean that the original encoding we used was in fact correct,
and the new one is not?

> 
> Signed-off-by: Chon Ming Lee <chon.ming.lee@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c |    7 +------
>  1 files changed, 1 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index a5778e5..13fb7f8 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -5328,12 +5328,7 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
>  		dev_priv->mem_freq = 1333;
>  		break;
>  	case 3:
> -		/*
> -		 * Probably a BIOS/Punit bug, or a new platform we don't
> -		 * support yet.
> -		 */
> -		WARN(1, "invalid DDR freq detected, assuming 800MHz\n");
> -		dev_priv->mem_freq = 800;
> +		dev_priv->mem_freq = 1333;
>  		break;
>  	}
>  	DRM_DEBUG_DRIVER("DDR speed: %d MHz", dev_priv->mem_freq);
> -- 
> 1.7.7.6
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chon Ming Lee Nov. 7, 2013, 1:49 p.m. UTC | #2
On 11/07 14:46, Ville Syrjälä wrote:
> On Thu, Nov 07, 2013 at 03:23:26PM +0800, Chon Ming Lee wrote:
> > For DDR data rate reporting by Punit in PUNIT_GPU_FREQ_STS, the actual
> > data encoding is 00b=800, 01b=1066, 10b=1333, 11b=1333.
> > 
> > Some premium VLV sku will get the DDR_DATA_RATE set as 11.  As a result,
> > the turbo frequency reporting will be incorrect without this workaround.
> 
> Does that mean that the original encoding we used was in fact correct,
> and the new one is not?
> 

The spec documents the encoding is 00b=800, 01b=1066, 10b=1333, 11b=invalid  

But after check with the punit owner, the 11b is refer to 1333 as well.  It is
not invalid anymore.

> > 
> > Signed-off-by: Chon Ming Lee <chon.ming.lee@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_pm.c |    7 +------
> >  1 files changed, 1 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index a5778e5..13fb7f8 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -5328,12 +5328,7 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
> >  		dev_priv->mem_freq = 1333;
> >  		break;
> >  	case 3:
> > -		/*
> > -		 * Probably a BIOS/Punit bug, or a new platform we don't
> > -		 * support yet.
> > -		 */
> > -		WARN(1, "invalid DDR freq detected, assuming 800MHz\n");
> > -		dev_priv->mem_freq = 800;
> > +		dev_priv->mem_freq = 1333;
> >  		break;
> >  	}
> >  	DRM_DEBUG_DRIVER("DDR speed: %d MHz", dev_priv->mem_freq);
> > -- 
> > 1.7.7.6
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ville Syrjälä
> Intel OTC
Ville Syrjala Nov. 7, 2013, 2:01 p.m. UTC | #3
On Thu, Nov 07, 2013 at 09:49:55PM +0800, Lee, Chon Ming wrote:
> On 11/07 14:46, Ville Syrjälä wrote:
> > On Thu, Nov 07, 2013 at 03:23:26PM +0800, Chon Ming Lee wrote:
> > > For DDR data rate reporting by Punit in PUNIT_GPU_FREQ_STS, the actual
> > > data encoding is 00b=800, 01b=1066, 10b=1333, 11b=1333.
> > > 
> > > Some premium VLV sku will get the DDR_DATA_RATE set as 11.  As a result,
> > > the turbo frequency reporting will be incorrect without this workaround.
> > 
> > Does that mean that the original encoding we used was in fact correct,
> > and the new one is not?
> > 
> 
> The spec documents the encoding is 00b=800, 01b=1066, 10b=1333, 11b=invalid  

There was another encoding in some older spec. And we just changed from
that to the current one.

> 
> But after check with the punit owner, the 11b is refer to 1333 as well.  It is
> not invalid anymore.

OK. In that case:

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> 
> > > 
> > > Signed-off-by: Chon Ming Lee <chon.ming.lee@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/intel_pm.c |    7 +------
> > >  1 files changed, 1 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > > index a5778e5..13fb7f8 100644
> > > --- a/drivers/gpu/drm/i915/intel_pm.c
> > > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > > @@ -5328,12 +5328,7 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
> > >  		dev_priv->mem_freq = 1333;
> > >  		break;
> > >  	case 3:
> > > -		/*
> > > -		 * Probably a BIOS/Punit bug, or a new platform we don't
> > > -		 * support yet.
> > > -		 */
> > > -		WARN(1, "invalid DDR freq detected, assuming 800MHz\n");
> > > -		dev_priv->mem_freq = 800;
> > > +		dev_priv->mem_freq = 1333;
> > >  		break;
> > >  	}
> > >  	DRM_DEBUG_DRIVER("DDR speed: %d MHz", dev_priv->mem_freq);
> > > -- 
> > > 1.7.7.6
> > > 
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > 
> > -- 
> > Ville Syrjälä
> > Intel OTC
Daniel Vetter Nov. 7, 2013, 2:19 p.m. UTC | #4
On Thu, Nov 07, 2013 at 04:01:50PM +0200, Ville Syrjälä wrote:
> On Thu, Nov 07, 2013 at 09:49:55PM +0800, Lee, Chon Ming wrote:
> > On 11/07 14:46, Ville Syrjälä wrote:
> > > On Thu, Nov 07, 2013 at 03:23:26PM +0800, Chon Ming Lee wrote:
> > > > For DDR data rate reporting by Punit in PUNIT_GPU_FREQ_STS, the actual
> > > > data encoding is 00b=800, 01b=1066, 10b=1333, 11b=1333.
> > > > 
> > > > Some premium VLV sku will get the DDR_DATA_RATE set as 11.  As a result,
> > > > the turbo frequency reporting will be incorrect without this workaround.
> > > 
> > > Does that mean that the original encoding we used was in fact correct,
> > > and the new one is not?
> > > 
> > 
> > The spec documents the encoding is 00b=800, 01b=1066, 10b=1333, 11b=invalid  
> 
> There was another encoding in some older spec. And we just changed from
> that to the current one.
> 
> > 
> > But after check with the punit owner, the 11b is refer to 1333 as well.  It is
> > not invalid anymore.
> 
> OK. In that case:
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Queued for -next, thanks for the patch.
-Daniel
Jesse Barnes Nov. 7, 2013, 4:43 p.m. UTC | #5
On Thu, 7 Nov 2013 16:01:50 +0200
Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:

> On Thu, Nov 07, 2013 at 09:49:55PM +0800, Lee, Chon Ming wrote:
> > On 11/07 14:46, Ville Syrjälä wrote:
> > > On Thu, Nov 07, 2013 at 03:23:26PM +0800, Chon Ming Lee wrote:
> > > > For DDR data rate reporting by Punit in PUNIT_GPU_FREQ_STS, the actual
> > > > data encoding is 00b=800, 01b=1066, 10b=1333, 11b=1333.
> > > > 
> > > > Some premium VLV sku will get the DDR_DATA_RATE set as 11.  As a result,
> > > > the turbo frequency reporting will be incorrect without this workaround.
> > > 
> > > Does that mean that the original encoding we used was in fact correct,
> > > and the new one is not?
> > > 
> > 
> > The spec documents the encoding is 00b=800, 01b=1066, 10b=1333, 11b=invalid  
> 
> There was another encoding in some older spec. And we just changed from
> that to the current one.
> 
> > 
> > But after check with the punit owner, the 11b is refer to 1333 as well.  It is
> > not invalid anymore.
> 
> OK. In that case:
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Yeah and just for the record books, the old encoding was listed as 00 =
800, 01=800, 10=1066, 11=1333.  But apparently it's been shifted left,
with 11 staying as 1333.  So Chon Ming's patch looks ok.

I don't understand 2/2 though; was there a Punit HAS or Punit turbo HAS
update we missed?
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index a5778e5..13fb7f8 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5328,12 +5328,7 @@  static void valleyview_init_clock_gating(struct drm_device *dev)
 		dev_priv->mem_freq = 1333;
 		break;
 	case 3:
-		/*
-		 * Probably a BIOS/Punit bug, or a new platform we don't
-		 * support yet.
-		 */
-		WARN(1, "invalid DDR freq detected, assuming 800MHz\n");
-		dev_priv->mem_freq = 800;
+		dev_priv->mem_freq = 1333;
 		break;
 	}
 	DRM_DEBUG_DRIVER("DDR speed: %d MHz", dev_priv->mem_freq);