Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1634282
| From | Leo Yan <leo.yan@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v7 5/7] coresight: add support for CPU debug module |
| Date | 2017-05-02 11:30 +0200 |
| Message-ID | <tCCi6-4Jn-13@gated-at.bofh.it> (permalink) |
| References | <tCBvH-49u-7@gated-at.bofh.it> <tCBvH-49u-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v7 5/7] coresight: add support for CPU debug module Leo Yan <leo.yan@linaro.org> - 2017-05-02 10:40 +0200 Re: [PATCH v7 5/7] coresight: add support for CPU debug module Leo Yan <leo.yan@linaro.org> - 2017-05-02 11:30 +0200
csiph-web