Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mika Westerberg and committed by
Jens Axboe
0e48f51c a2b90f11

-27
-21
drivers/ata/libata-scsi.c
··· 4791 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 4794 DPRINTK("ENTER\n"); 4816 4795 mutex_lock(&ap->scsi_scan_mutex); 4817 4796
-6
kernel/freezer.c
··· 22 22 bool pm_freezing; 23 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 25 /* protects freezing and frozen transitions */ 32 26 static DEFINE_SPINLOCK(freezer_lock); 33 27