[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANLsYkwbLMJ3VBX3SoymcJjayGHJRji4K7zutwq6_=yU3LoeNg@mail.gmail.com>
Date: Thu, 1 Oct 2015 16:43:35 -0600
From: Mathieu Poirier <mathieu.poirier@...aro.org>
To: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Greg KH <gregkh@...uxfoundation.org>, a.p.zijlstra@...llo.nl,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...hat.com>, Jon Corbet <corbet@....net>,
Adrian Hunter <adrian.hunter@...el.com>,
Chunyan Zhang <zhang.chunyan@...aro.org>,
Mike Leach <mike.leach@....com>, Tor Jeremiassen <tor@...com>,
Al Grant <al.grant@....com>,
Paweł Moll <pawel.moll@....com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, linux-doc@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 03/20] coresight: etm3x: implementing 'cpu_id()' API
On 30 September 2015 at 05:16, Alexander Shishkin
<alexander.shishkin@...ux.intel.com> wrote:
> Mathieu Poirier <mathieu.poirier@...aro.org> writes:
>
>> Adding an interface to lookup the CPU a tracer has been affined
>> to along with a source operation allowing external customers to
>> access it.
>>
>> Signed-off-by: Mathieu Poirier <mathieu.poirier@...aro.org>
>> ---
>> drivers/hwtracing/coresight/coresight-etm3x.c | 14 ++++++++++++++
>> include/linux/coresight.h | 3 +++
>> 2 files changed, 17 insertions(+)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
>> index a44bc3532585..4ce9cfc06e93 100644
>> --- a/drivers/hwtracing/coresight/coresight-etm3x.c
>> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c
>> @@ -441,6 +441,19 @@ static void etm_config_enable(void *info)
>> spin_unlock(&drvdata->spinlock);
>> }
>>
>> +static int etm_cpu_id(struct coresight_device *csdev)
>> +{
>> + int cpu;
>> + unsigned long flags;
>> + struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
>> +
>> + spin_lock_irqsave(&drvdata->spinlock, flags);
>> + cpu = drvdata->cpu;
>> + spin_unlock_irqrestore(&drvdata->spinlock, flags);
>
> Why do you need a spinlock here? Afaict, it never changes and if it
> would, things would go really bad really fast.
You are correct.
>
> Regards,
> --
> Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists