Received: by 10.213.65.68 with SMTP id h4csp263900imn; Wed, 28 Mar 2018 03:10:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+0nvNawSdkxC4GDnPQJsKwIcNwc1yZ0jrlUWrFSOYLrKi6qW0eOIHIJ8H7qOJYpbHSefis X-Received: by 2002:a17:902:3f83:: with SMTP id a3-v6mr3151955pld.279.1522231807470; Wed, 28 Mar 2018 03:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522231807; cv=none; d=google.com; s=arc-20160816; b=LLqu+n1REy6qCBZ61loPCJ57Ft3mUZs9AMbhA8Gl9KY3vjL+ie5TRddHqusZvfqG8x jhsALn4enzJutNI7pb3JqN4L3lOtYb1oFEAMLk6tU/FP1LTl/l6t/gnJy1rk/6ORVKmS yZkSqwPNscafQf22h7/ChHIEpSAaBJ/HwcdftzkgU9aU4lBFOT5uwMwlyoYRyz7wGFdq hd24XjyGUT/lvuWdCiVI/luR7oiQF2JOeO2mhN13HjRJnKb1XenLvkzV82/XZCMkthJO 3LOFEjMHp73z9P0XpAoFxYxw/YYH2REUJiu81cbcAUN/HrgzGNh1CNhiextuw6zA132g XmTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=mRJ/zwoSQoyjt31bWF12cRvJ6dVJsTyGUKSAU+DTZpw=; b=d0aY1dEWyK/iVveE4N1XrQcTUUtN15qhPspWNlxdWf4OPCTEjtEqt74AwG0YdJ7zCu JGV+ZcBz1m1jzN00XS6SJlTXhiZJ73WjK9rKRKBrPDpENpB9kt+WgFfpQw4rSJmxe9f8 bkH8zKnNd+jus1YB6qr7u4SC0FhWG3EEWwiO08LCJFCMl3kT9iWMBIcoFiHp7Qb9gbXU hjGsQMDDrxk4xUcSBu2dPBcbI3FYPV3FSyHvq4sZxf5mqVyp86MfqF3f8Ijr42xjRncJ pVObegkG9RJvhamD6n6ESlp+Mj02elPpnwPUCSS9/541gXBRHjHK4zo3SdAaBbaWzPXA Flfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 36-v6si3359134pla.163.2018.03.28.03.09.53; Wed, 28 Mar 2018 03:10:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752906AbeC1KHx (ORCPT + 99 others); Wed, 28 Mar 2018 06:07:53 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:50181 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752754AbeC1KHw (ORCPT ); Wed, 28 Mar 2018 06:07:52 -0400 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1f17zh-00017s-6b; Wed, 28 Mar 2018 12:07:49 +0200 From: Sebastian Andrzej Siewior To: linux-rt-users@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Steven Rostedt , Sebastian Andrzej Siewior , stable-rt@vger.kernel.org Subject: [PATCH RT 1/3] alarmtimer: Prevent live lock in alarm_cancel() Date: Wed, 28 Mar 2018 12:07:44 +0200 Message-Id: <20180328100746.18668-1-bigeasy@linutronix.de> X-Mailer: git-send-email 2.16.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If alarm_try_to_cancel() requires a retry, then depending on the priority setting the retry loop might prevent timer callback completion on RT. Prevent that by waiting for completion on RT, no change for a non RT kernel. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/alarmtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index ec09ce9a6012..ede5ef787865 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -429,7 +429,7 @@ int alarm_cancel(struct alarm *alarm) int ret =3D alarm_try_to_cancel(alarm); if (ret >=3D 0) return ret; - cpu_relax(); + hrtimer_wait_for_timer(&alarm->timer); } } EXPORT_SYMBOL_GPL(alarm_cancel); --=20 2.16.3