linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: suzuki.poulose@arm.com (Suzuki K Poulose)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/4] coresight: etm3x: Deal with CLAIM tag before and after accessing HW
Date: Fri, 9 Nov 2018 18:06:11 +0000	[thread overview]
Message-ID: <0928085c-cf9c-5437-2806-1b027ea428ff@arm.com> (raw)
In-Reply-To: <CANLsYkxbzk3=uA0Tx6HNNoXGBnDUPAhgnWZM9Q7jqLSzBhDr-g@mail.gmail.com>

On 11/09/2018 05:59 PM, Mathieu Poirier wrote:
> On Thu, 8 Nov 2018 at 10:13, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>>
>> Hi,
>>
>> On 07/11/2018 23:08, Mathieu Poirier wrote:
>>> This patch moves access to the CLAIM tag so that no modification to the HW
>>> happens before and after the CLAIM operation has been carried.
>>>
>>> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>>> ---
>>>    drivers/hwtracing/coresight/coresight-etm3x.c | 16 ++++++++--------
>>>    1 file changed, 8 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
>>> index fd5c4cca7db5..4f638d81a66a 100644
>>> --- a/drivers/hwtracing/coresight/coresight-etm3x.c
>>> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c
>>> @@ -363,15 +363,16 @@ static int etm_enable_hw(struct etm_drvdata *drvdata)
>>>
>>>        CS_UNLOCK(drvdata->base);
>>>
>>> +     rc = coresight_claim_device_unlocked(drvdata->base);
>>> +     if (rc)
>>> +             goto done;
>>> +
>>>        /* Turn engine on */
>>>        etm_clr_pwrdwn(drvdata);
>>>        /* Apply power to trace registers */
>>>        etm_set_pwrup(drvdata);
>>>        /* Make sure all registers are accessible */
>>>        etm_os_unlock(drvdata);
>>> -     rc = coresight_claim_device_unlocked(drvdata->base);
>>> -     if (rc)
>>> -             goto done;
>>>
>>>        etm_set_prog(drvdata);
>>>
>>> @@ -422,12 +423,11 @@ static int etm_enable_hw(struct etm_drvdata *drvdata)
>>>        etm_clr_prog(drvdata);
>>>
>>>    done:
>>> -     if (rc)
>>> -             etm_set_pwrdwn(drvdata);
>>>        CS_LOCK(drvdata->base);
>>>
>>> -     dev_dbg(drvdata->dev, "cpu: %d enable smp call done: %d\n",
>>> -             drvdata->cpu, rc);
>>> +     if (!rc)
>>> +             dev_dbg(drvdata->dev, "cpu: %d enable smp call done: %d\n",
>>> +                     drvdata->cpu, rc);
>>
>> Isn't it good to report the failure case too ? Anyway it is dev_dbg and
>> will be a useful info when we debug issues. Otherwise,
> 
> Simply removing the "if (!rc)" will do the trick.  Can I do the
> modification and add your tag or you prefer to see another revision?

I am fine with that change folded in, no need to respin it.

> 
>>
>> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>


Cheers
Suzuki


>>
>>>        return rc;
>>>    }
>>>
>>> @@ -577,9 +577,9 @@ static void etm_disable_hw(void *info)
>>>        for (i = 0; i < drvdata->nr_cntr; i++)
>>>                config->cntr_val[i] = etm_readl(drvdata, ETMCNTVRn(i));
>>>
>>> +     etm_set_pwrdwn(drvdata);
>>>        coresight_disclaim_device_unlocked(drvdata->base);
>>>
>>> -     etm_set_pwrdwn(drvdata);
>>>        CS_LOCK(drvdata->base);
>>>
>>>        dev_dbg(drvdata->dev, "cpu: %d disable smp call done\n", drvdata->cpu);
>>>
>>

  reply	other threads:[~2018-11-09 18:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 23:08 [PATCH v2 0/4] coresight: Fix miscellaneous problems with CLAIM tags Mathieu Poirier
2018-11-07 23:08 ` [PATCH v2 1/4] coresight: etb10: Add support for CLAIM tag Mathieu Poirier
2018-11-07 23:08 ` [PATCH v2 2/4] coresight: etf: Release CLAIM tag after disabling the HW Mathieu Poirier
2018-11-07 23:08 ` [PATCH v2 3/4] coresight: etm3x: Deal with CLAIM tag before and after accessing HW Mathieu Poirier
2018-11-08 17:13   ` Suzuki K Poulose
2018-11-09 17:59     ` Mathieu Poirier
2018-11-09 18:06       ` Suzuki K Poulose [this message]
2018-11-07 23:08 ` [PATCH v2 4/4] coresight: etm3x: Release CLAIM tag when operated from perf Mathieu Poirier
2018-11-08 17:28   ` Suzuki K Poulose

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=0928085c-cf9c-5437-2806-1b027ea428ff@arm.com \
    --to=suzuki.poulose@arm.com \
    --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).