linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 2/4] ARM: perf: Associate PMU data with driver.
Date: Wed, 6 Aug 2014 14:03:39 +0100	[thread overview]
Message-ID: <20140806130339.GP30282@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20140806105029.GE25953@arm.com>

On Wed, Aug 06, 2014 at 11:50:29AM +0100, Will Deacon wrote:
> On Tue, Aug 05, 2014 at 03:48:35PM +0100, Martin Fuzzey wrote:
> > In order to use the PM hooks for platform specific control we sometimes
> > need access to the PMU driver data.
> > 
> > Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
> > ---
> >  arch/arm/kernel/perf_event_cpu.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
> > index c09e18e..951a542 100644
> > --- a/arch/arm/kernel/perf_event_cpu.c
> > +++ b/arch/arm/kernel/perf_event_cpu.c
> > @@ -311,6 +311,7 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)
> >  
> >  	cpu_pmu = pmu;
> >  	cpu_pmu->plat_device = pdev;
> > +	dev_set_drvdata(&pdev->dev, pmu);
> 
> I'd rather the platform-specific code used its own structures to keep track
> of what it's doing. Exposing the PMU like this is almost certainly going to
> cause us problems later on.

+1 - it's fine for the driver itself to access its private data in the
device struct, but this is not supposed to be a mechanism for passing
stuff between drivers, or indeed code outside of the driver.

A better solution would be a proper API to obtain a reference to this
data - and that must have some side effects to protect against the driver
being unbound at /any/ moment, and therefore must also have an interface
to tell the driver when it can proceed with being unbound.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2014-08-06 13:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05 14:48 [PATCH V2 0/4] ARM: perf: Support i.MX53 Martin Fuzzey
2014-08-05 14:48 ` [PATCH V2 1/4] ARM: perf: Set suniden bit Martin Fuzzey
2014-08-06 10:49   ` Will Deacon
2014-08-06 13:30     ` Martin Fuzzey
2014-08-07 17:33       ` Will Deacon
2016-01-06 14:55         ` [PATCH V3 1/1] " George G. Davis
2016-01-12 17:11           ` Will Deacon
2016-01-14  4:36             ` [PATCH v4 1/1] ARM: perf: Set ARMv7 SDER SUNIDEN bit George G. Davis
2016-01-15  2:50               ` Rob Herring
2016-01-15 17:46               ` Will Deacon
2014-08-05 14:48 ` [PATCH V2 2/4] ARM: perf: Associate PMU data with driver Martin Fuzzey
2014-08-06 10:50   ` Will Deacon
2014-08-06 13:03     ` Russell King - ARM Linux [this message]
2014-08-05 14:48 ` [PATCH V2 3/4] ARM: i.MX53: Add Soc specific PMU setup Martin Fuzzey
2014-08-05 14:48 ` [PATCH V2 4/4] ARM: dts: i.MX53: Add PMU DT entry Martin Fuzzey
2014-08-06 10:50   ` Will Deacon
2014-08-06 13:35     ` Martin Fuzzey
2014-08-07  5:53       ` Shawn Guo
2014-08-07  8:00         ` Martin Fuzzey
2014-08-07  8:54           ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140806130339.GP30282@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).