From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751254AbdAMRLp (ORCPT ); Fri, 13 Jan 2017 12:11:45 -0500 Received: from foss.arm.com ([217.140.101.70]:51506 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751008AbdAMRLn (ORCPT ); Fri, 13 Jan 2017 12:11:43 -0500 Subject: Re: [PATCH] coresight: STM: Balance enable/disable To: Mathieu Poirier , Greg KH References: <1484047315-14407-1-git-send-email-suzuki.poulose@arm.com> Cc: Chunyan Zhang , Pratik Patel , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "# 4 . 7" From: Suzuki K Poulose Message-ID: Date: Fri, 13 Jan 2017 17:11:39 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/01/17 16:48, Mathieu Poirier wrote: > On 10 January 2017 at 04:21, Suzuki K Poulose 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 >> Cc: Mathieu Poirier >> Cc: Chunyan Zhang >> Cc: Greg Kroah-Hartman >> Cc: stable@vger.kernel.org # 4.7+ >> Reported-by: Robert Walker >> Signed-off-by: Suzuki K Poulose >> --- >> 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. Suzuki > Mathieu > >> -- >> 2.7.4 >> From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com ([217.140.101.70]:51506 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751008AbdAMRLn (ORCPT ); Fri, 13 Jan 2017 12:11:43 -0500 Subject: Re: [PATCH] coresight: STM: Balance enable/disable To: Mathieu Poirier , Greg KH References: <1484047315-14407-1-git-send-email-suzuki.poulose@arm.com> Cc: Chunyan Zhang , Pratik Patel , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "# 4 . 7" From: Suzuki K Poulose Message-ID: Date: Fri, 13 Jan 2017 17:11:39 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 13/01/17 16:48, Mathieu Poirier wrote: > On 10 January 2017 at 04:21, Suzuki K Poulose 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 >> Cc: Mathieu Poirier >> Cc: Chunyan Zhang >> Cc: Greg Kroah-Hartman >> Cc: stable@vger.kernel.org # 4.7+ >> Reported-by: Robert Walker >> Signed-off-by: Suzuki K Poulose >> --- >> 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. Suzuki > Mathieu > >> -- >> 2.7.4 >> From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suzuki.Poulose@arm.com (Suzuki K Poulose) Date: Fri, 13 Jan 2017 17:11:39 +0000 Subject: [PATCH] coresight: STM: Balance enable/disable In-Reply-To: References: <1484047315-14407-1-git-send-email-suzuki.poulose@arm.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 13/01/17 16:48, Mathieu Poirier wrote: > On 10 January 2017 at 04:21, Suzuki K Poulose 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 >> Cc: Mathieu Poirier >> Cc: Chunyan Zhang >> Cc: Greg Kroah-Hartman >> Cc: stable at vger.kernel.org # 4.7+ >> Reported-by: Robert Walker >> Signed-off-by: Suzuki K Poulose >> --- >> 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. Suzuki > Mathieu > >> -- >> 2.7.4 >>