lkml.org 
[lkml]   [2018]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v3 2/3] perf: add arm64 smmuv3 pmu driver
Date


> -----Original Message-----
> From: Robin Murphy [mailto:robin.murphy@arm.com]
> Sent: 03 October 2018 11:37
> To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>;
> lorenzo.pieralisi@arm.com
> Cc: will.deacon@arm.com; mark.rutland@arm.com; Guohanjun (Hanjun Guo)
> <guohanjun@huawei.com>; John Garry <john.garry@huawei.com>;
> pabba@codeaurora.org; vkilari@codeaurora.org; rruigrok@codeaurora.org;
> linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; Linuxarm <linuxarm@huawei.com>;
> neil.m.leeder@gmail.com
> Subject: Re: [PATCH v3 2/3] perf: add arm64 smmuv3 pmu driver
>
> On 21/09/18 16:08, Shameer Kolothum wrote:
> [...]
> > +
> > + err = cpuhp_state_add_instance_nocalls(cpuhp_state_num,
> > + &smmu_pmu->node);
>
> In theory a hotplug event could happen as soon as the instance is
> registered...
>
> > + if (err) {
> > + dev_err(dev, "Error %d registering hotplug, PMU @%pa\n",
> > + err, &res_0->start);
> > + return err;
> > + }
> > +
> > + /* Pick one CPU to be the preferred one to use */
> > + smmu_pmu->on_cpu = get_cpu();
>
> ...so this looks too late, i.e. a race here can result in a bogus call
> to perf_pmu_migrate_context() with an uninitialised pmu.

Thanks Robin. I will reorder them.

Shameer

> Robin.
> > + WARN_ON(irq_set_affinity(smmu_pmu->irq, cpumask_of(smmu_pmu-
> >on_cpu)));
> > +
> > + err = perf_pmu_register(&smmu_pmu->pmu, name, -1);
> > + if (err) {
> > + dev_err(dev, "Error %d registering PMU @%pa\n",
> > + err, &res_0->start);
> > + goto out_unregister;
> > + }
> > +
> > + put_cpu();
\
 
 \ /
  Last update: 2018-10-03 13:29    [W:0.150 / U:1.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site