Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Jie Gan <jie.gan@oss.qualcomm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@arm.com>,
	James Clark <james.clark@linaro.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Yeoreum Yun <yeoreum.yun@arm.com>,
	Yuanfang Zhang <yuanfang.zhang@oss.qualcomm.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Tingwei Zhang <tingwei.zhang@oss.qualcomm.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH v2 1/2] coresight: Fix clock refcount imbalance on platform remove
Date: Thu, 9 Jul 2026 16:24:10 +0100	[thread overview]
Message-ID: <20260709152410.GE1024232@e132581.arm.com> (raw)
In-Reply-To: <20260702-fix-clock-refcount-unbalance-v2-1-2383fbb9952e@oss.qualcomm.com>

On Thu, Jul 02, 2026 at 04:54:19PM +0800, Jie Gan wrote:

[...]

>  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);

I understood this is not an issue caused by this patch, could you refine
a bit as blow so can be consistent:

        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);
>  }

With above change:

Reviewed-by: Leo Yan <leo.yan@arm.com>


  reply	other threads:[~2026-07-09 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02  8:54 [PATCH v2 0/2] fix clock refcount imbalance for all Coresight platform drivers Jie Gan
2026-07-02  8:54 ` [PATCH v2 1/2] coresight: Fix clock refcount imbalance on platform remove Jie Gan
2026-07-09 15:24   ` Leo Yan [this message]
2026-07-10  8:03     ` Jie Gan
2026-07-02  8:54 ` [PATCH v2 2/2] coresight: tnoc: " Jie Gan
2026-07-09 15:27   ` Leo Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260709152410.GE1024232@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=anshuman.khandual@arm.com \
    --cc=coresight@lists.linaro.org \
    --cc=james.clark@linaro.org \
    --cc=jie.gan@oss.qualcomm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mike.leach@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tingwei.zhang@oss.qualcomm.com \
    --cc=yeoreum.yun@arm.com \
    --cc=yuanfang.zhang@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox