From: Marc Zyngier <marc.zyngier@arm.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: tglx@linutronix.de, jason@lakedaemon.net,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
rnayak@codeaurora.org, bjorn.andersson@linaro.org,
sboyd@kernel.org
Subject: Re: [PATCH] irqchip/gic-v3: do not access GICR_WAKER if its secured register.
Date: Tue, 12 Jun 2018 17:34:03 +0100 [thread overview]
Message-ID: <86d0ww7ymc.wl-marc.zyngier@arm.com> (raw)
In-Reply-To: <20180612145516.30897-1-srinivas.kandagatla@linaro.org>
On Tue, 12 Jun 2018 15:55:16 +0100,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org> wrote:
>
> GICR_WAKER can be a secured register, check this before accessing it
> as its done in power management code.
NAK.
From the GICv3 spec:
* When GICD_CTLR.DS==1, this register is always accessible.
* When GICD_CTLR.DS==0, this is a Secure register. This register is
RAZ/WI to Non-secure accesses.
> Without this patch Qualcomm DB820c board crashes.
I suggest you find out how the GIC has been integrated on this
platform. If you take a fault on accessing this register, this very
much looks like an integration bug, and it should be quirked as such.
Thanks,
M.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> drivers/irqchip/irq-gic-v3.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index 5a67ec084588..38136d6e9ca5 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -656,6 +656,12 @@ static int gic_dist_supports_lpis(void)
> return !!(readl_relaxed(gic_data.dist_base + GICD_TYPER) & GICD_TYPER_LPIS) && !gicv3_nolpi;
> }
>
> +/* Check whether it's single security state view */
> +static bool gic_dist_security_disabled(void)
> +{
> + return readl_relaxed(gic_data.dist_base + GICD_CTLR) & GICD_CTLR_DS;
> +}
> +
> static void gic_cpu_init(void)
> {
> void __iomem *rbase;
> @@ -664,7 +670,8 @@ static void gic_cpu_init(void)
> if (gic_populate_rdist())
> return;
>
> - gic_enable_redist(true);
> + if (gic_dist_security_disabled())
> + gic_enable_redist(true);
>
> rbase = gic_data_rdist_sgi_base();
>
> @@ -819,11 +826,6 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
> #endif
>
> #ifdef CONFIG_CPU_PM
> -/* Check whether it's single security state view */
> -static bool gic_dist_security_disabled(void)
> -{
> - return readl_relaxed(gic_data.dist_base + GICD_CTLR) & GICD_CTLR_DS;
> -}
>
> static int gic_cpu_pm_notifier(struct notifier_block *self,
> unsigned long cmd, void *v)
> --
> 2.16.2
>
--
Jazz is not dead, it just smell funny.
next prev parent reply other threads:[~2018-06-12 16:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 14:55 Srinivas Kandagatla
2018-06-12 15:24 ` Sudeep Holla
2018-06-12 15:51 ` Srinivas Kandagatla
2018-06-12 16:34 ` Marc Zyngier [this message]
2018-06-13 8:21 ` Srinivas Kandagatla
2018-06-13 8:45 ` Sudeep Holla
2018-06-13 10:53 ` Srinivas Kandagatla
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=86d0ww7ymc.wl-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=bjorn.andersson@linaro.org \
--cc=jason@lakedaemon.net \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rnayak@codeaurora.org \
--cc=sboyd@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®