linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Intel SPI unbind fixes
@ 2020-05-25 12:25 Lukas Wunner
  2020-05-25 12:25 ` [PATCH 1/3] spi: dw: Fix controller unregister order Lukas Wunner
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Lukas Wunner @ 2020-05-25 12:25 UTC (permalink / raw)
  To: Mark Brown
  Cc: Andy Shevchenko, Jarkko Nikula, linux-spi, Baruch Siach,
	Serge Semin, Tsuchiya Yuto, Daniel Mack, Haojian Zhuang,
	Robert Jarzmik

Fix unbind ordering issues in the Designware and PXA2xx SPI controllers
built into Intel SoCs.

To test, you'll also need the following commit:
https://git.kernel.org/broonie/spi/c/84855678add8

This is compile-tested only, so please review and test thoroughly.

Pay particular attention to the IRQ handlers dw_spi_irq() and ssp_int():
Both drivers request the interrupt with IRQF_SHARED, so the IRQ handler
may run even though the SPI controller itself hasn't signalled an
interrupt.  The IRQ is requested before registering the controller and
freed after unregistering the controller.  Thus, the IRQ handler should
immediately bail out if the controller is not yet or no longer registered,
e.g. by checking in the controller's registers whether an interrupt is
actually pending.  The drivers may need to disable interrupts in the
controllers' registers upon unbinding and they need to make sure that
the registers are accessible until the IRQ is freed.

I don't have a datasheet for these SPI controllers but I hope someone
who is more familiar with them will be able to check for correctness
of the IRQ handling.

Lukas Wunner (3):
  spi: dw: Fix controller unregister order
  spi: pxa2xx: Fix controller unregister order
  spi: pxa2xx: Fix runtime PM ref imbalance on probe error

 drivers/spi/spi-dw.c     | 4 +++-
 drivers/spi/spi-pxa2xx.c | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

-- 
2.25.0


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-05-29 13:55 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 12:25 [PATCH 0/3] Intel SPI unbind fixes Lukas Wunner
2020-05-25 12:25 ` [PATCH 1/3] spi: dw: Fix controller unregister order Lukas Wunner
2020-05-25 13:15   ` Andy Shevchenko
2020-05-25 12:25 ` [PATCH 2/3] spi: pxa2xx: " Lukas Wunner
2020-05-25 13:21   ` Andy Shevchenko
2020-05-26  7:39     ` Lukas Wunner
2020-05-26  8:22       ` Andy Shevchenko
2020-05-27 12:09         ` Tsuchiya Yuto
2020-05-27 12:27           ` Andy Shevchenko
2020-05-27 13:14             ` Tsuchiya Yuto
2020-05-28  7:02               ` Tsuchiya Yuto
2020-05-28  8:41                 ` Andy Shevchenko
2020-05-28  9:31                   ` Lukas Wunner
2020-05-29 13:54                     ` Tsuchiya Yuto
2020-05-25 12:25 ` [PATCH 3/3] spi: pxa2xx: Fix runtime PM ref imbalance on probe error Lukas Wunner
2020-05-25 13:12   ` Andy Shevchenko
2020-05-26  8:46     ` Jarkko Nikula
2020-05-25 13:23 ` [PATCH 0/3] Intel SPI unbind fixes Andy Shevchenko
2020-05-26 16:46 ` Mark Brown

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).