coresight: etf: Release CLAIM tag after disabling the HW
authorMathieu Poirier <mathieu.poirier@linaro.org>
Fri, 30 Nov 2018 18:43:04 +0000 (11:43 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Dec 2018 14:41:55 +0000 (15:41 +0100)
This patch rectifies the sequence of events in function
tmc_etb_disable_hw() by disabling the HW first and then releasing the
CLAIM tag.  Otherwise we could be corrupting the configuration done by an
external agent that would have claimed the device after we have released
it.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-tmc-etf.c

index 5864ac55e275b98b0334f1d277c6d4332a648671..a5f053f2db2c531c39d9b7a58b83f789d3c655b1 100644 (file)
@@ -86,8 +86,8 @@ static void __tmc_etb_disable_hw(struct tmc_drvdata *drvdata)
 
 static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata)
 {
-       coresight_disclaim_device(drvdata->base);
        __tmc_etb_disable_hw(drvdata);
+       coresight_disclaim_device(drvdata->base);
 }
 
 static void __tmc_etf_enable_hw(struct tmc_drvdata *drvdata)