Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Suzuki.Poulose@arm.com (Suzuki K Poulose)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] coresight: tmc: fix for trace collection bug in sysFS mode
Date: Wed, 14 Sep 2016 13:26:07 +0100	[thread overview]
Message-ID: <c866fcbf-afac-4f7b-acb5-e4a0c054a392@arm.com> (raw)
In-Reply-To: <CAGhh56GQmKnk5UaYYW-X1YpsPdb7SwCy1b5ANd3tmdAXBTBbZA@mail.gmail.com>

On 14/09/16 12:30, Venkatesh Vivekanandan wrote:
>
>
> On Wed, Sep 14, 2016 at 3:26 PM, Suzuki K Poulose <Suzuki.Poulose at arm.com <mailto:Suzuki.Poulose@arm.com>> wrote:
>
>     On 13/09/16 16:41, Mathieu Poirier wrote:
>
>         On 13 September 2016 at 06:20, Venkatesh Vivekanandan
>         <venkatesh.vivekanandan at broadcom.com <mailto:venkatesh.vivekanandan@broadcom.com>> wrote:
>
>             tmc_etb_dump_hw is never called in sysFS mode to collect trace from
>             hardware, because drvdata->mode is set to CS_MODE_DISABLED at
>             tmc_disable_etf/etr_sink
>
>             static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata)
>             {
>                     .
>                     .
>                     if (local_read(&drvdata->mode) == CS_MODE_SYSFS)
>                             tmc_etb_dump_hw(drvdata);
>                     .
>                     .
>             }
>
>             static void tmc_disable_etf_sink(struct coresight_device *csdev)
>             {
>                    .
>                    .
>                     val = local_xchg(&drvdata->mode, CS_MODE_DISABLED);
>                     /* Disable the TMC only if it needs to */
>                     if (val != CS_MODE_DISABLED)
>                             tmc_etb_disable_hw(drvdata);
>
>
>         You are correct.
>
>                    .
>                    .
>             }
>
  
>     I think we should :
>
>     1) First switch the drvdata->mode to a normal type from local_t. Using an
>     atomic type for mode is completely unnecessary and comes with the overhead
>     of barriers/synchronisation instructions, while all accesses, including read/write
>     are performed under the drvdata->spinlock. I have a patch already for this, which
>     I plan to send it soon.
>
>     and
>
>     2) Do something like :
>
>     void  tmc_disable_etX_sink()
>     {
>             if (drvdata->mode != CS_MODE_DISABLED) {
>                     tmc_etX_disable_hw(drvdata);
>                     drvdata->mode = CS_MODE_DISABLED;
>             }
>     }
>
> You will fix this along with above changes?

Yes.

nit: Please fix your mail client. Do not use HTML formatted emails on mailing list

Cheers
Suzuki

      parent reply	other threads:[~2016-09-14 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 12:20 [PATCH] coresight: tmc: fix for trace collection bug in sysFS mode Venkatesh Vivekanandan
2016-09-13 15:41 ` Mathieu Poirier
2016-09-14  9:56   ` Suzuki K Poulose
     [not found]     ` <CAGhh56GQmKnk5UaYYW-X1YpsPdb7SwCy1b5ANd3tmdAXBTBbZA@mail.gmail.com>
2016-09-14 12:26       ` Suzuki K Poulose [this message]

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=c866fcbf-afac-4f7b-acb5-e4a0c054a392@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