On 13 January 2017 at 10:11, Suzuki K Poulose <suzuki.poul...@arm.com> wrote: > On 13/01/17 16:48, Mathieu Poirier wrote: >> >> On 10 January 2017 at 04:21, Suzuki K Poulose <suzuki.poul...@arm.com> >> wrote: >>> >>> The stm is automatically enabled when an application sets the policy >>> via ->link() call back by using coresight_enable(), which keeps the >>> refcount of the current users of the STM. However, the unlink() callback >>> issues stm_disable() directly, which leaves the STM turned off, without >>> the coresight layer knowing about it. This prevents any further uses >>> of the STM hardware as the coresight layer still thinks the STM is >>> turned on and doesn't issue an stm_enable(). Even manually enabling >>> the STM via sysfs can't really enable the hw. >>> > ... >>> >>> >>> This patch balances the unlink operation by using the >>> coresight_disable(), >>> keeping the coresight layer in sync with the hardware state. >>> >>> Fixes: commit 237483aa5cf43 ("coresight: stm: adding driver for CoreSight >>> STM component") >>> Cc: Pratik Patel <prat...@codeaurora.org> >>> Cc: Mathieu Poirier <mathieu.poir...@linaro.org> >>> Cc: Chunyan Zhang <zhang.chun...@linaro.org> >>> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> >>> Cc: sta...@vger.kernel.org # 4.7+ >>> Reported-by: Robert Walker <robert.wal...@arm.com> >>> Signed-off-by: Suzuki K Poulose <suzuki.poul...@arm.com> >>> --- >>> drivers/hwtracing/coresight/coresight-stm.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/hwtracing/coresight/coresight-stm.c >>> b/drivers/hwtracing/coresight/coresight-stm.c >>> index 3524452..57b7330 100644 >>> --- a/drivers/hwtracing/coresight/coresight-stm.c >>> +++ b/drivers/hwtracing/coresight/coresight-stm.c >>> @@ -356,7 +356,7 @@ static void stm_generic_unlink(struct stm_data >>> *stm_data, >>> if (!drvdata || !drvdata->csdev) >>> return; >>> >>> - stm_disable(drvdata->csdev, NULL); >>> + coresight_disable(drvdata->csdev); >>> } >>> >>> static phys_addr_t >> >> >> Applied - thanks, > > > Mathieu, Greg, > > I think this should go into 4.10 (either way, as fix in this cycle or via > stable after the release). I think > it would be easier if it goes in as fix during one of these rc cycle. > > Please let me know your thoughts.
I'm good with squeezing this patch in the 4.10 cycle. From here I suppose the easiest for Greg is for you to send another patch with Chunyan's Reviewed-by and my ack. > > Suzuki > >> Mathieu >> >>> -- >>> 2.7.4 >>> >