summaryrefslogtreecommitdiff
path: root/drivers/hwtracing/intel_th/gth.c
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2019-05-03 11:44:46 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-03 18:16:21 +0200
commit8d4155126e32fdceda7e1520e77a7beac2217f4a (patch)
tree8578bb0285afc60adaed2f1f8b7de4dace2c4097 /drivers/hwtracing/intel_th/gth.c
parentba39bd8306057fb343dfb75d93a76d824b625236 (diff)
intel_th: msu: Factor out pipeline draining
The code that waits for the pipeline empty condition of the MSU is currently called in the path that disables the trace. We will also need this in the window switch trigger sequence. Therefore, factor out this code and make it accessible to the GTH device. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/intel_th/gth.c')
-rw-r--r--drivers/hwtracing/intel_th/gth.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/hwtracing/intel_th/gth.c b/drivers/hwtracing/intel_th/gth.c
index edc52d75e6bd..7e6b70047125 100644
--- a/drivers/hwtracing/intel_th/gth.c
+++ b/drivers/hwtracing/intel_th/gth.c
@@ -469,6 +469,10 @@ static void intel_th_gth_disable(struct intel_th_device *thdev,
struct intel_th_output *output)
{
struct gth_device *gth = dev_get_drvdata(&thdev->dev);
+ struct intel_th_device *outdev =
+ container_of(output, struct intel_th_device, output);
+ struct intel_th_driver *outdrv =
+ to_intel_th_driver(outdev->dev.driver);
unsigned long count;
int master;
u32 reg;
@@ -492,6 +496,9 @@ static void intel_th_gth_disable(struct intel_th_device *thdev,
cpu_relax();
}
+ if (outdrv->wait_empty)
+ outdrv->wait_empty(outdev);
+
/* clear force capture done for next captures */
iowrite32(0xfc, gth->base + REG_GTH_SCR2);