public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Linu Cherian <linuc.decode@gmail.com>
Cc: Sasha Levin <sashal@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Coresight ML <coresight@lists.linaro.org>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Linu Cherian <lcherian@marvell.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH AUTOSEL 5.9 075/147] coresight: Make sysfs functional on topologies with per core sink
Date: Mon, 2 Nov 2020 10:29:31 -0700	[thread overview]
Message-ID: <20201102172931.GC2749502@xps15> (raw)
In-Reply-To: <CAAHhmWjcP-3oAdhr2Nh_+QGbOi59PVDg763_avKgxFqjiYqMzQ@mail.gmail.com>

On Mon, Nov 02, 2020 at 12:29:34PM +0530, Linu Cherian wrote:
> Hi,
> 
> Upstream commit,
> 
> commit bb1860efc817c18fce4112f25f51043e44346d1b
> Author: Linu Cherian <lcherian@marvell.com>
> Date:   Wed Sep 16 13:17:34 2020 -0600
> 
> 
> 
> 
> coresight: etm: perf: Sink selection using sysfs is deprecated
> 
> 
> need to go along with this, else there will be build breakage.
> This applies for 5.4, 5.8 and 5.9
> 
> Mathieu, could you please ACK ?

Top posting makes it very difficult to follow what is going on.

Based on your above comment Sasha has probably dropped this patch.  The best way
to proceed is likely to send a patchset to stable with all the required
patches.

Thanks,
Mathieu

