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


Groups > linux.kernel > #1236200 > unrolled thread

Re: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default arch init

Started byAlexander Shishkin <alexander.shishkin@linux.intel.com>
First post2015-09-30 13:40 +0200
Last post2015-10-02 19:20 +0200
Articles 4 — 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 06/20] coresight: etm3x: unlocking tracer in default arch init Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-09-30 13:40 +0200
    Re: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default  arch init Mathieu Poirier <mathieu.poirier@linaro.org> - 2015-10-02 00:50 +0200
      Re: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default arch init Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-10-02 06:50 +0200
        Re: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default  arch init Mathieu Poirier <mathieu.poirier@linaro.org> - 2015-10-02 19:20 +0200

#1236200 — Re: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default arch init

FromAlexander Shishkin <alexander.shishkin@linux.intel.com>
Date2015-09-30 13:40 +0200
SubjectRe: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default arch init
Message-ID<qenTQ-3J6-29@gated-at.bofh.it>
Mathieu Poirier <mathieu.poirier@linaro.org> writes:

> Calling function 'smp_call_function_single()' to unlock the
> tracer and calling it right after to perform the default
> initialisation doesn't make sense.
>
> Moving 'etm_os_unlock()' just before making the default
> initialisation results in the same outcome while saving
> one call to 'smp_call_function_single()'.
>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
>  drivers/hwtracing/coresight/coresight-etm3x.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
> index c6880c1ade55..a4c158df0fef 100644
> --- a/drivers/hwtracing/coresight/coresight-etm3x.c
> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c
> @@ -1867,6 +1867,11 @@ static void etm_init_arch_data(void *info)
>  	 * certain registers might be ignored.
>  	 */
>  	etm_clr_pwrdwn(drvdata);
> +
> +	/* Make sure all registers are accessible */
> +	etm_os_unlock(drvdata);

In case of co-processor register access, this will end up unlocking the
local ETM instead of the one on target cpu, by the looks of it. That's
why smp_function_call() was needed there. Or you might want a
etm_read_on_cpu() variant if it's really worth it.

> +	drvdata->os_unlock = true;
> +
>  	/*
>  	 * Set prog bit. It will be set from reset but this is included to
>  	 * ensure it is set
> @@ -1961,9 +1966,6 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id)
>  	get_online_cpus();
>  	etmdrvdata[drvdata->cpu] = drvdata;
>  
> -	if (!smp_call_function_single(drvdata->cpu, etm_os_unlock, drvdata, 1))
> -		drvdata->os_unlock = true;
> -
>  	if (smp_call_function_single(drvdata->cpu,
>  				     etm_init_arch_data,  drvdata, 1))
>  		dev_err(dev, "ETM arch init failed\n");
> -- 
> 1.9.1

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]


#1237812 — Re: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default arch init

FromMathieu Poirier <mathieu.poirier@linaro.org>
Date2015-10-02 00:50 +0200
SubjectRe: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default arch init
Message-ID<qeUPM-1B8-29@gated-at.bofh.it>
In reply to#1236200
On 30 September 2015 at 05:33, Alexander Shishkin
<alexander.shishkin@linux.intel.com> wrote:
> Mathieu Poirier <mathieu.poirier@linaro.org> writes:
>
>> Calling function 'smp_call_function_single()' to unlock the
>> tracer and calling it right after to perform the default
>> initialisation doesn't make sense.
>>
>> Moving 'etm_os_unlock()' just before making the default
>> initialisation results in the same outcome while saving
>> one call to 'smp_call_function_single()'.
>>
>> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>> ---
>>  drivers/hwtracing/coresight/coresight-etm3x.c | 8 +++++---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
>> index c6880c1ade55..a4c158df0fef 100644
>> --- a/drivers/hwtracing/coresight/coresight-etm3x.c
>> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c
>> @@ -1867,6 +1867,11 @@ static void etm_init_arch_data(void *info)
>>        * certain registers might be ignored.
>>        */
>>       etm_clr_pwrdwn(drvdata);
>> +
>> +     /* Make sure all registers are accessible */
>> +     etm_os_unlock(drvdata);
>
> In case of co-processor register access, this will end up unlocking the
> local ETM instead of the one on target cpu, by the looks of it.

"etm_init_arch_data()" is also called from "smp_function_calls()" and
as such, will end up executing the correct CPU.

