diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2019-10-04 06:00:25 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-10-06 11:11:37 -0400 |
commit | 0e48f51cbbfbdb79149806de14dcb8bf0f01ca94 (patch) | |
tree | 61ddfe90317118824b15ae7cff539cb8f8232b62 | |
parent | a2b90f11217790ec0964ba9c93a4abb369758c26 (diff) |
Revert "libata, freezer: avoid block device removal while system is frozen"
This reverts commit 85fbd722ad0f5d64d1ad15888cd1eb2188bfb557.
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 <rafael.j.wysocki@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/ata/libata-scsi.c | 21 | ||||
-rw-r--r-- | kernel/freezer.c | 6 |
2 files changed, 0 insertions, 27 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 76d0f9de767b..58e09ffe8b9c 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -4791,27 +4791,6 @@ void ata_scsi_hotplug(struct work_struct *work) | |||
4791 | return; | 4791 | return; |
4792 | } | 4792 | } |
4793 | 4793 | ||
4794 | /* | ||
4795 | * XXX - UGLY HACK | ||
4796 | * | ||
4797 | * The block layer suspend/resume path is fundamentally broken due | ||
4798 | * to freezable kthreads and workqueue and may deadlock if a block | ||
4799 | * device gets removed while resume is in progress. I don't know | ||
4800 | * what the solution is short of removing freezable kthreads and | ||
4801 | * workqueues altogether. | ||
4802 | * | ||
4803 | * The following is an ugly hack to avoid kicking off device | ||
4804 | * removal while freezer is active. This is a joke but does avoid | ||
4805 | * this particular deadlock scenario. | ||
4806 | * | ||
4807 | * https://bugzilla.kernel.org/show_bug.cgi?id=62801 | ||
4808 | * http://marc.info/?l=linux-kernel&m=138695698516487 | ||
4809 | */ | ||
4810 | #ifdef CONFIG_FREEZER | ||
4811 | while (pm_freezing) | ||
4812 | msleep(10); | ||
4813 | #endif | ||
4814 | |||
4815 | DPRINTK("ENTER\n"); | 4794 | DPRINTK("ENTER\n"); |
4816 | mutex_lock(&ap->scsi_scan_mutex); | 4795 | mutex_lock(&ap->scsi_scan_mutex); |
4817 | 4796 | ||
diff --git a/kernel/freezer.c b/kernel/freezer.c index c0738424bb43..dc520f01f99d 100644 --- a/kernel/freezer.c +++ b/kernel/freezer.c | |||
@@ -22,12 +22,6 @@ EXPORT_SYMBOL(system_freezing_cnt); | |||
22 | bool pm_freezing; | 22 | bool pm_freezing; |
23 | bool pm_nosig_freezing; | 23 | bool pm_nosig_freezing; |
24 | 24 | ||
25 | /* | ||
26 | * Temporary export for the deadlock workaround in ata_scsi_hotplug(). | ||
27 | * Remove once the hack becomes unnecessary. | ||
28 | */ | ||
29 | EXPORT_SYMBOL_GPL(pm_freezing); | ||
30 | |||
31 | /* protects freezing and frozen transitions */ | 25 | /* protects freezing and frozen transitions */ |
32 | static DEFINE_SPINLOCK(freezer_lock); | 26 | static DEFINE_SPINLOCK(freezer_lock); |
33 | 27 | ||