From: Leo Yan <leo.yan@linaro.org>
To: Jonathan Corbet <corbet@lwn.net>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Wei Xu <xuwei5@hisilicon.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Andy Gross <andy.gross@linaro.org>,
David Brown <david.brown@linaro.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Stephen Boyd <sboyd@codeaurora.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
Mike Leach <mike.leach@linaro.org>,
Sudeep Holla <sudeep.holla@arm.com>
Subject: Re: [PATCH v7 5/7] coresight: add support for CPU debug module
Date: Tue, 2 May 2017 17:20:18 +0800 [thread overview]
Message-ID: <20170502092018.GB20225@leoy-ThinkPad-T440> (raw)
In-Reply-To: <1493713805-26920-6-git-send-email-leo.yan@linaro.org>
On Tue, May 02, 2017 at 04:30:03PM +0800, Leo Yan wrote:
[...]
> +static void debug_force_cpu_powered_up(struct debug_drvdata *drvdata)
> +{
> + u32 edprcr;
> +
> +try_again:
> +
> + /*
> + * Send request to power management controller and assert
> + * DBGPWRUPREQ signal; if power management controller has
> + * sane implementation, it should enable CPU power domain
> + * in case CPU is in low power state.
> + */
> + edprcr = readl_relaxed(drvdata->base + EDPRCR);
> + edprcr |= EDPRCR_COREPURQ;
> + writel_relaxed(edprcr, drvdata->base + EDPRCR);
> +
> + /* Wait for CPU to be powered up (timeout~=32ms) */
> + if (readx_poll_timeout_atomic(readl_relaxed, drvdata->base + EDPRSR,
> + drvdata->edprsr, (drvdata->edprsr & EDPRSR_PU),
> + DEBUG_WAIT_SLEEP, DEBUG_WAIT_TIMEOUT)) {
> + /*
> + * Unfortunately the CPU cannot be powered up, so return
> + * back and later has no permission to access other
> + * registers. For this case, should disable CPU low power
> + * states to ensure CPU power domain is enabled!
> + */
> + pr_err("%s: power up request for CPU%d failed\n",
> + __func__, drvdata->cpu);
> + return;
> + }
> +
> + /*
> + * At this point the CPU is powered up, so set the no powerdown
> + * request bit so we don't lose power and emulate power down.
> + */
> + edprcr = readl_relaxed(drvdata->base + EDPRCR);
> + edprcr |= EDPRCR_COREPURQ | EDPRCR_CORENPDRQ;
> + writel_relaxed(edprcr, drvdata->base + EDPRCR);
> +
> + drvdata->edprsr = readl_relaxed(drvdata->base + EDPRSR);
> +
> + /* The core power domain got switched off on use, try again */
> + if (unlikely(!drvdata->edprsr & EDPRSR_PU))
Here have error introduced by operator priority. Should change to
if (unlikely(!(drvdata->edprsr & EDPRSR_PU)))
Will send new version soon for this fixing.
> + goto try_again;
> +}
[...]
Thanks,
Leo Yan
next prev parent reply other threads:[~2017-05-02 9:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 8:29 [PATCH v7 0/7] coresight: enable debug module Leo Yan
2017-05-02 8:29 ` [PATCH v7 1/7] coresight: bindings for CPU " Leo Yan
2017-05-02 8:30 ` [PATCH v7 2/7] doc: Add documentation for Coresight CPU debug Leo Yan
2017-05-02 8:30 ` [PATCH v7 3/7] coresight: of_get_coresight_platform_data: Add missing of_node_put Leo Yan
2017-05-02 8:30 ` [PATCH v7 4/7] coresight: refactor with function of_coresight_get_cpu Leo Yan
2017-05-02 8:30 ` [PATCH v7 5/7] coresight: add support for CPU debug module Leo Yan
2017-05-02 9:20 ` Leo Yan [this message]
2017-05-02 8:30 ` [PATCH v7 6/7] arm64: dts: hi6220: register " Leo Yan
2017-05-02 8:30 ` [PATCH v7 7/7] arm64: dts: qcom: msm8916: Add debug unit 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=20170502092018.GB20225@leoy-ThinkPad-T440 \
--to=leo.yan@linaro.org \
--cc=andy.gross@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=david.brown@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.org \
--cc=sudeep.holla@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=will.deacon@arm.com \
--cc=xuwei5@hisilicon.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;
as well as URLs for NNTP newsgroup(s).