Revert "coresight: cti: Fix hang in cti_disable_hw()"
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 06:32:39 +0000 (08:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 06:33:45 +0000 (08:33 +0200)
This reverts commit 665c157e0204176023860b51a46528ba0ba62c33.

It causes reported build warnings:

drivers/hwtracing/coresight/coresight-cti-core.c: In functio
n 'cti_enable_hw':
drivers/hwtracing/coresight/coresight-cti-core.c:93:24: warning: unused variable 'dev' [-Wunused-variable]
   93 |         struct device *dev = &drvdata->csdev->dev;
      |                        ^~~
drivers/hwtracing/coresight/coresight-cti-core.c: In function 'cti_disable_hw':
drivers/hwtracing/coresight/coresight-cti-core.c:154:24: warning: unused variable 'dev' [-Wunused-variable]
  154 |         struct device *dev = &drvdata->csdev->dev;
      |                        ^~~

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Aishwarya TCV <Aishwarya.TCV@arm.com>
Cc: Cristian Marussi <Cristian.Marussi@arm.com>
Cc: Suzuki Poulose <Suzuki.Poulose@arm.com>
Cc: James Clark <james.clark@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Fixes: 665c157e0204 ("coresight: cti: Fix hang in cti_disable_hw()")
Link: https://lore.kernel.org/r/20221024135752.2b83af97@canb.auug.org.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-cti-core.c

index 4a02ae2..1be9234 100644 (file)
@@ -94,6 +94,7 @@ static int cti_enable_hw(struct cti_drvdata *drvdata)
        unsigned long flags;
        int rc = 0;
 
+       pm_runtime_get_sync(dev->parent);
        spin_lock_irqsave(&drvdata->spinlock, flags);
 
        /* no need to do anything if enabled or unpowered*/
@@ -118,6 +119,7 @@ cti_state_unchanged:
        /* cannot enable due to error */
 cti_err_not_enabled:
        spin_unlock_irqrestore(&drvdata->spinlock, flags);
+       pm_runtime_put(dev->parent);
        return rc;
 }
 
@@ -173,6 +175,7 @@ static int cti_disable_hw(struct cti_drvdata *drvdata)
        coresight_disclaim_device_unlocked(csdev);
        CS_LOCK(drvdata->base);
        spin_unlock(&drvdata->spinlock);
+       pm_runtime_put(dev->parent);
        return 0;
 
        /* not disabled this call */