Linux ATA/IDE development
 help / color / mirror / Atom feed
* SCSI EH wakeup deadlock from deferred_qc
@ 2026-07-08 19:36 Igor Pylypiv
  2026-07-08 22:54 ` Damien Le Moal
  2026-07-08 23:44 ` Damien Le Moal
  0 siblings, 2 replies; 7+ messages in thread
From: Igor Pylypiv @ 2026-07-08 19:36 UTC (permalink / raw)
  To: Damien Le Moal, Niklas Cassel; +Cc: linux-ide

Hi Damien,

I've stumbled upon an issue where SCSI EH didn't run upon command timeout
but ran ~10 or so seconds later. It seems like a recent regression from
the introduction of deffered_qc.

When an active command times out while a non-NCQ command is waiting in
deferred_qc, SCSI EH fails to wake up. Recovery stalls until the deferred
command's own timer expires.

When an NCQ command times out, scsi_timeout() calls scsi_eh_scmd_add(),
incrementing shost->host_failed (1). However, when scsi_eh_wakeup() checks
whether to wake the EH thread, scsi_host_busy(shost) counts 2 active
commands (1 timed-out + 1 in deferred_qc).

Because busy (2) != host_failed (1), scsi_eh_wakeup() refuses to wake
the EH thread, deadlocking error recovery until the deferred command
times out on its own.

Thanks,
Igor

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

end of thread, other threads:[~2026-07-09  4:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 19:36 SCSI EH wakeup deadlock from deferred_qc Igor Pylypiv
2026-07-08 22:54 ` Damien Le Moal
2026-07-08 23:44 ` Damien Le Moal
2026-07-09  1:01   ` Damien Le Moal
2026-07-09  2:24     ` Igor Pylypiv
2026-07-09  3:37       ` Damien Le Moal
2026-07-09  4:36         ` Igor Pylypiv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox