Skip to content

Commit

Permalink
Revert "libata, freezer: avoid block device removal while system is f…
Browse files Browse the repository at this point in the history
…rozen"

This reverts commit 85fbd72.

The commit was added as a quick band-aid for a hang that happened when a
block device was removed during system suspend. Now that bdi_wq is not
freezable anymore the hang should not be possible and we can get rid of
this hack by reverting it.

Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
westeri authored and axboe committed Oct 6, 2019
1 parent a2b90f1 commit 0e48f51
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
21 changes: 0 additions & 21 deletions drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4791,27 +4791,6 @@ void ata_scsi_hotplug(struct work_struct *work)
return;
}

/*
* XXX - UGLY HACK
*
* The block layer suspend/resume path is fundamentally broken due
* to freezable kthreads and workqueue and may deadlock if a block
* device gets removed while resume is in progress. I don't know
* what the solution is short of removing freezable kthreads and
* workqueues altogether.
*
* The following is an ugly hack to avoid kicking off device
* removal while freezer is active. This is a joke but does avoid
* this particular deadlock scenario.
*
* https://bugzilla.kernel.org/show_bug.cgi?id=62801
* http://marc.info/?l=linux-kernel&m=138695698516487
*/
#ifdef CONFIG_FREEZER
while (pm_freezing)
msleep(10);
#endif

DPRINTK("ENTER\n");
mutex_lock(&ap->scsi_scan_mutex);

Expand Down
6 changes: 0 additions & 6 deletions kernel/freezer.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ EXPORT_SYMBOL(system_freezing_cnt);
bool pm_freezing;
bool pm_nosig_freezing;

/*
* Temporary export for the deadlock workaround in ata_scsi_hotplug().
* Remove once the hack becomes unnecessary.
*/
EXPORT_SYMBOL_GPL(pm_freezing);

/* protects freezing and frozen transitions */
static DEFINE_SPINLOCK(freezer_lock);

Expand Down

0 comments on commit 0e48f51

Please sign in to comment.