Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions drivers/hwtracing/coresight/coresight-catu.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,14 @@ static int catu_platform_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = __catu_probe(&pdev->dev, res);
pm_runtime_put(&pdev->dev);
if (ret)
if (ret) {
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}

return ret;
pm_runtime_put(&pdev->dev);
return 0;
}

static void catu_platform_remove(struct platform_device *pdev)
Expand All @@ -648,8 +651,16 @@ static void catu_platform_remove(struct platform_device *pdev)
if (WARN_ON(!drvdata))
return;

/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
__catu_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}

#ifdef CONFIG_PM
Expand Down
8 changes: 8 additions & 0 deletions drivers/hwtracing/coresight/coresight-cpu-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,16 @@ static void debug_platform_remove(struct platform_device *pdev)
if (WARN_ON(!drvdata))
return;

/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
__debug_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}

#ifdef CONFIG_ACPI
Expand Down
17 changes: 14 additions & 3 deletions drivers/hwtracing/coresight/coresight-ctcu-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,14 @@ static int ctcu_platform_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = ctcu_probe(pdev);
pm_runtime_put(&pdev->dev);
if (ret)
if (ret) {
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}

return ret;
pm_runtime_put(&pdev->dev);
return 0;
}

static void ctcu_platform_remove(struct platform_device *pdev)
Expand All @@ -333,8 +336,16 @@ static void ctcu_platform_remove(struct platform_device *pdev)
if (WARN_ON(!drvdata))
return;

/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
ctcu_remove(pdev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}

#ifdef CONFIG_PM
Expand Down
23 changes: 17 additions & 6 deletions drivers/hwtracing/coresight/coresight-etm4x-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2355,12 +2355,14 @@ static int etm4_probe_platform_dev(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = etm4_probe(&pdev->dev);

pm_runtime_put(&pdev->dev);
if (ret)
if (ret) {
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}

return ret;
pm_runtime_put(&pdev->dev);
return 0;
}

static int etm4_probe_cpu(unsigned int cpu)
Expand Down Expand Up @@ -2450,9 +2452,18 @@ static void etm4_remove_platform_dev(struct platform_device *pdev)
{
struct etmv4_drvdata *drvdata = dev_get_drvdata(&pdev->dev);

if (drvdata)
etm4_remove_dev(drvdata);
if (WARN_ON(!drvdata))
return;
/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
etm4_remove_dev(drvdata);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}

static const struct amba_id etm4_ids[] = {
Expand Down
17 changes: 14 additions & 3 deletions drivers/hwtracing/coresight/coresight-funnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,14 @@ static int funnel_platform_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = funnel_probe(&pdev->dev, res);
pm_runtime_put(&pdev->dev);
if (ret)
if (ret) {
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}

return ret;
pm_runtime_put(&pdev->dev);
return 0;
}

static void funnel_platform_remove(struct platform_device *pdev)
Expand All @@ -491,8 +494,16 @@ static void funnel_platform_remove(struct platform_device *pdev)
if (WARN_ON(!drvdata))
return;

/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
funnel_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}

static const struct of_device_id funnel_match[] = {
Expand Down
17 changes: 14 additions & 3 deletions drivers/hwtracing/coresight/coresight-replicator.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,14 @@ static int replicator_platform_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = replicator_probe(&pdev->dev, res);
pm_runtime_put(&pdev->dev);
if (ret)
if (ret) {
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}

return ret;
pm_runtime_put(&pdev->dev);
return 0;
}

static void replicator_platform_remove(struct platform_device *pdev)
Expand All @@ -544,8 +547,16 @@ static void replicator_platform_remove(struct platform_device *pdev)
if (WARN_ON(!drvdata))
return;

/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
replicator_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}

#ifdef CONFIG_PM
Expand Down
17 changes: 14 additions & 3 deletions drivers/hwtracing/coresight/coresight-stm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,11 +1013,14 @@ static int stm_platform_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = __stm_probe(&pdev->dev, res);
pm_runtime_put(&pdev->dev);
if (ret)
if (ret) {
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}

return ret;
pm_runtime_put(&pdev->dev);
return 0;
}

static void stm_platform_remove(struct platform_device *pdev)
Expand All @@ -1027,8 +1030,16 @@ static void stm_platform_remove(struct platform_device *pdev)
if (WARN_ON(!drvdata))
return;

/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
__stm_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}

#ifdef CONFIG_ACPI
Expand Down
18 changes: 15 additions & 3 deletions drivers/hwtracing/coresight/coresight-tmc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,11 +1209,14 @@ static int tmc_platform_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = __tmc_probe(&pdev->dev, res);
pm_runtime_put(&pdev->dev);
if (ret)
if (ret) {
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}

return ret;
pm_runtime_put(&pdev->dev);
return 0;
}

static void tmc_platform_remove(struct platform_device *pdev)
Expand All @@ -1222,8 +1225,17 @@ static void tmc_platform_remove(struct platform_device *pdev)

if (WARN_ON(!drvdata))
return;

/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
__tmc_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}

#ifdef CONFIG_PM
Expand Down
17 changes: 14 additions & 3 deletions drivers/hwtracing/coresight/coresight-tnoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,30 @@ static int tnoc_platform_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = _tnoc_probe(&pdev->dev, res);
pm_runtime_put(&pdev->dev);
if (ret)
if (ret) {
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}

return ret;
pm_runtime_put(&pdev->dev);
return 0;
}

static void tnoc_platform_remove(struct platform_device *pdev)
{
struct trace_noc_drvdata *drvdata = platform_get_drvdata(pdev);

/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
coresight_unregister(drvdata->csdev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
if (drvdata->atid > 0)
coresight_trace_id_put_system_id(drvdata->atid);
}
Expand Down
17 changes: 14 additions & 3 deletions drivers/hwtracing/coresight/coresight-tpiu.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,14 @@ static int tpiu_platform_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = __tpiu_probe(&pdev->dev, res);
pm_runtime_put(&pdev->dev);
if (ret)
if (ret) {
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}

return ret;
pm_runtime_put(&pdev->dev);
return 0;
}

static void tpiu_platform_remove(struct platform_device *pdev)
Expand All @@ -287,8 +290,16 @@ static void tpiu_platform_remove(struct platform_device *pdev)
if (WARN_ON(!drvdata))
return;

/*
* Resume the device so its clocks are enabled again, balancing the
* clk_disable_unprepare() that devm runs when the driver detaches.
* Then mark it suspended and drop the usage count taken here.
*/
pm_runtime_get_sync(&pdev->dev);
__tpiu_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}

#ifdef CONFIG_ACPI
Expand Down
Loading