> 
> Please let me know if i need to send the patch to
> stable@vger.kernel.org separately.
> Thanks.
> 
> 
> 
> 
> On Tue, Oct 27, 2020 at 5:20 AM Sasha Levin <sashal@kernel.org> wrote:
> >
> > From: Linu Cherian <lcherian@marvell.com>
> >
> > [ Upstream commit 6d578258b955fc8888e1bbd9a8fefe7b10065a84 ]
> >
> > Coresight driver assumes sink is common across all the ETMs,
> > and tries to build a path between ETM and the first enabled
> > sink found using bus based search. This breaks sysFS usage
> > on implementations that has multiple per core sinks in
> > enabled state.
> >
> > To fix this, coresight_get_enabled_sink API is updated to
> > do a connection based search starting from the given source,
> > instead of bus based search.
> > With sink selection using sysfs depecrated for perf interface,
> > provision for reset is removed as well in this API.
> >
> > Signed-off-by: Linu Cherian <lcherian@marvell.com>
> > [Fixed indentation problem and removed obsolete comment]
> > Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> > Link: https://lore.kernel.org/r/20200916191737.4001561-15-mathieu.poirier@linaro.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Sasha Levin <sashal@kernel.org>
> > ---
> >  drivers/hwtracing/coresight/coresight-priv.h |  3 +-
> >  drivers/hwtracing/coresight/coresight.c      | 62 +++++++++-----------
> >  2 files changed, 29 insertions(+), 36 deletions(-)
> >
> > diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h
> > index f2dc625ea5856..5fe773c4d6cc5 100644
> > --- a/drivers/hwtracing/coresight/coresight-priv.h
> > +++ b/drivers/hwtracing/coresight/coresight-priv.h
> > @@ -148,7 +148,8 @@ static inline void coresight_write_reg_pair(void __iomem *addr, u64 val,
> >  void coresight_disable_path(struct list_head *path);
> >  int coresight_enable_path(struct list_head *path, u32 mode, void *sink_data);
> >  struct coresight_device *coresight_get_sink(struct list_head *path);
> > -struct coresight_device *coresight_get_enabled_sink(bool reset);
> > +struct coresight_device *
> > +coresight_get_enabled_sink(struct coresight_device *source);
> >  struct coresight_device *coresight_get_sink_by_id(u32 id);
> >  struct coresight_device *
> >  coresight_find_default_sink(struct coresight_device *csdev);
> > diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c
> > index e9c90f2de34ac..bb4f9e0a5438d 100644
> > --- a/drivers/hwtracing/coresight/coresight.c
> > +++ b/drivers/hwtracing/coresight/coresight.c
> > @@ -540,50 +540,46 @@ struct coresight_device *coresight_get_sink(struct list_head *path)
> >         return csdev;
> >  }
> >
> > -static int coresight_enabled_sink(struct device *dev, const void *data)
> > +static struct coresight_device *
> > +coresight_find_enabled_sink(struct coresight_device *csdev)
> >  {
> > -       const bool *reset = data;
> > -       struct coresight_device *csdev = to_coresight_device(dev);
> > +       int i;
> > +       struct coresight_device *sink;
> >
> >         if ((csdev->type == CORESIGHT_DEV_TYPE_SINK ||
> >              csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) &&
> > -            csdev->activated) {
> > -               /*
> > -                * Now that we have a handle on the sink for this session,
> > -                * disable the sysFS "enable_sink" flag so that possible
> > -                * concurrent perf session that wish to use another sink don't
> > -                * trip on it.  Doing so has no ramification for the current
> > -                * session.
> > -                */
> > -               if (*reset)
> > -                       csdev->activated = false;
> > +            csdev->activated)
> > +               return csdev;
> >
> > -               return 1;
> > +       /*
> > +        * Recursively explore each port found on this element.
> > +        */
> > +       for (i = 0; i < csdev->pdata->nr_outport; i++) {
> > +               struct coresight_device *child_dev;
> > +
> > +               child_dev = csdev->pdata->conns[i].child_dev;
> > +               if (child_dev)
> > +                       sink = coresight_find_enabled_sink(child_dev);
> > +               if (sink)
> > +                       return sink;
> >         }
> >
> > -       return 0;
> > +       return NULL;
> >  }
> >
> >  /**
> > - * coresight_get_enabled_sink - returns the first enabled sink found on the bus
> > - * @deactivate:        Whether the 'enable_sink' flag should be reset
> > - *
> > - * When operated from perf the deactivate parameter should be set to 'true'.
> > - * That way the "enabled_sink" flag of the sink that was selected can be reset,
> > - * allowing for other concurrent perf sessions to choose a different sink.
> > + * coresight_get_enabled_sink - returns the first enabled sink using
> > + * connection based search starting from the source reference
> >   *
> > - * When operated from sysFS users have full control and as such the deactivate
> > - * parameter should be set to 'false', hence mandating users to explicitly
> > - * clear the flag.
> > + * @source: Coresight source device reference
> >   */
> > -struct coresight_device *coresight_get_enabled_sink(bool deactivate)
> > +struct coresight_device *
> > +coresight_get_enabled_sink(struct coresight_device *source)
> >  {
> > -       struct device *dev = NULL;
> > -
> > -       dev = bus_find_device(&coresight_bustype, NULL, &deactivate,
> > -                             coresight_enabled_sink);
> > +       if (!source)
> > +               return NULL;
> >
> > -       return dev ? to_coresight_device(dev) : NULL;
> > +       return coresight_find_enabled_sink(source);
> >  }
> >
> >  static int coresight_sink_by_id(struct device *dev, const void *data)
> > @@ -988,11 +984,7 @@ int coresight_enable(struct coresight_device *csdev)
> >                 goto out;
> >         }
> >
> > -       /*
> > -        * Search for a valid sink for this session but don't reset the
> > -        * "enable_sink" flag in sysFS.  Users get to do that explicitly.
> > -        */
> > -       sink = coresight_get_enabled_sink(false);
> > +       sink = coresight_get_enabled_sink(csdev);
> >         if (!sink) {
> >                 ret = -EINVAL;
> >                 goto out;
> > --
> > 2.25.1
> >
> > _______________________________________________
> > CoreSight mailing list
> > CoreSight@lists.linaro.org
> > https://lists.linaro.org/mailman/listinfo/coresight

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-02 17:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201026234905.1022767-1-sashal@kernel.org>
2020-10-26 23:46 ` [PATCH AUTOSEL 5.9 021/147] ARM: 8997/2: hw_breakpoint: Handle inexact watchpoint addresses Sasha Levin
2020-10-26 23:47 ` [PATCH AUTOSEL 5.9 046/147] media: platform: Improve queue set up flow for bug fixing Sasha Levin
2020-10-26 23:47 ` [PATCH AUTOSEL 5.9 055/147] arm64: topology: Stop using MPIDR for topology information Sasha Levin
2020-10-26 23:47 ` [PATCH AUTOSEL 5.9 061/147] drm: exynos: fix common struct sg_table related issues Sasha Levin
2020-10-26 23:47 ` [PATCH AUTOSEL 5.9 072/147] cpufreq: sti-cpufreq: add stih418 support Sasha Levin
2020-10-26 23:47 ` [PATCH AUTOSEL 5.9 075/147] coresight: Make sysfs functional on topologies with per core sink Sasha Levin
2020-11-02  6:59   ` Linu Cherian
2020-11-02 17:29     ` Mathieu Poirier [this message]
2020-10-26 23:47 ` [PATCH AUTOSEL 5.9 081/147] arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE Sasha Levin
2020-10-26 23:48 ` [PATCH AUTOSEL 5.9 131/147] soc: imx: gpcv2: Use dev_err_probe() to simplify error handling Sasha Levin
2020-10-26 23:59   ` Fabio Estevam
2020-11-02  0:31     ` Sasha Levin
2020-10-26 23:48 ` [PATCH AUTOSEL 5.9 133/147] ARM: dts: s5pv210: Enable audio on Aries boards Sasha Levin
2020-10-26 23:48 ` [PATCH AUTOSEL 5.9 134/147] ARM: dts: s5pv210: remove DMA controller bus node name to fix dtschema warnings Sasha Levin
2020-10-26 23:48 ` [PATCH AUTOSEL 5.9 135/147] ARM: dts: s5pv210: move fixed clocks under root node Sasha Levin
2020-10-26 23:48 ` [PATCH AUTOSEL 5.9 136/147] ARM: dts: s5pv210: move PMU node out of clock controller Sasha Levin
2020-10-26 23:48 ` [PATCH AUTOSEL 5.9 137/147] ARM: dts: s5pv210: remove dedicated 'audio-subsystem' node Sasha Levin
2020-10-26 23:48 ` [PATCH AUTOSEL 5.9 138/147] ARM: dts: s5pv210: add RTC 32 KHz clock in Aries family Sasha Levin
2020-10-26 23:48 ` [PATCH AUTOSEL 5.9 139/147] ARM: dts: s5pv210: align SPI GPIO node name with dtschema in Aries Sasha Levin
2020-10-26 23:48 ` [PATCH AUTOSEL 5.9 141/147] soc: ti: k3: ringacc: add am65x sr2.0 support Sasha Levin

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=20201102172931.GC2749502@xps15 \
    --to=mathieu.poirier@linaro.org \
    --cc=coresight@lists.linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lcherian@marvell.com \
    --cc=linuc.decode@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.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