Skip to content

iio: proximity: sx93xx: keep the IRQ balanced across suspend and resume

Arnav Kapoor linux-iio lkml 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 0 repliesNew
  2. v43 patches 2 repliesSuperseded
  3. v33 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches2 repliesSuperseded
v11 patch1 replySuperseded

Changes in v5 from the cover letter

- Disable the interrupt with disable_irq() before taking the mutex, and enable it again if suspend fails. v4 called disable_irq_nosync() at the end of suspend, so a threaded handler woken during the register writes could run after suspend returned. Found by Sashiko.
- Move the register accesses into a *_sleep() helper per driver so the mutex is released before the interrupt is re-enabled on failure
- Rebase on fixes-togreg

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3iio: proximity: sx9310: keep the IRQ balanced across suspend and resumedrivers/iio/proximity/sx9310.c+35 -190 replies
2/3iio: proximity: sx9324: keep the IRQ balanced across suspend and resumedrivers/iio/proximity/sx9324.c+29 -140 replies
3/3iio: proximity: sx9360: keep the IRQ balanced across suspend and resumedrivers/iio/proximity/sx9360.c+30 -150 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/3] iio: proximity: sx93xx: keep the IRQ balanced across suspend and resume

sx9310, sx9324 and sx9360 disable the interrupt in suspend before anything that can fail, and don't enable it again when suspend or resume fails. One patch per driver, as the Fixes tags differ.

Changes in v5:
- Disable the interrupt with disable_irq() before taking the mutex, and enable it again if suspend fails. v4 called disable_irq_nosync() at the end of suspend, so a threaded handler woken during the register writes could run after suspend returned. Found by Sashiko.
- Move the register accesses into a *_sleep() helper per driver so the mutex is released before the interrupt is re-enabled on failure
- Rebase on fixes-togreg

v4: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v1:
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/

Compile-tested only (W=1); I don't have the hardware and haven't reproduced a failing suspend.

Arnav Kapoor (3):
iio: proximity: sx9310: keep the IRQ balanced across suspend and
resume
iio: proximity: sx9324: keep the IRQ balanced across suspend and
resume
iio: proximity: sx9360: keep the IRQ balanced across suspend and
resume

 drivers/iio/proximity/sx9310.c | 54 ++++++++++++++++++++++------------
 drivers/iio/proximity/sx9324.c | 43 ++++++++++++++++++---------
 drivers/iio/proximity/sx9360.c | 45 ++++++++++++++++++----------
 3 files changed, 94 insertions(+), 48 deletions(-)

base-commit: a6d9114f68c4b5507b2d945bd6d1e37415f913c5

Signature · 1 line
2.53.0