From: Heiko Carstens Date: Fri, 23 Jan 2009 15:40:26 +0000 (+0100) Subject: [S390] etr/stp: fix possible deadlock X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=179cb81aa1e9dc5444f678a6dd4dbb90c60322e1;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [S390] etr/stp: fix possible deadlock Precreate stop_machine threads in case the machine supports ETR/STP. Otherwise we might deadlock if a time sync operation gets scheduled and the creation of stop_machine threads would cause disk I/O. This is just the minimal fix. The real fix would be to only precreate stop_machine threads if ETR/STP is actually used. But that would be a rather large and complicated patch. Signed-off-by: Heiko Carstens --- diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index d649600df5b9..fc468cae4460 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -399,8 +399,10 @@ static struct workqueue_struct *time_sync_wq; static void __init time_init_wq(void) { - if (!time_sync_wq) - time_sync_wq = create_singlethread_workqueue("timesync"); + if (time_sync_wq) + return; + time_sync_wq = create_singlethread_workqueue("timesync"); + stop_machine_create(); } /*