diff mbox

[3/3] platform/x86: Add Audio domain PG status events

Message ID 1500033228-634-3-git-send-email-rajneesh.bhardwaj@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Andy Shevchenko
Headers show

Commit Message

Rajneesh Bhardwaj July 14, 2017, 11:53 a.m. UTC
From: "Murthy, Shanth" <shanth.murthy@intel.com>

This patch adds events to ioss telemetry to read the power gating status
for the audio domain.

Signed-off-by: Shanth Murthy <shanth.murthy@intel.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
---
 arch/x86/include/asm/intel_telemetry.h        | 2 +-
 drivers/platform/x86/intel_telemetry_pltdrv.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Chakravarty, Souvik K July 17, 2017, 5:18 a.m. UTC | #1
> -----Original Message-----
> From: Bhardwaj, Rajneesh
> Sent: Friday, July 14, 2017 5:24 PM
> To: platform-driver-x86@vger.kernel.org
> Cc: dvhart@infradead.org; andy@infradead.org; linux-
> kernel@vger.kernel.org; Murthy, Shanth <shanth.murthy@intel.com>;
> Chakravarty, Souvik K <souvik.k.chakravarty@intel.com>; Bhardwaj,
> Rajneesh <rajneesh.bhardwaj@intel.com>
> Subject: [PATCH 3/3] platform/x86: Add Audio domain PG status events
> 
> From: "Murthy, Shanth" <shanth.murthy@intel.com>
> 
> This patch adds events to ioss telemetry to read the power gating status for
> the audio domain.
> 
> Signed-off-by: Shanth Murthy <shanth.murthy@intel.com>
> Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
> ---
>  arch/x86/include/asm/intel_telemetry.h        | 2 +-
>  drivers/platform/x86/intel_telemetry_pltdrv.c | 6 ++++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/intel_telemetry.h
> b/arch/x86/include/asm/intel_telemetry.h
> index 85029b58d0cd..4eeae0a4f9a2 100644
> --- a/arch/x86/include/asm/intel_telemetry.h
> +++ b/arch/x86/include/asm/intel_telemetry.h
> @@ -17,7 +17,7 @@
>  #define INTEL_TELEMETRY_H
> 
>  #define TELEM_MAX_EVENTS_SRAM		28
> -#define TELEM_MAX_OS_ALLOCATED_EVENTS	20
> +#define TELEM_MAX_OS_ALLOCATED_EVENTS	25

This is something that should not be done without testing. There was an understanding to not use more than 20 counters in OS, so that tools like SoCWatch could use the rest 8 without total reconfiguration of the events. With this change we are not leaving much for tools and it may break SoCwatch/IMON or other tools dependent on using just 8. 
The better way for this would be for the userspace tool to configure the extra 5 events via add_config() call and not increase the OS usage ceiling.

Or you could add some more sysfs apis for get/set events and do it via a daemon/script.

<snip>....
Rajneesh Bhardwaj July 19, 2017, 1:38 p.m. UTC | #2
On Mon, Jul 17, 2017 at 10:48:30AM +0530, Chakravarty, Souvik K wrote:
> 
> 
> > -----Original Message-----
> > From: Bhardwaj, Rajneesh
> > Sent: Friday, July 14, 2017 5:24 PM
> > To: platform-driver-x86@vger.kernel.org
> > Cc: dvhart@infradead.org; andy@infradead.org; linux-
> > kernel@vger.kernel.org; Murthy, Shanth <shanth.murthy@intel.com>;
> > Chakravarty, Souvik K <souvik.k.chakravarty@intel.com>; Bhardwaj,
> > Rajneesh <rajneesh.bhardwaj@intel.com>
> > Subject: [PATCH 3/3] platform/x86: Add Audio domain PG status events
> > 
> > From: "Murthy, Shanth" <shanth.murthy@intel.com>
> > 
> > This patch adds events to ioss telemetry to read the power gating status for
> > the audio domain.
> > 
> > Signed-off-by: Shanth Murthy <shanth.murthy@intel.com>
> > Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
> > ---
> >  arch/x86/include/asm/intel_telemetry.h        | 2 +-
> >  drivers/platform/x86/intel_telemetry_pltdrv.c | 6 ++++++
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/x86/include/asm/intel_telemetry.h
> > b/arch/x86/include/asm/intel_telemetry.h
> > index 85029b58d0cd..4eeae0a4f9a2 100644
> > --- a/arch/x86/include/asm/intel_telemetry.h
> > +++ b/arch/x86/include/asm/intel_telemetry.h
> > @@ -17,7 +17,7 @@
> >  #define INTEL_TELEMETRY_H
> > 
> >  #define TELEM_MAX_EVENTS_SRAM		28
> > -#define TELEM_MAX_OS_ALLOCATED_EVENTS	20
> > +#define TELEM_MAX_OS_ALLOCATED_EVENTS	25
> 
> This is something that should not be done without testing. There was an understanding to not use more than 20 counters in OS, so that tools like SoCWatch could use the rest 8 without total reconfiguration of the events. With this change we are not leaving much for tools and it may break SoCwatch/IMON or other tools dependent on using just 8. 
> The better way for this would be for the userspace tool to configure the extra 5 events via add_config() call and not increase the OS usage ceiling.
> 
> Or you could add some more sysfs apis for get/set events and do it via a daemon/script.
> 
> <snip>....

Thanks for the review and the feedback Souvik. Ideally user space tools
should not put a restriction such as this one. It would be good to document
such details.

Is there a plan to support more than 20 events in telemetry driver? If not
then we can probably think of removing few events and add audio related
events maintaining total count of 20?

