Re: [PATCH] perf: fix event leak when perf_event_open() failed to create event_file

2016-03-21 Thread Alexander Shishkin
gt;*/ > - if (!event_file) > + if (IS_ERR_OR_NULL(event_file)) > free_event(event); By this time, we have already checked for IS_ERR(event_file) once, why not just fix it up there like so: --- From: Alexander Shishkin Date: Mon, 21 Mar 2016 09:55:09 +0200 Subject: perf: Don't

Re: [RESEND PATCH V4 1/4] stm class: provision for statically assigned masterIDs

2016-03-21 Thread Alexander Shishkin
Chunyan Zhang writes: > From: Mathieu Poirier > > Some architecture like ARM assign masterIDs at the HW design > phase. Those are therefore unreachable to users, making masterID > management in the generic STM core irrelevant. > > In this kind of configuration channels are shared between master

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-19 Thread Alexander Shishkin
Peter Zijlstra writes: > On Mon, Mar 14, 2016 at 04:04:44PM +0200, Alexander Shishkin wrote: >> Peter Zijlstra writes: > >> >> +static void perf_pmu_output_stop(struct perf_event *event) >> >> +{ >> >> + int cpu, err; >> >>

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-14 Thread Alexander Shishkin
Peter Zijlstra writes: > On Fri, Mar 04, 2016 at 03:42:46PM +0200, Alexander Shishkin wrote: >> @@ -4649,10 +4679,22 @@ static void perf_mmap_close(struct vm_area_struct >> *vma) >> */ >> if (rb_has_aux(rb) && vma->vm_pgoff == rb->aux_pgoff

Re: [PATCH 00/12] perf: more fixes

2016-03-11 Thread Alexander Shishkin
event wasn't actually stopped anymore. > > This would tickle a WARN in the x86-pmu code which isn't expecting to > start a !stopped event. > > Signed-off-by: Peter Zijlstra (Intel) FWIW, Reviewed-by: Alexander Shishkin Cheers, -- Alex

[tip:perf/core] perf/core: Fix perf_sched_count derailment

2016-03-08 Thread tip-bot for Alexander Shishkin
Commit-ID: 927a5570855836e5d5859a80ce7e91e963545e8f Gitweb: http://git.kernel.org/tip/927a5570855836e5d5859a80ce7e91e963545e8f Author: Alexander Shishkin AuthorDate: Wed, 2 Mar 2016 13:24:14 +0200 Committer: Ingo Molnar CommitDate: Tue, 8 Mar 2016 12:18:31 +0100 perf/core: Fix

[PATCH v2 1/5] perf: Refuse to begin aux transaction after aux_mmap_count drops

2016-03-04 Thread Alexander Shishkin
reference. Signed-off-by: Alexander Shishkin --- kernel/events/ring_buffer.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index 1faad2cfdb..af5fbc7e91 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c

[PATCH v2 4/5] perf/x86/intel/pt: Move transaction start/stop to pmu start/stop callbacks

2016-03-04 Thread Alexander Shishkin
pt_event_{start,stop}. As a bonus, we get rid of pt_buffer_is_full(), which is already taken care of by perf_aux_output_begin() anyway. Signed-off-by: Alexander Shishkin Cc: Mathieu Poirier --- arch/x86/events/intel/pt.c | 85 +++--- 1 file changed, 27

[PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-04 Thread Alexander Shishkin
that drops the last AUX reference has to happen in perf_mmap_close() on that AUX area. Signed-off-by: Alexander Shishkin --- kernel/events/core.c| 100 +++- kernel/events/internal.h| 1 - kernel/events/ring_buffer.c | 37 +---

[PATCH v2 5/5] perf/x86/intel/bts: Move transaction start/stop to start/stop callbacks

2016-03-04 Thread Alexander Shishkin
bts_event_{start,stop}. As a bonus, we get rid of bts_buffer_is_full(), which is already taken care of by perf_aux_output_begin() anyway. Signed-off-by: Alexander Shishkin Cc: Mathieu Poirier --- arch/x86/events/intel/bts.c | 105 1 file changed, 48

[PATCH v2 3/5] perf: Document aux api usage

2016-03-04 Thread Alexander Shishkin
In order to ensure safe aux buffer management, we rely on the assumption that pmu::stop() stops its ongoing aux transaction and not just the hw. This patch documents this requirement for perf_aux_output_{begin,end}() apis. Signed-off-by: Alexander Shishkin Cc: Mathieu Poirier --- kernel

[PATCH v2 0/5] perf: Untangle aux refcounting

2016-03-04 Thread Alexander Shishkin
Hi Peter, Here's a long overdue update of the previous attempt to untangle the aux buffer unmapping and deallocation. Most of the work is in 2/5. Alexander Shishkin (5): perf: Refuse to begin aux transaction after aux_mmap_count drops perf: Free aux pages in unmap path perf: Documen

[PATCH] perf: Fix perf_sched_count derailment

2016-03-02 Thread Alexander Shishkin
nd up disabling scheduler's jump label even though we'd still have active events in the system, thereby facilitating the arrival of the infernal regions upon us. I'm fixing this by moving account_event() inside perf_event_alloc(). Signed-off-by: Alexander Shishkin --- kernel/events/core.c

Re: [PATCH 1/1] perf/core: find auxiliary events in running pmus list

2016-02-25 Thread Alexander Shishkin
kan.li...@intel.com writes: > From: Kan Liang > > perf_event_aux funciton goes through pmus list to find proper auxiliary > events to output. The pmus list consists of all possible pmus in the > system, that may or may not be running at the moment, while the > auxiliary events must be from the ru

Re: [git pull] stm class/intel_th: Updates for char-misc-next

2016-02-16 Thread Alexander Shishkin
Greg KH writes: > On Mon, Feb 15, 2016 at 06:08:07PM +0200, Alexander Shishkin wrote: >> Hi Greg, >> >> These are patches I have queued for the next merge window. Please >> consider pulling. >> >> The following changes since commit 1b79dff672ca09a5461cc

[PATCH 01/20] stm class: Use a signed return type for stm_find_master_chan

2016-02-15 Thread Alexander Shishkin
From: Lucas Tanure The return type "unsigned int" was used by the stm_find_master_chan function despite of the aspect that it will eventually return a negative error code. Done with the help of Coccinelle. Signed-off-by: Lucas Tanure Signed-off-by: Alexander Shishkin --- drivers

[PATCH 02/20] stm class: Fix master deallocation in device unregistering

2016-02-15 Thread Alexander Shishkin
unloading the stm driver. Signed-off-by: Chunyan Zhang [alexander.shish...@intel.com: re-wrote the commit message] Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm

[PATCH 07/20] intel_th: msu: Release resources on read error

2016-02-15 Thread Alexander Shishkin
From: Laurent FERT Right now, reading from msc character device will leak its's user count on read error. This patch makes sure resources are released when there is no data left to read from the buffer. Signed-off-by: Laurent FERT Signed-off-by: Alexander Shishkin --- drivers/hwtr

[PATCH 05/20] intel_th: Update scratchpad bits according to enabled output activity

2016-02-15 Thread Alexander Shishkin
s the driver to automatically set scratchpad register bits according to the output configuration that's enabled. Based on work by Yann Fouassier. Signed-off-by: Yann Fouassier Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/core.c | 5 + drivers/hwtracing/inte

[PATCH 06/20] intel_th: msu: Fix offset for wrapped block

2016-02-15 Thread Alexander Shishkin
From: Laurent FERT Fix offset for the second pass on the wrapped block when iterating over memory in multi-block mode, otherwise wrong part of the block will get copied. Signed-off-by: Laurent FERT Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/msu.c | 2 +- 1 file changed

[PATCH 13/20] stm class: dummy_stm: Create multiple devices

2016-02-15 Thread Alexander Shishkin
STM framework should be able to handle multiple STM devices at a time, each one with its own master allocation policy. This patch changes dummy_stm driver to create multiple STM sinks to help testing the framework. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/dummy_stm.c | 57

[PATCH 12/20] stm class: Support devices with multiple instances

2016-02-15 Thread Alexander Shishkin
prohibiting dots from being used in policy names. Suggested-by: Chunyan Zhang Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/policy.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/stm/policy.c b/drivers/hwtracing/stm/policy.c index

[PATCH 16/20] stm class: Guard output assignment against concurrency

2016-02-15 Thread Alexander Shishkin
. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 17 + drivers/hwtracing/stm/stm.h | 1 + 2 files changed, 18 insertions(+) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 4a626d8990..f6ade21729 100644 --- a/drivers/hwtracing/stm

[PATCH 17/20] stm class: Fix unbalanced module/device refcounting

2016-02-15 Thread Alexander Shishkin
s and annotates each site so that it's easier to verify correctness by reading the code. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwt

[PATCH 18/20] stm class: Fix a race in unlinking

2016-02-15 Thread Alexander Shishkin
took the locks, it will release them and repeat the whole unlinking procedure from the beginning, unless the other contender beat us to it. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 54 ++-- 1 file changed, 42 insertions(+

[PATCH 20/20] stm class: dummy_stm: Add link callback for fault injection

2016-02-15 Thread Alexander Shishkin
STM device's link callback has the power to abort master/channel assignment by returning a negative error code. Use this in dummy stm device to optionally abort assigning certain channel IDs. This is useful as fault injection into the stm class core, for testing purposes. Signed-off-by: Alex

[PATCH 19/20] stm class: Plug stm device's unlink callback

2016-02-15 Thread Alexander Shishkin
STM device's unlink callback is never actually called from anywhere in the stm class code. This patch adds calls to stm driver's unlink method after the unlinking has succeeded. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 23 +++ include/l

[PATCH 08/20] intel_th: sth: Sanitize packet callback's return values

2016-02-15 Thread Alexander Shishkin
these issues. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/sth.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c index 56101c33e1..e1aee61dd7 100644 --- a/drivers/hwtracing/int

[PATCH 10/20] intel_th: Use real device index in the node names

2016-02-15 Thread Alexander Shishkin
Most of the intel_th core supports multiple co-existing TH devices, except for output device nodes, where intel_th device id is hardcoded to be zero. Fix this by fetching the actual intel_th device id from the parent device's drvdata. Signed-off-by: Alexander Shishkin --- drivers/hwtr

[PATCH 11/20] stm class: Use driver's packet callback return value

2016-02-15 Thread Alexander Shishkin
stm core will have to take appropriate action. For now, we need to account for the possibility that the stm driver may not support certain combinations of packet type/flags, in which case it is expected to signal an error. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 19

[PATCH 14/20] stm class: Add heartbeat stm source device

2016-02-15 Thread Alexander Shishkin
-by: Alexander Shishkin --- drivers/hwtracing/stm/Kconfig | 11 drivers/hwtracing/stm/Makefile| 2 + drivers/hwtracing/stm/heartbeat.c | 130 ++ 3 files changed, 143 insertions(+) create mode 100644 drivers/hwtracing/stm/heartbeat.c diff --git a

[PATCH 15/20] stm class: Fix unlocking braino in the error path

2016-02-15 Thread Alexander Shishkin
on if it indeed does happen. This patch unifies the unlocking in the exit path of __stm_source_link_drop() to fix this. Reported-by: Laurent Fert Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/driver

[PATCH 09/20] intel_th: Set root device's drvdata early

2016-02-15 Thread Alexander Shishkin
Already during the subdevice initialization time, devices will need to reference Intel TH controller descriptor structure. This patch moves setting the drvdata from the pci glue to intel_th core, before subdevices are populated. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th

[PATCH 04/20] intel_th: gth: Remove commented-out code

2016-02-15 Thread Alexander Shishkin
There's a commented-out function in the GTH driver that's a leftover from previous versions of the driver, where we tried to inherit the pre-existing configuration, which didn't prove to be a sound idea. This patch removes the function. No functional changes. Signed-off-by: Ale

[PATCH 00/20] stm class/intel_th: Updates for char-misc-next

2016-02-15 Thread Alexander Shishkin
Hi Greg, These are the patches I have queued for the next merge window. Please consider applying. Alexander Shishkin (16): intel_th: Depend on HAS_IOMEM intel_th: gth: Remove commented-out code intel_th: Update scratchpad bits according to enabled output activity intel_th: sth: Sanitize

[PATCH 03/20] intel_th: Depend on HAS_IOMEM

2016-02-15 Thread Alexander Shishkin
This driver requires io memory to operate, so don't even consider it for NO_IOMEM architectures. Reported-by: Richard Weinberger Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtr

[git pull] stm class/intel_th: Updates for char-misc-next

2016-02-15 Thread Alexander Shishkin
://github.com/virtuoso/linux-perf.git stm-for-greg for you to fetch changes up to fb756bc533ca533c2f415b74589b7172c3456b7c: stm class: dummy_stm: Add link callback for fault injection (2016-02-15 15:54:37 +0200) Alexander Shishkin (16

Re: [PATCH] drivers: stm: correct the index in master array release

2016-02-15 Thread Alexander Shishkin
Chunyan Zhang writes: > On Tue, Feb 9, 2016 at 6:12 PM, Alexander Shishkin > wrote: >> Chunyan Zhang writes: >> >>> It would be broken if stm_data->sw_start isn't zero, because that >>> stp_master_free() get the 'master' with __stm_master()

[QUEUED v20160212 18/19] stm class: Plug stm device's unlink callback

2016-02-12 Thread Alexander Shishkin
STM device's unlink callback is never actually called from anywhere in the stm class code. This patch adds calls to stm driver's unlink method after the unlinking has succeeded. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 23 +++ include/l

[QUEUED v20160212 19/19] stm class: dummy_stm: Add link callback for fault injection

2016-02-12 Thread Alexander Shishkin
STM device's link callback has the power to abort master/channel assignment by returning a negative error code. Use this in dummy stm device to optionally abort assigning certain channel IDs. This is useful as fault injection into the stm class core, for testing purposes. Signed-off-by: Alex

[QUEUED v20160212 13/19] stm class: Add heartbeat stm source device

2016-02-12 Thread Alexander Shishkin
-by: Alexander Shishkin --- drivers/hwtracing/stm/Kconfig | 11 drivers/hwtracing/stm/Makefile| 2 + drivers/hwtracing/stm/heartbeat.c | 130 ++ 3 files changed, 143 insertions(+) create mode 100644 drivers/hwtracing/stm/heartbeat.c diff --git a

[QUEUED v20160212 12/19] stm class: dummy_stm: Create multiple devices

2016-02-12 Thread Alexander Shishkin
STM framework should be able to handle multiple STM devices at a time, each one with its own master allocation policy. This patch changes dummy_stm driver to create multiple STM sinks to help testing the framework. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/dummy_stm.c | 57

[QUEUED v20160212 17/19] stm class: Fix a race in unlinking

2016-02-12 Thread Alexander Shishkin
took the locks, it will release them and repeat the whole unlinking procedure from the beginning, unless the other contender beat us to it. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 54 ++-- 1 file changed, 42 insertions(+

[QUEUED v20160212 16/19] stm class: Fix unbalanced module/device refcounting

2016-02-12 Thread Alexander Shishkin
s and annotates each site so that it's easier to verify correctness by reading the code. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwt

[QUEUED v20160212 14/19] stm class: Fix unlocking braino in the error path

2016-02-12 Thread Alexander Shishkin
on if it indeed does happen. This patch unifies the unlocking in the exit path of __stm_source_link_drop() to fix this. Reported-by: Laurent Fert Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/driver

[QUEUED v20160212 15/19] stm class: Guard output assignment against concurrency

2016-02-12 Thread Alexander Shishkin
. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 17 + drivers/hwtracing/stm/stm.h | 1 + 2 files changed, 18 insertions(+) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index fb5a6a582b..6a254ce4b9 100644 --- a/drivers/hwtracing/stm

[QUEUED v20160212 11/19] stm class: Support devices with multiple instances

2016-02-12 Thread Alexander Shishkin
prohibiting dots from being used in policy names. Suggested-by: Chunyan Zhang Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/policy.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/stm/policy.c b/drivers/hwtracing/stm/policy.c index

[QUEUED v20160212 10/19] stm class: Use driver's packet callback return value

2016-02-12 Thread Alexander Shishkin
stm core will have to take appropriate action. For now, we need to account for the possibility that the stm driver may not support certain combinations of packet type/flags, in which case it is expected to signal an error. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 19

[QUEUED v20160212 09/19] intel_th: Use real device index in the node names

2016-02-12 Thread Alexander Shishkin
Most of the intel_th core supports multiple co-existing TH devices, except for output device nodes, where intel_th device id is hardcoded to be zero. Fix this by fetching the actual intel_th device id from the parent device's drvdata. Signed-off-by: Alexander Shishkin --- drivers/hwtr

[QUEUED v20160212 06/19] intel_th: msu: Release resources on read error

2016-02-12 Thread Alexander Shishkin
From: Laurent FERT Right now, reading from msc character device will leak its's user count on read error. This patch makes sure resources are released when there is no data left to read from the buffer. Signed-off-by: Laurent FERT Signed-off-by: Alexander Shishkin --- drivers/hwtr

[QUEUED v20160212 04/19] intel_th: Update scratchpad bits according to enabled output activity

2016-02-12 Thread Alexander Shishkin
s the driver to automatically set scratchpad register bits according to the output configuration that's enabled. Based on work by Yann Fouassier. Signed-off-by: Yann Fouassier Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/core.c | 5 + drivers/hwtracing/inte

[QUEUED v20160212 07/19] intel_th: sth: Sanitize packet callback's return values

2016-02-12 Thread Alexander Shishkin
these issues. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/sth.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c index 56101c33e1..e1aee61dd7 100644 --- a/drivers/hwtracing/int

[QUEUED v20160212 08/19] intel_th: Set root device's drvdata early

2016-02-12 Thread Alexander Shishkin
Already during the subdevice initialization time, devices will need to reference Intel TH controller descriptor structure. This patch moves setting the drvdata from the pci glue to intel_th core, before subdevices are populated. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th

[QUEUED v20160212 05/19] intel_th: msu: Fix offset for wrapped block

2016-02-12 Thread Alexander Shishkin
From: Laurent FERT Fix offset for the second pass on the wrapped block when iterating over memory in multi-block mode, otherwise wrong part of the block will get copied. Signed-off-by: Laurent FERT Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/msu.c | 2 +- 1 file changed

[QUEUED v20160212 02/19] intel_th: Depend on HAS_IOMEM

2016-02-12 Thread Alexander Shishkin
This driver requires io memory to operate, so don't even consider it for NO_IOMEM architectures. Reported-by: Richard Weinberger Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtr

[QUEUED v20160212 03/19] intel_th: gth: Remove commented-out code

2016-02-12 Thread Alexander Shishkin
There's a commented-out function in the GTH driver that's a leftover from previous versions of the driver, where we tried to inherit the pre-existing configuration, which didn't prove to be a sound idea. This patch removes the function. No functional changes. Signed-off-by: Ale

[QUEUED v20160212 01/19] stm class: Use a signed return type for stm_find_master_chan

2016-02-12 Thread Alexander Shishkin
From: Lucas Tanure The return type "unsigned int" was used by the stm_find_master_chan function despite of the aspect that it will eventually return a negative error code. Done with the help of Coccinelle. Signed-off-by: Lucas Tanure Signed-off-by: Alexander Shishkin --- drivers

[QUEUED v20160212 00/19] stm class/intel_th: Patches in my queue

2016-02-12 Thread Alexander Shishkin
Hi everybody, These are the patches that I have in my queue right now, on top of Greg's char-misc/char-misc-next branch. Questions, concerns, objections, please let me know. Otherwise I would like to send it to Greg for the next merge window. Alexander Shishkin (16): intel_th: Depe

Re: [PATCH V2 3/6] stm class: provision for statically assigned masterIDs

2016-02-12 Thread Alexander Shishkin
Mathieu Poirier writes: > On 8 February 2016 at 06:26, Alexander Shishkin > wrote: >> This $end==$start situation itself may be ambiguous and can be >> interpreted either as having just one *static* master ID fixed for all >> SW writers (what I assumed from your commit

RE: [PATCH V2 3/6] stm class: provision for statically assigned masterIDs

2016-02-12 Thread Alexander Shishkin
Al Grant writes: >> Mike did write "master IDs are hardwired to individual cores and core >> security >> states", which make assignment for one platform very static. >> On the flip side those will change from one system to another. > > It depends on your perspective. From the perspective of a u

Re: [PATCH V3 6/6] coresight-stm: adding driver for CoreSight STM component

2016-02-12 Thread Alexander Shishkin
Chunyan Zhang writes: > +static long stm_generic_set_options(struct stm_data *stm_data, > + unsigned int master, > + unsigned int channel, > + unsigned int nr_chans, > +

Re: [PATCH V3 1/6] stm class: Add ioctl get_options interface

2016-02-12 Thread Alexander Shishkin
Chunyan Zhang writes: > There is already an interface of set_options, but no get_options yet. > Before setting any options, one would may want to see the current > status of that option by means of get_options interface. This > interface has been used in CoreSight STM driver. I'm not sure I unde

Re: [PATCH] drivers: stm: correct the index in master array release

2016-02-09 Thread Alexander Shishkin
Chunyan Zhang writes: > It would be broken if stm_data->sw_start isn't zero, because that > stp_master_free() get the 'master' with __stm_master()/stm_master(), > in which the masterID is the second input parameter minus > stm_data->sw_start. So freeing STM masters has to start from > stm_data->s

Re: [PATCH V2 3/6] stm class: provision for statically assigned masterIDs

2016-02-08 Thread Alexander Shishkin
Mathieu Poirier writes: > On 5 February 2016 at 05:52, Alexander Shishkin > wrote: >> Chunyan Zhang writes: >> >>> From: Mathieu Poirier >>> >>> Some architecture like ARM assign masterIDs statically at the HW design >>> phase, making ma

RE: [PATCH V2 3/6] stm class: provision for statically assigned masterIDs

2016-02-08 Thread Alexander Shishkin
Mike Leach writes: > Hi, > > I think a quick clarification of the ARM hardware STM architecture may be of > value here. > > The ARM hardware STM, when implemented as recommend in a hardware design, the > master IDs are not under driver control, but have a hardwire association with > source dev

[QUEUED v0 19/19] intel_th: Use real device index in the node names

2016-02-05 Thread Alexander Shishkin
Most of the intel_th core supports multiple co-existing TH devices, except for output device nodes, where intel_th device id is hardcoded to be zero. Fix this by fetching the actual intel_th device id from the parent device's drvdata. Signed-off-by: Alexander Shishkin --- drivers/hwtr

[QUEUED v0 16/19] stm class: Support devices with multiple instances

2016-02-05 Thread Alexander Shishkin
prohibiting dots from being used in policy names. Suggested-by: Chunyan Zhang Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/policy.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/stm/policy.c b/drivers/hwtracing/stm/policy.c index

[QUEUED v0 15/19] intel_th: sth: Sanitize packet callback's return values

2016-02-05 Thread Alexander Shishkin
these issues. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/sth.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c index 56101c33e1..e1aee61dd7 100644 --- a/drivers/hwtracing/int

[QUEUED v0 17/19] stm class: dummy_stm: Create multiple devices

2016-02-05 Thread Alexander Shishkin
STM framework should be able to handle multiple STM devices at a time, each one with its own master allocation policy. This patch changes dummy_stm driver to create multiple STM sinks to help testing the framework. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/dummy_stm.c | 55

[QUEUED v0 18/19] intel_th: Set root device's drvdata early

2016-02-05 Thread Alexander Shishkin
Already during the subdevice initialization time, devices will need to reference Intel TH controller descriptor structure. This patch moves setting the drvdata from the pci glue to intel_th core, before subdevices are populated. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th

[QUEUED v0 08/19] intel_th: pci: Add Apollo Lake SOC support

2016-02-05 Thread Alexander Shishkin
This adds Intel(R) Trace Hub PCI ID for Apollo Lake SOC. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/pci.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c index 641e879360..b5760730e1 100644 --- a

[QUEUED v0 07/19] stm class: Prevent user-controllable allocations

2016-02-05 Thread Alexander Shishkin
the input buffer size to avoid these issues. Reported-by: Sasha Levin Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 40a8b79ab7..aef8ddb244 100644 ---

[QUEUED v0 13/19] intel_th: Update scratchpad bits according to enabled output activity

2016-02-05 Thread Alexander Shishkin
s the driver to automatically set scratchpad register bits according to the output configuration that's enabled. Based on work by Yann Fouassier. Signed-off-by: Yann Fouassier Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/core.c | 5 + drivers/hwtracing/inte

[QUEUED v0 12/19] intel_th: gth: Remove commented-out code

2016-02-05 Thread Alexander Shishkin
There's a commented-out function in the GTH driver that's a leftover from previous versions of the driver, where we tried to inherit the pre-existing configuration, which didn't prove to be a sound idea. This patch removes the function. No functional changes. Signed-off-by: Ale

[QUEUED v0 14/19] stm class: Use driver's packet callback's return value

2016-02-05 Thread Alexander Shishkin
stm core will have to take appropriate action. For now, we need to account for the possibility that the stm driver may not support certain combinations of packet type/flags, in which case it is expected to signal an error. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 19

[QUEUED v0 03/19] stm class: Select CONFIG_SRCU

2016-02-05 Thread Alexander Shishkin
e other SRCU using drivers have. Signed-off-by: Arnd Bergmann Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices") Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwt

[QUEUED v0 09/19] intel_th: pci: Add Broxton SOC support

2016-02-05 Thread Alexander Shishkin
This adds Intel(R) Trace Hub PCI ID for Broxton SOC. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/pci.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c index b5760730e1..09017073d7 100644 --- a

[QUEUED v0 04/19] stm class: Fix locking in unbinding policy path

2016-02-05 Thread Alexander Shishkin
path), where it's actually needed; the other caller of the policy unbinding function already takes the mutex around the call. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/policy.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/hwt

[QUEUED v0 11/19] intel_th: Depend on HAS_IOMEM

2016-02-05 Thread Alexander Shishkin
This driver requires io memory to operate, so don't even consider it for NO_IOMEM architectures. Reported-by: Richard Weinberger Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtr

[QUEUED v0 05/19] stm class: Fix link list locking

2016-02-05 Thread Alexander Shishkin
that bits that might_sleep() are called with a mutex held instead. Modification of this list requires both mutex and spinlock to be held, while looking at the list can be done under either mutex or spinlock. Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c

[QUEUED v0 06/19] stm class: Fix an off-by-one in master array allocation

2016-02-05 Thread Alexander Shishkin
-by: Chunyan Zhang [alexander.shish...@linux.intel.com: re-wrote the commit message] Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index ddcb606ace

[QUEUED v0 10/19] stm class: Use a signed return type for stm_find_master_chan

2016-02-05 Thread Alexander Shishkin
From: Lucas Tanure The return type "unsigned int" was used by the stm_find_master_chan function despite of the aspect that it will eventually return a negative error code. Done with the help of Coccinelle. Signed-off-by: Lucas Tanure Signed-off-by: Alexander Shishkin --- drivers

[QUEUED v0 02/19] intel_th: INTEL_TH should depend on HAS_DMA

2016-02-05 Thread Alexander Shishkin
ntel_th/intel_th.ko] undefined! Add a dependency on HAS_DMA to fix this. Signed-off-by: Geert Uytterhoeven Signed-off-by: Alexander Shishkin --- drivers/hwtracing/intel_th/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwtracing/intel_th/Kconfig b/drivers/hwtracing/int

[QUEUED v0 01/19] stm class: Hide STM-specific options if STM is disabled

2016-02-05 Thread Alexander Shishkin
From: Geert Uytterhoeven If STM=n, it doesn't make sense to ask about STM_DUMMY and STM_SOURCE_CONSOLE support, which are not even built when enabled anyway. Hence hide these options if STM=n. Reported-by: Linus Torvalds Signed-off-by: Geert Uytterhoeven Signed-off-by: Alexander Shi

[QUEUED v0 00/19] stm class/intel_th: Patches in my queue

2016-02-05 Thread Alexander Shishkin
still here. Should I set up a git tree for this somewhere? Alexander Shishkin (14): stm class: Fix locking in unbinding policy path stm class: Fix link list locking stm class: Prevent user-controllable allocations intel_th: pci: Add Apollo Lake SOC support intel_th: pci: Add Broxton S

Re: [PATCH 08/22] hwtracing: Fix dependencies for !HAS_IOMEM archs

2016-02-05 Thread Alexander Shishkin
Richard Weinberger writes: > Not every arch has io memory. > So, unbreak the build by fixing the dependencies. > > Signed-off-by: Richard Weinberger > --- > drivers/hwtracing/intel_th/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/hwtracing/intel_th/Kconfig > b/driver

Re: [PATCH] stm class: Use a signed return type for stm_find_master_chan

2016-02-05 Thread Alexander Shishkin
Lucas Tanure writes: > The return type "unsigned int" was used by the stm_find_master_chan function > despite of the aspect that it will eventually return a negative error code. > > Done with the help of Coccinelle. > > Signed-off-by: Lucas Tanure Applied to my queue, thank you! Regards, -- Al

Re: [PATCH V2 6/6] coresight-stm: adding driver for CoreSight STM component

2016-02-05 Thread Alexander Shishkin
Chunyan Zhang writes: > +#ifndef CONFIG_64BIT > +static inline void __raw_writeq(u64 val, volatile void __iomem *addr) > +{ > + asm volatile("strd %1, %0" > + : "+Qo" (*(volatile u64 __force *)addr) > + : "r" (val)); > +} Is it really ok to do this for all !

Re: [PATCH V2 1/6] stm class: Add ioctl get_options interface

2016-02-05 Thread Alexander Shishkin
Chunyan Zhang writes: > There is already an interface of set_options, but no get_options yet. > Before setting any options, one would may want to see the current > status of that option by means of get_options interface. This > interface has been used in CoreSight STM driver. > > Signed-off-by: C

Re: [PATCH V2 3/6] stm class: provision for statically assigned masterIDs

2016-02-05 Thread Alexander Shishkin
Chunyan Zhang writes: > From: Mathieu Poirier > > Some architecture like ARM assign masterIDs statically at the HW design > phase, making masterID manipulation in the generic STM core irrelevant. > > This patch adds a new 'mstatic' flag to struct stm_data that tells the > core that this specific

Re: [PATCH V2 2/6] stm class: adds a loop to extract the first valid STM device name

2016-02-04 Thread Alexander Shishkin
RR_PTR(-ENODEV); > + kfree(devname); In the existing code there is a clear distinction between -ENODEV, which is to say "we didn't find the device" and -EINVAL, "directory name breaks rules/is badly formatted". After the change, it's all -EINVAL, which also become

Re: [PATCH V8 18/23] coresight: etm-perf: new PMU driver for ETM tracers

2016-01-28 Thread Alexander Shishkin
Mathieu Poirier writes: >> I'd like to understand all the potential failures here, because it's >> really a good idea to keep those to a minimum for the sake of >> consistency. That is, if the user succeeded in creating an event, about >> the only good reason for the event not starting is a fille

Re: [PATCH v6] kernel: add kcov code coverage

2016-01-28 Thread Alexander Shishkin
Dmitry Vyukov writes: > + fd = open("/sys/kernel/debug/kcov", O_RDWR); > + if (fd == -1) > + perror("open"), exit(1); > + /* Setup trace mode and trace size. */ > + if (ioctl(fd, KCOV_INIT_TRACE, COVER_SIZE)) > + perror("ioctl"), exit(1); > + /* Mmap bu

Re: [PATCH v2 2/2] intel_th: the number of masters should be (sw_end - sw_start + 1)

2016-01-28 Thread Alexander Shishkin
Chunyan Zhang writes: > Hi Alex, Hi chunyan, > Is there any problem on this patch, I noticed that you lost this patch > when you sent a patchset to Greg for 4.4 merge. No, there isn't, it just doesn't fix anything important to be sent outside of merge window, but the other one does. I'll queue

Re: [PATCH V8 16/23] coresight: etb10: implementing AUX API

2016-01-26 Thread Alexander Shishkin
Mathieu Poirier writes: > Adding an ETB10 specific AUX area operations to be used > by the perf framework when events are initialised. > > Part of this operation involves modeling the mmap'ed area > based on the specific ways a sink buffer gathers information. I don't mind being CC'd on the rest

Re: [PATCH V8 18/23] coresight: etm-perf: new PMU driver for ETM tracers

2016-01-26 Thread Alexander Shishkin
Mathieu Poirier writes: > +static int etm_event_init(struct perf_event *event) > +{ > + if (event->attr.type != etm_pmu.type) > + return -ENOENT; > + > + if (event->cpu >= nr_cpu_ids) > + return -EINVAL; perf_event_alloc() already does this. Except for this one do

Re: [PATCH] stm: add proper dependencies on the subsystem

2016-01-25 Thread Alexander Shishkin
Arnd Bergmann writes: > As several people have pointed out, the Kconfig dependencies for > stm are confusing, because you can enable the individual features > even when the subsystem itself is disabled. > > It turns out that randconfig tests even show the a build-time > bug because of this: > > d

Re: [PATCH v2] perf: Synchronously cleanup child events

2016-01-22 Thread Alexander Shishkin
Peter Zijlstra writes: > So I think there's a number of problems still :-( Also, it does indeed race with __perf_event_exit_task()/sync_child_event(), but that one I'd fix by simply wrapping the sync_child_event()/free_event() in mutex_lock(&parent_event->child_mutex); if (!is_orphan_event(pare

[tip:perf/urgent] perf: Synchronously free aux pages in case of allocation failure

2016-01-21 Thread tip-bot for Alexander Shishkin
Commit-ID: 45c815f06b80031659c63d7b93e580015d6024dd Gitweb: http://git.kernel.org/tip/45c815f06b80031659c63d7b93e580015d6024dd Author: Alexander Shishkin AuthorDate: Tue, 19 Jan 2016 17:14:29 +0200 Committer: Ingo Molnar CommitDate: Thu, 21 Jan 2016 18:54:27 +0100 perf: Synchronously

[PATCH v3 6/9] stm class: Fix an off-by-one in master array allocation

2015-12-22 Thread Alexander Shishkin
-by: Chunyan Zhang [alexander.shish...@linux.intel.com: re-wrote the commit message] Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index ddcb606ace

<    4   5   6   7   8   9   10   11   12   13   >