[PATCHv3] arm: l2x0: add PMU support

Mark Rutland mark.rutland at arm.com
Tue Aug 30 05:47:09 PDT 2016


On Tue, Aug 30, 2016 at 12:12:22PM +0100, Russell King - ARM Linux wrote:
> On Tue, Aug 30, 2016 at 11:16:18AM +0100, Mark Rutland wrote:
> > The L2C-220 (AKA L220) and L2C-310 (AKA PL310) cache controllers feature
> > a Performance Monitoring Unit (PMU), which can be useful for tuning
> > and/or debugging. This hardware is always present and the relevant
> > registers are accessible to non-secure accesses. Thus, no special
> > firmware interface is necessary.
> > 
> > This patch adds support for the PMU, plugging into the usual perf
> > infrastructure. The overflow interrupt is not always available (e.g. on
> > RealView PBX A9 it is not wired up at all), and the hardware counters
> > saturate, so the driver does not make use of this. Instead, the driver
> > periodically polls and reset counters as required to avoid losing
> > events due to saturation.
> ...
> > +	/*
> > +	 * Choose the name to identify the PMU under sysfs. This is also used
> > +	 * by l2x0_pmu_event_attr_is_visible to determine which events to
> > +	 * display, as the PL310 PMU supports a superset of L220 events.
> > +	 *
> > +	 * The L210 PMU has a different programmer's interface, and is not
> > +	 * supported by this driver.
> 
> This rather worries me a bit - if the L2C-210 needs a different driver,
> should we be putting this driver in this file, or should we be keeping
> it as a separate file?  What if L2C-210 grows a PMU driver which is
> also tacked on the end of the file - it seems to me that this is rather
> unwieldy.
> 
> My feeling is that we've already enough random bits tacked into this
> file supporting all the L2C-210 related variants.

Sure. I'll see about factoring the PMU parts out into a separate file,
modulo a couple of hooks for suspend/resume and init.

Thanks,
Mark.



More information about the linux-arm-kernel mailing list