For now i will respin the patches and drop this one.
Chakravarty, Souvik K July 20, 2017, 4:06 a.m. UTC | #3
> -----Original Message-----
> From: Bhardwaj, Rajneesh
> Sent: Wednesday, July 19, 2017 7:08 PM
> To: Chakravarty, Souvik K <souvik.k.chakravarty@intel.com>
> Cc: platform-driver-x86@vger.kernel.org; dvhart@infradead.org;
> andy@infradead.org; linux-kernel@vger.kernel.org; Murthy, Shanth
> <shanth.murthy@intel.com>
> Subject: Re: [PATCH 3/3] platform/x86: Add Audio domain PG status events
> 
> On Mon, Jul 17, 2017 at 10:48:30AM +0530, Chakravarty, Souvik K wrote:
> >
> >
> > > -----Original Message-----
> > > From: Bhardwaj, Rajneesh
> > > Sent: Friday, July 14, 2017 5:24 PM
> > > To: platform-driver-x86@vger.kernel.org
> > > Cc: dvhart@infradead.org; andy@infradead.org; linux-
> > > kernel@vger.kernel.org; Murthy, Shanth <shanth.murthy@intel.com>;
> > > Chakravarty, Souvik K <souvik.k.chakravarty@intel.com>; Bhardwaj,
> > > Rajneesh <rajneesh.bhardwaj@intel.com>
> > > Subject: [PATCH 3/3] platform/x86: Add Audio domain PG status events
> > >
> > > From: "Murthy, Shanth" <shanth.murthy@intel.com>
> > >
> > > This patch adds events to ioss telemetry to read the power gating
> > > status for the audio domain.
> > >
> > > Signed-off-by: Shanth Murthy <shanth.murthy@intel.com>
> > > Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
> > > ---
> > >  arch/x86/include/asm/intel_telemetry.h        | 2 +-
> > >  drivers/platform/x86/intel_telemetry_pltdrv.c | 6 ++++++
> > >  2 files changed, 7 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/arch/x86/include/asm/intel_telemetry.h
> > > b/arch/x86/include/asm/intel_telemetry.h
> > > index 85029b58d0cd..4eeae0a4f9a2 100644
> > > --- a/arch/x86/include/asm/intel_telemetry.h
> > > +++ b/arch/x86/include/asm/intel_telemetry.h
> > > @@ -17,7 +17,7 @@
> > >  #define INTEL_TELEMETRY_H
> > >
> > >  #define TELEM_MAX_EVENTS_SRAM		28
> > > -#define TELEM_MAX_OS_ALLOCATED_EVENTS	20
> > > +#define TELEM_MAX_OS_ALLOCATED_EVENTS	25
> >
> > This is something that should not be done without testing. There was an
> understanding to not use more than 20 counters in OS, so that tools like
> SoCWatch could use the rest 8 without total reconfiguration of the events.
> With this change we are not leaving much for tools and it may break
> SoCwatch/IMON or other tools dependent on using just 8.
> > The better way for this would be for the userspace tool to configure the
> extra 5 events via add_config() call and not increase the OS usage ceiling.
> >
> > Or you could add some more sysfs apis for get/set events and do it via a
> daemon/script.
> >
> > <snip>....
> 
> Thanks for the review and the feedback Souvik. Ideally user space tools
> should not put a restriction such as this one. It would be good to document
> such details.
Theoretically yes. But many of the tools have no maintaince budget/owner. 

> 
> Is there a plan to support more than 20 events in telemetry driver? If not
> then we can probably think of removing few events and add audio related
> events maintaining total count of 20?

Sure...why not.

> 
> For now i will respin the patches and drop this one.

Thanks. 
I will also add support for an 'add' sysfs entry so that you can configure it easily and not have to fiddle with the default set.

> 
> --
> Best Regards,
> Rajneesh
diff mbox

Patch

diff --git a/arch/x86/include/asm/intel_telemetry.h b/arch/x86/include/asm/intel_telemetry.h
index 85029b58d0cd..4eeae0a4f9a2 100644
--- a/arch/x86/include/asm/intel_telemetry.h
+++ b/arch/x86/include/asm/intel_telemetry.h
@@ -17,7 +17,7 @@ 
 #define INTEL_TELEMETRY_H
 
 #define TELEM_MAX_EVENTS_SRAM		28
-#define TELEM_MAX_OS_ALLOCATED_EVENTS	20
+#define TELEM_MAX_OS_ALLOCATED_EVENTS	25
 
 enum telemetry_unit {
 	TELEM_PSS = 0,
diff --git a/drivers/platform/x86/intel_telemetry_pltdrv.c b/drivers/platform/x86/intel_telemetry_pltdrv.c
index e0424d5a795a..9ec437442deb 100644
--- a/drivers/platform/x86/intel_telemetry_pltdrv.c
+++ b/drivers/platform/x86/intel_telemetry_pltdrv.c
@@ -125,6 +125,12 @@  static struct telemetry_evtmap
 	{"PMC_S0IX_BLOCKING_MISC_IPS_PG",       0x6008},
 	{"PMC_S0IX_BLOCK_IPS_VNN_REQ",          0x6009},
 	{"PMC_S0IX_BLOCK_IPS_CLOCKS",           0x600B},
+	{"AVSPGD1_IP_POWER_GATED_FW_COUNTER",	0x388D},
+	{"AVSPGD2_IP_POWER_GATED_FW_COUNTER",	0x388C},
+	{"AVSPGD3_IP_POWER_GATED_FW_COUNTER",	0x388B},
+	{"AVSPGD4_IP_POWER_GATED_FW_COUNTER",	0x388A},
+	{"AUDIO_VNN_REQ_MISC_COUNTER",		0x182B},
+
 };