intel_th: Wait until port is in reset before programming it
[ Upstream commit ab1afed701d2db7eb35c1a2526a29067a38e93d1 ] Some devices don't drain their pipelines if we don't make sure that the corresponding output port is in reset before programming it for a new trace capture, resulting in bits of old trace appearing in the new trace capture. Fix that by explicitly making sure the reset is asserted before programming new trace capture. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Link: https://lore.kernel.org/r/20210621151246.31891-5-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
45f1de1fff
commit
9c6c657047
@@ -564,6 +564,21 @@ static void gth_tscu_resync(struct gth_device *gth)
|
||||
iowrite32(reg, gth->base + REG_TSCU_TSUCTRL);
|
||||
}
|
||||
|
||||
static void intel_th_gth_prepare(struct intel_th_device *thdev,
|
||||
struct intel_th_output *output)
|
||||
{
|
||||
struct gth_device *gth = dev_get_drvdata(&thdev->dev);
|
||||
int count;
|
||||
|
||||
/*
|
||||
* Wait until the output port is in reset before we start
|
||||
* programming it.
|
||||
*/
|
||||
for (count = GTH_PLE_WAITLOOP_DEPTH;
|
||||
count && !(gth_output_get(gth, output->port) & BIT(5)); count--)
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
/**
|
||||
* intel_th_gth_enable() - enable tracing to an output device
|
||||
* @thdev: GTH device
|
||||
@@ -815,6 +830,7 @@ static struct intel_th_driver intel_th_gth_driver = {
|
||||
.assign = intel_th_gth_assign,
|
||||
.unassign = intel_th_gth_unassign,
|
||||
.set_output = intel_th_gth_set_output,
|
||||
.prepare = intel_th_gth_prepare,
|
||||
.enable = intel_th_gth_enable,
|
||||
.trig_switch = intel_th_gth_switch,
|
||||
.disable = intel_th_gth_disable,
|
||||
|
Reference in New Issue
Block a user