Skip to content

Intel SPI unbind fixes

Lukas Wunner linux-spi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3spi: dw: Fix controller unregister orderdrivers/spi/spi-dw.c+3 -11 reply
2/3spi: pxa2xx: Fix controller unregister orderdrivers/spi/spi-pxa2xx.c+3 -110 replies
3/3spi: pxa2xx: Fix runtime PM ref imbalance on probe errordrivers/spi/spi-pxa2xx.c+0 -12 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchAndy ShevchenkoJarkko Nikula
1/3R-b
2/3R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Intel SPI unbind fixes

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(-)
Signature · 1 line
2.25.0