> That's
> why smp_function_call() was needed there. Or you might want a
> etm_read_on_cpu() variant if it's really worth it.
>
>> +     drvdata->os_unlock = true;
>> +
>>       /*
>>        * Set prog bit. It will be set from reset but this is included to
>>        * ensure it is set
>> @@ -1961,9 +1966,6 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id)
>>       get_online_cpus();
>>       etmdrvdata[drvdata->cpu] = drvdata;
>>
>> -     if (!smp_call_function_single(drvdata->cpu, etm_os_unlock, drvdata, 1))
>> -             drvdata->os_unlock = true;
>> -
>>       if (smp_call_function_single(drvdata->cpu,
>>                                    etm_init_arch_data,  drvdata, 1))
>>               dev_err(dev, "ETM arch init failed\n");
>> --
>> 1.9.1
>
> 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] | [next] | [standalone]


#1237896

FromAlexander Shishkin <alexander.shishkin@linux.intel.com>
Date2015-10-02 06:50 +0200
Message-ID<qf0s9-1j3-7@gated-at.bofh.it>
In reply to#1237812
Mathieu Poirier <mathieu.poirier@linaro.org> writes:

> On 30 September 2015 at 05:33, Alexander Shishkin
> <alexander.shishkin@linux.intel.com> wrote:
>> Mathieu Poirier <mathieu.poirier@linaro.org> writes:
>>
>>> Calling function 'smp_call_function_single()' to unlock the
>>> tracer and calling it right after to perform the default
>>> initialisation doesn't make sense.
>>>
>>> Moving 'etm_os_unlock()' just before making the default
>>> initialisation results in the same outcome while saving
>>> one call to 'smp_call_function_single()'.
>>>
>>> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>>> ---
>>>  drivers/hwtracing/coresight/coresight-etm3x.c | 8 +++++---
>>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
>>> index c6880c1ade55..a4c158df0fef 100644
>>> --- a/drivers/hwtracing/coresight/coresight-etm3x.c
>>> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c
>>> @@ -1867,6 +1867,11 @@ static void etm_init_arch_data(void *info)
>>>        * certain registers might be ignored.
>>>        */
>>>       etm_clr_pwrdwn(drvdata);
>>> +
>>> +     /* Make sure all registers are accessible */
>>> +     etm_os_unlock(drvdata);
>>
>> In case of co-processor register access, this will end up unlocking the
>> local ETM instead of the one on target cpu, by the looks of it.
>
> "etm_init_arch_data()" is also called from "smp_function_calls()" and
> as such, will end up executing the correct CPU.

Yes, but it doesn't unlock the OSLAR register, which also needs to be
done on target cpu.

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] | [next] | [standalone]


#1238428 — Re: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default arch init

FromMathieu Poirier <mathieu.poirier@linaro.org>
Date2015-10-02 19:20 +0200
SubjectRe: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default arch init
Message-ID<qfc9X-1mW-15@gated-at.bofh.it>
In reply to#1237896
On 1 October 2015 at 22:47, Alexander Shishkin
<alexander.shishkin@linux.intel.com> wrote:
> Mathieu Poirier <mathieu.poirier@linaro.org> writes:
>
>> On 30 September 2015 at 05:33, Alexander Shishkin
>> <alexander.shishkin@linux.intel.com> wrote:
>>> Mathieu Poirier <mathieu.poirier@linaro.org> writes:
>>>
>>>> Calling function 'smp_call_function_single()' to unlock the
>>>> tracer and calling it right after to perform the default
>>>> initialisation doesn't make sense.
>>>>
>>>> Moving 'etm_os_unlock()' just before making the default
>>>> initialisation results in the same outcome while saving
>>>> one call to 'smp_call_function_single()'.
>>>>
>>>> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>>>> ---
>>>>  drivers/hwtracing/coresight/coresight-etm3x.c | 8 +++++---
>>>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
>>>> index c6880c1ade55..a4c158df0fef 100644
>>>> --- a/drivers/hwtracing/coresight/coresight-etm3x.c
>>>> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c
>>>> @@ -1867,6 +1867,11 @@ static void etm_init_arch_data(void *info)
>>>>        * certain registers might be ignored.
>>>>        */
>>>>       etm_clr_pwrdwn(drvdata);
>>>> +
>>>> +     /* Make sure all registers are accessible */
>>>> +     etm_os_unlock(drvdata);
>>>
>>> In case of co-processor register access, this will end up unlocking the
>>> local ETM instead of the one on target cpu, by the looks of it.
>>
>> "etm_init_arch_data()" is also called from "smp_function_calls()" and
>> as such, will end up executing the correct CPU.
>
> Yes, but it doesn't unlock the OSLAR register, which also needs to be
> done on target cpu.

Function "etm_os_unlock()" deals with ETMOSLAR and "CS_UNLOCK()" with
ETMLAR.  Both are called from "etm_init_arch_data()", which runs on
the target CPU.  One thing that I will do here is move
"etm_os_unlock()" to the beginning of "etm_init_arch_data()".  Other
than that I may be missing your point.

>
> 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