[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0jnzse4sG58taO5+Yd5vCgh1uddqbtAuim_z9r15Q3BA@mail.gmail.com>
Date: Thu, 31 Mar 2022 17:44:55 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: Hitomi Hasegawa <hasegawa-hitomi@...itsu.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
SoC Team <soc@...nel.org>,
"open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
Sumit Garg <sumit.garg@...aro.org>,
Arnd Bergmann <arnd@...db.de>, Olof Johansson <olof@...om.net>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Jiri Slaby <jirislaby@...nel.org>,
Jason Wessel <jason.wessel@...driver.com>,
Daniel Thompson <daniel.thompson@...aro.org>,
Doug Anderson <dianders@...omium.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
kgdb-bugreport@...ts.sourceforge.net,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v3 1/1] soc: fujitsu: Add A64FX diagnostic interrupt driver
On Thu, Mar 31, 2022 at 1:49 PM Greg KH <gregkh@...uxfoundation.org> wrote:
> > +
> > +static irqreturn_t a64fx_diag_handler(int irq, void *dev_id)
> > +{
> > + handle_sysrq('c');
>
>
> Why is this calling this sysrq call? From an interrupt? Why?
>
> And you are hard-coding "c", are you sure?
This is an actual sysrq driver in the traditional sense, where you can send
a single interrupt to the machine from the outside over a side channel.
I suggested sysrq instead of just panic() to make it a bit more flexible.
Unfortunately there is no additional data, so it comes down to always
sending the same character.
It would be possible to make that character configurable with a module
parameter or something like that, but I'm not sure that is an improvement.
Maybe you have another idea for this.
> > +static void a64fx_diag_interrupt_clear(struct a64fx_diag_priv *priv)
> > +{
> > + u32 mmsc;
> > + const void __iomem *diag_status_reg_addr;
> > +
> > + diag_status_reg_addr = priv->mmsc_reg_base + BMC_DIAG_INTERRUPT_STATUS_OFFSET;
> > + mmsc = readl(diag_status_reg_addr);
> > + if (mmsc & BMC_INTERRUPT_STATUS_MASK)
> > + writel(BMC_INTERRUPT_STATUS_MASK, (void *)diag_status_reg_addr);
>
> No need to wait for the write to complete?
>
> You shouldn't have to cast diag_status_reg_addr, right?
I think the cast is needed because the declaration of
'diag_status_reg_addr' incorrectly
marks it as 'const'. However, this should still trigger a 'make C=1'
warning with sparse
because it is now missing the __iomem annotation.
The correct solution of course is to remove both the cast and the 'const'.
Arnd
Powered by blists - more mailing lists