From: Mark Brown <broonie@kernel.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Wolfram Sang <wsa@kernel.org>,
stable@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH v2 1/3] spi: spi-fsl-dspi: Fix external abort on interrupt in exit paths
Date: Mon, 15 Jun 2020 13:30:52 +0100 [thread overview]
Message-ID: <20200615123052.GO4447@sirena.org.uk> (raw)
In-Reply-To: <e1f0326c-8ae8-ffb3-aace-10433b0c78a6@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2064 bytes --]
On Mon, Jun 15, 2020 at 10:17:07AM +0200, Marc Kleine-Budde wrote:
> On 6/15/20 10:07 AM, Krzysztof Kozlowski wrote:
> > If interrupt comes late, during probe error path or device remove (could
> > be triggered with CONFIG_DEBUG_SHIRQ), the interrupt handler
> > dspi_interrupt() will access registers with the clock being disabled. This
> > leads to external abort on non-linefetch on Toradex Colibri VF50 module
> > (with Vybrid VF5xx):
> > Unhandled fault: external abort on non-linefetch (0x1008) at 0x8887f02c
> > Internal error: : 1008 [#1] ARM
> > CPU: 0 PID: 136 Comm: sh Not tainted 5.7.0-next-20200610-00009-g5c913fa0f9c5-dirty #74
> > Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
> > (regmap_mmio_read32le) from [<8061885c>] (regmap_mmio_read+0x48/0x68)
> > (regmap_mmio_read) from [<8060e3b8>] (_regmap_bus_reg_read+0x24/0x28)
> > (_regmap_bus_reg_read) from [<80611c50>] (_regmap_read+0x70/0x1c0)
Please think hard before including complete backtraces in upstream
reports, they are very large and contain almost no useful information
relative to their size so often obscure the relevant content in your
message. If part of the backtrace is usefully illustrative (it often is
for search engines if nothing else) then it's usually better to pull out
the relevant sections.
> > +disable_irq:
> > + if (dspi->irq > 0)
> > + disable_irq(dspi->irq);
> What happens, if you re-bind the driver?
> Is the IRQ still working?
> Who is taking care of calling the enable_irq() again?
> What happens, if you really have a shared IRQ line?
> Is the IRQ disabled for all other devices on the same IRQ line?
Indeed. The upshot of all this is that the interrupt needs to be freed
not disabled before the clocks are disabled, or some other mechanism
needs to be used to ensure that the interrupt handler won't attempt to
access the hardware when it shouldn't. As Vladimir says there are
serious issues using devm for interrupt handlers (or anything else that
might cause code to be run) due to problems like this.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-06-15 12:31 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-15 8:07 [PATCH v2 1/3] spi: spi-fsl-dspi: Fix external abort on interrupt in exit paths Krzysztof Kozlowski
2020-06-15 8:07 ` [PATCH v2 2/3] spi: spi-fsl-dspi: Initialize completion before possible interrupt Krzysztof Kozlowski
2020-06-15 8:07 ` [PATCH v2 3/3] genirq: Do not test disabled IRQs with DEBUG_SHIRQ Krzysztof Kozlowski
2020-06-15 12:08 ` Mark Brown
2020-06-16 10:11 ` Krzysztof Kozlowski
2020-06-16 10:39 ` Mark Brown
2020-06-17 9:30 ` Thomas Gleixner
2020-06-15 8:17 ` [PATCH v2 1/3] spi: spi-fsl-dspi: Fix external abort on interrupt in exit paths Marc Kleine-Budde
2020-06-15 9:23 ` Vladimir Oltean
2020-06-15 13:08 ` Krzysztof Kozlowski
2020-06-15 12:30 ` Mark Brown [this message]
2020-06-15 12:56 ` Vladimir Oltean
2020-06-15 13:10 ` Mark Brown
2020-06-15 13:12 ` Vladimir Oltean
2020-06-15 13:24 ` Mark Brown
2020-06-15 13:29 ` Vladimir Oltean
2020-06-15 13:36 ` Mark Brown
2020-06-15 13:41 ` Krzysztof Kozlowski
2020-06-15 14:23 ` Vladimir Oltean
2020-06-15 14:57 ` Krzysztof Kozlowski
2020-06-15 14:59 ` Vladimir Oltean
2020-06-15 13:10 ` Krzysztof Kozlowski
2020-06-15 13:14 ` Vladimir Oltean
2020-06-15 13:28 ` Krzysztof Kozlowski
2020-06-15 13:33 ` Vladimir Oltean
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=20200615123052.GO4447@sirena.org.uk \
--to=broonie@kernel.org \
--cc=kernel@pengutronix.de \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=vladimir.oltean@nxp.com \
--cc=wsa@kernel.org \
/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