linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH stable-5.9 1/2] coresight: etm: perf: Sink selection using sysfs is deprecated
@ 2020-11-16 12:35 Linu Cherian
  2020-11-16 12:35 ` [PATCH stable-v5.9 2/2] coresight: Fix uninitialised pointer bug in etm_setup_aux() Linu Cherian
  2020-11-17 11:45 ` [PATCH stable-5.9 1/2] coresight: etm: perf: Sink selection using sysfs is deprecated Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Linu Cherian @ 2020-11-16 12:35 UTC (permalink / raw)
  To: stable, gregkh
  Cc: kernel test robot, mathieu.poirier, suzuki.poulose, coresight,
	Linu Cherian, linuc.decode, linux-arm-kernel, mike.leach

commit bb1860efc817c18fce4112f25f51043e44346d1b upstream.

When commit 6d578258b955 ("coresight: Make sysfs functional on
topologies with per core sink") 
was merged to stable, this patch was a pre-requisite and got
missed out leading to build breakages.

When using the perf interface, sink selection using sysfs is
deprecated.

Signed-off-by: Linu Cherian <lcherian@marvell.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200916191737.4001561-14-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reported-by: kernel test robot <lkp@intel.com>
---
 drivers/hwtracing/coresight/coresight-etm-perf.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
index be591b557df9..75379184f391 100644
--- a/drivers/hwtracing/coresight/coresight-etm-perf.c
+++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
@@ -222,8 +222,6 @@ static void *etm_setup_aux(struct perf_event *event, void **pages,
 	if (event->attr.config2) {
 		id = (u32)event->attr.config2;
 		sink = coresight_get_sink_by_id(id);
-	} else {
-		sink = coresight_get_enabled_sink(true);
 	}
 
 	mask = &event_data->mask;
-- 
2.25.1


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH stable-v5.9 2/2] coresight: Fix uninitialised pointer bug in etm_setup_aux()
  2020-11-16 12:35 [PATCH stable-5.9 1/2] coresight: etm: perf: Sink selection using sysfs is deprecated Linu Cherian
@ 2020-11-16 12:35 ` Linu Cherian
  2020-11-17 11:45 ` [PATCH stable-5.9 1/2] coresight: etm: perf: Sink selection using sysfs is deprecated Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Linu Cherian @ 2020-11-16 12:35 UTC (permalink / raw)
  To: stable, gregkh
  Cc: kernel test robot, mathieu.poirier, suzuki.poulose, coresight,
	linuc.decode, linux-arm-kernel, mike.leach

From: Mike Leach <mike.leach@linaro.org>

commit 39a7661dcf655c8198fd5d72412f5030a8e58444 upstream.

Commit [bb1860efc817] changed the sink handling code introducing an
uninitialised pointer bug. This results in the default sink selection
failing.

Prior to commit:

static void etm_setup_aux(...)

<snip>
        struct coresight_device *sink;
<snip>

        /* First get the selected sink from user space. */
        if (event->attr.config2) {
                id = (u32)event->attr.config2;
                sink = coresight_get_sink_by_id(id);
        } else {
                sink = coresight_get_enabled_sink(true);
        }
<ctd>

*sink always initialised - possibly to NULL which triggers the
automatic sink selection.

After commit:

static void etm_setup_aux(...)

<snip>
        struct coresight_device *sink;
<snip>

        /* First get the selected sink from user space. */
        if (event->attr.config2) {
                id = (u32)event->attr.config2;
                sink = coresight_get_sink_by_id(id);
        }
<ctd>

*sink pointer uninitialised when not providing a sink on the perf command
line. This breaks later checks to enable automatic sink selection.

Fixes: bb1860efc817 ("coresight: etm: perf: Sink selection using sysfs is deprecated")
Signed-off-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20201029164559.1268531-3-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reported-by: kernel test robot <lkp@intel.com>
---
 drivers/hwtracing/coresight/coresight-etm-perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
index 75379184f391..9a8d03e62a75 100644
--- a/drivers/hwtracing/coresight/coresight-etm-perf.c
+++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
@@ -210,7 +210,7 @@ static void *etm_setup_aux(struct perf_event *event, void **pages,
 	u32 id;
 	int cpu = event->cpu;
 	cpumask_t *mask;
-	struct coresight_device *sink;
+	struct coresight_device *sink = NULL;
 	struct etm_event_data *event_data = NULL;
 
 	event_data = alloc_event_data(cpu);
-- 
2.25.1


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH stable-5.9 1/2] coresight: etm: perf: Sink selection using sysfs is deprecated
  2020-11-16 12:35 [PATCH stable-5.9 1/2] coresight: etm: perf: Sink selection using sysfs is deprecated Linu Cherian
  2020-11-16 12:35 ` [PATCH stable-v5.9 2/2] coresight: Fix uninitialised pointer bug in etm_setup_aux() Linu Cherian
@ 2020-11-17 11:45 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2020-11-17 11:45 UTC (permalink / raw)
  To: Linu Cherian
  Cc: kernel test robot, mathieu.poirier, suzuki.poulose, coresight,
	stable, linuc.decode, linux-arm-kernel, mike.leach

On Mon, Nov 16, 2020 at 06:05:09PM +0530, Linu Cherian wrote:
> commit bb1860efc817c18fce4112f25f51043e44346d1b upstream.
> 
> When commit 6d578258b955 ("coresight: Make sysfs functional on
> topologies with per core sink") 
> was merged to stable, this patch was a pre-requisite and got
> missed out leading to build breakages.
> 
> When using the perf interface, sink selection using sysfs is
> deprecated.
> 
> Signed-off-by: Linu Cherian <lcherian@marvell.com>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> Link: https://lore.kernel.org/r/20200916191737.4001561-14-mathieu.poirier@linaro.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Reported-by: kernel test robot <lkp@intel.com>
> ---
>  drivers/hwtracing/coresight/coresight-etm-perf.c | 2 --
>  1 file changed, 2 deletions(-)

Both now queued up, thanks.

greg k-h

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-17 11:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 12:35 [PATCH stable-5.9 1/2] coresight: etm: perf: Sink selection using sysfs is deprecated Linu Cherian
2020-11-16 12:35 ` [PATCH stable-v5.9 2/2] coresight: Fix uninitialised pointer bug in etm_setup_aux() Linu Cherian
2020-11-17 11:45 ` [PATCH stable-5.9 1/2] coresight: etm: perf: Sink selection using sysfs is deprecated Greg KH

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