mbox series

[RFC,0/6] Fix a deadlock in the SCSI power management code

Message ID 20200831025357.32700-1-bvanassche@acm.org (mailing list archive)
Headers show
Series Fix a deadlock in the SCSI power management code | expand

Message

Bart Van Assche Aug. 31, 2020, 2:53 a.m. UTC
Recently Martin Kepplinger reported a problem with the SCSI runtime PM
code. Alan Stern root-caused the reported deadlock. This patch series is
an attempt to fix that deadlock. These patches compile but have not yet
been tested.

Bart Van Assche (6):
  ide: Do not set the RQF_PREEMPT flag for sense requests
  scsi: Remove an incorrect comment
  scsi: Pass a request queue pointer to __scsi_execute()
  scsi_transport_spi: Make spi_execute() accept a request queue pointer
  scsi_transport_spi: Freeze request queues instead of quiescing
  block, scsi, ide: Only submit power management requests in state
    RPM_SUSPENDED

 block/blk-core.c                  |   6 +-
 block/blk-mq-debugfs.c            |   1 -
 block/blk-mq.c                    |   4 +-
 drivers/ide/ide-atapi.c           |   1 -
 drivers/ide/ide-io.c              |   3 +-
 drivers/ide/ide-pm.c              |   2 +-
 drivers/scsi/scsi_lib.c           |  61 ++++++++-------
 drivers/scsi/scsi_priv.h          |   2 +
 drivers/scsi/scsi_transport_spi.c | 123 +++++++++++++++++-------------
 include/linux/blk-mq.h            |   4 +-
 include/linux/blkdev.h            |   6 +-
 include/scsi/scsi_device.h        |  16 ++--
 12 files changed, 120 insertions(+), 109 deletions(-)

Comments

Martin Kepplinger Aug. 31, 2020, 9:09 a.m. UTC | #1
On 31.08.20 04:53, Bart Van Assche wrote:
> Recently Martin Kepplinger reported a problem with the SCSI runtime PM
> code. Alan Stern root-caused the reported deadlock. This patch series is
> an attempt to fix that deadlock. These patches compile but have not yet
> been tested.
> 
> Bart Van Assche (6):
>   ide: Do not set the RQF_PREEMPT flag for sense requests
>   scsi: Remove an incorrect comment
>   scsi: Pass a request queue pointer to __scsi_execute()
>   scsi_transport_spi: Make spi_execute() accept a request queue pointer
>   scsi_transport_spi: Freeze request queues instead of quiescing
>   block, scsi, ide: Only submit power management requests in state
>     RPM_SUSPENDED
> 

this patchset works for me (as an alternative to Alan's initial fix:
https://lore.kernel.org/linux-scsi/20200623111018.31954-1-martin.kepplinger@puri.sm/T/#ma566fe2e39cb3fcccdd245564913d17a343e1d1a
)

On top of this I have to apply scsi "fixes" of course and now run
exactly this:
https://lore.kernel.org/linux-scsi/20200824190400.12339-1-martin.kepplinger@puri.sm/T/#u

Is this fully applicable still now? Again, the cardreader works and
suspends as expected. So thanks a lot for working on this!

Sure someone who has experience with block and scsi code should review
this, but definitely:

Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Bart Van Assche Sept. 1, 2020, 3:55 a.m. UTC | #2
On 2020-08-31 02:09, Martin Kepplinger wrote:
> Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>

Thanks for having tested this patch series!

Bart.