Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236172 > unrolled thread

Re: [RFC PATCH 03/20] coresight: etm3x: implementing 'cpu_id()' API

Started byAlexander Shishkin <alexander.shishkin@linux.intel.com>
First post2015-09-30 13:20 +0200
Last post2015-10-02 00:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC PATCH 03/20] coresight: etm3x: implementing 'cpu_id()' API Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-09-30 13:20 +0200
    Re: [RFC PATCH 03/20] coresight: etm3x: implementing 'cpu_id()' API Mathieu Poirier <mathieu.poirier@linaro.org> - 2015-10-02 00:50 +0200

#1236172 — Re: [RFC PATCH 03/20] coresight: etm3x: implementing 'cpu_id()' API

FromAlexander Shishkin <alexander.shishkin@linux.intel.com>
Date2015-09-30 13:20 +0200
SubjectRe: [RFC PATCH 03/20] coresight: etm3x: implementing 'cpu_id()' API
Message-ID<qenAt-3ml-3@gated-at.bofh.it>
Mathieu Poirier <mathieu.poirier@linaro.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@linaro.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.

Regards,
--
Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1237810

FromMathieu Poirier <mathieu.poirier@linaro.org>
Date2015-10-02 00:50 +0200
Message-ID<qeUPL-1B8-15@gated-at.bofh.it>
In reply to#1236172
On 30 September 2015 at 05:16, Alexander Shishkin
<alexander.shishkin@linux.intel.com> wrote:
> Mathieu Poirier <mathieu.poirier@linaro.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@linaro.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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web