[PATCH 2/4][SRU][OEM-B] Revert "libata, freezer: avoid block device removal while system is frozen"

AceLan Kao acelan.kao at canonical.com
Wed Oct 23 03:15:01 UTC 2019


From: Mika Westerberg <mika.westerberg at linux.intel.com>

BugLink: https://bugs.launchpad.net/bugs/1849269

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 at intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg at linux.intel.com>
Signed-off-by: Jens Axboe <axboe at kernel.dk>
(cherry picked from commit 0e48f51cbbfbdb79149806de14dcb8bf0f01ca94)
Signed-off-by: AceLan Kao <acelan.kao at canonical.com>
---
 drivers/ata/libata-scsi.c | 21 ---------------------
 kernel/freezer.c          |  6 ------
 2 files changed, 27 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 504ad9488ef74..8a6ae66e4434a 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4811,27 +4811,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);
 
diff --git a/kernel/freezer.c b/kernel/freezer.c
index 6f56a9e219fac..43860bdbca387 100644
--- a/kernel/freezer.c
+++ b/kernel/freezer.c
@@ -19,12 +19,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);
 
-- 
2.17.1




More information about the kernel-team mailing list