From patchwork Thu Aug 13 07:53:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 11711949 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44B73109B for ; Thu, 13 Aug 2020 07:54:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BEBD2078B for ; Thu, 13 Aug 2020 07:54:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=metafoo.de header.i=@metafoo.de header.b="JTA1BhxH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726600AbgHMHyu (ORCPT ); Thu, 13 Aug 2020 03:54:50 -0400 Received: from www381.your-server.de ([78.46.137.84]:48648 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbgHMHys (ORCPT ); Thu, 13 Aug 2020 03:54:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=JvabeP1Wi9KJ1VRtuiYVKr0uCnGXs0PcB8x9LsqXhQI=; b=JTA1BhxHYQLX5Fj70HoEN0v2K1 6W0CTcGfha0Fdt9g7Xqgmg4w0gYxzXUXbqKXmO1kNnaACAp7jNXWM56CjmcxW0xiHS958g5hpwUJ7 LioYltUHPE4KChh4dm/otX+0Op7ZeiqKkO4z6pA6Tmwf0iCYyYMlnxAWlFvYwZXSu1m85sI25ydjK lHfKw4NxmiWiGdJqxmTUYz/VTs7NDUeCDMRSrz+Cz0qmmTs7HzItKH3MiFtWZDgc0J+tvgkV2UM2j sQkM8WJy4YrE66jrnp5k2B6YNSoDRvJYBRj3GjLSoWLQQU1EeYGFuDmGSO4wF8w5xc1R8WkRmMjnG T8tNzovA==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1k684U-00069n-ST; Thu, 13 Aug 2020 09:54:46 +0200 Received: from [2001:a61:2517:6d01:9e5c:8eff:fe01:8578] (helo=lars-desktop.fritz.box) by sslproxy06.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k684U-000C5M-Ns; Thu, 13 Aug 2020 09:54:46 +0200 From: Lars-Peter Clausen To: Jonathan Cameron Cc: Hartmut Knaack , Peter Meerwald-Stadler , Sebastian Andrzej Siewior , Christian Eggers , linux-iio@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH 1/2] iio: hrtimer-trigger: Mark hrtimer to expire in hard interrupt context Date: Thu, 13 Aug 2020 09:53:57 +0200 Message-Id: <20200813075358.13310-1-lars@metafoo.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.102.4/25900/Mon Aug 10 14:44:29 2020) Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On PREEMPT_RT enabled kernels unmarked hrtimers are moved into soft interrupt expiry mode by default. The IIO hrtimer-trigger needs to run in hard interrupt context since it will end up calling generic_handle_irq() which has the requirement to run in hard interrupt context. Explicitly specify that the timer needs to run in hard interrupt context by using the HRTIMER_MODE_REL_HARD flag. Fixes: f5c2f0215e36 ("hrtimer: Move unmarked hrtimers to soft interrupt expiry on RT") Reported-by: Christian Eggers Signed-off-by: Lars-Peter Clausen --- drivers/iio/trigger/iio-trig-hrtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c b/drivers/iio/trigger/iio-trig-hrtimer.c index f59bf8d58586..b11ca915fcb2 100644 --- a/drivers/iio/trigger/iio-trig-hrtimer.c +++ b/drivers/iio/trigger/iio-trig-hrtimer.c @@ -132,7 +132,7 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name) trig_info->swt.trigger->ops = &iio_hrtimer_trigger_ops; trig_info->swt.trigger->dev.groups = iio_hrtimer_attr_groups; - hrtimer_init(&trig_info->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); + hrtimer_init(&trig_info->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); trig_info->timer.function = iio_hrtimer_trig_handler; trig_info->sampling_frequency = HRTIMER_DEFAULT_SAMPLING_FREQUENCY;