Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4953276pxy; Tue, 27 Apr 2021 16:57:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqswa9TUNBV+ijE3WHhu+WTOImsk9BMAdeL/knbLO9fNb9xrVn9L7M0KwwlHfQc1h+CRac X-Received: by 2002:a17:906:4098:: with SMTP id u24mr7461455ejj.228.1619567874622; Tue, 27 Apr 2021 16:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619567874; cv=none; d=google.com; s=arc-20160816; b=AhsPmUuW/5pQRliicAeFzPZqFBFPGqVYHfgxKm8yn99eo90UsJEkPY96WMmhY6lQqn Gr3ET4Kxj486Go/tPygTnMufBKJyilsSVlS9EEAoJOZZGh4ZSuIYVD5TVoGHhaVl+r6t NDUYmqgC6ev5Pb9ZVj47P5+KsT3/dBIzJYgQR/EeCi1nyo/nGIoIGEruFPZp5JxC8Zhy aTkB8UeFRyQMFoynjK8BFpzOAx5vtwr59du5jlC9UIvDrVJfbvuOODN0VB3P22bJkT8E /GIrsF0Ox7yEUZdp4AtJMt1bsdP6nGxcpkOhsgg6Jttk0+APoDfYuw8UfsyPYz/8qIOz 75HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YPEuqrdln0nP5qtt3yozdZMw1KMzZCVWATkdr2W+Ox0=; b=sTRpo3xd4Q8uzteoBga/dm4S+2IJ8Iso0IU8IZOMv/xMvTmhSElnqCkeBiXVab9v7l XPi/1s1Fgj6kWbhtJor2mkNwB3Q1E5PuazcOJ6yCONQu12fr8KGYc5uqRqaCw6VeYbXr NTQNxuZgLyJdRZNEQd2mHMexCE3JspTRc0o/dncIgDQrx4FqeWeUM+kX4Lmz0G/XvXod DsNt/JDNNRn3EQne8pMGKBzDnfmL9Et75vDmEYWy0EDTsSLd6bk8wLnJMhnpM4kXqm7s Kqsth6kSt+4tegkhyEVtwDKQreHVFUCWKQVFRvU/OTgr8l4TvwCYaJhTfJN3nJiPjVN3 zKqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ajUIM8BS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si1361289ejj.74.2021.04.27.16.57.07; Tue, 27 Apr 2021 16:57:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ajUIM8BS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239483AbhD0Xyf (ORCPT + 99 others); Tue, 27 Apr 2021 19:54:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:35510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236805AbhD0Xyf (ORCPT ); Tue, 27 Apr 2021 19:54:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B8260613C2; Tue, 27 Apr 2021 23:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619567631; bh=jZ19EiK9skSybp7j1AN/MwtGxlp4/wzv2VevVR1REHU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ajUIM8BSWPOPpXkp05FLSOSel/aMN0GcZu5zdY7V1Dn6NICZeVeFwRw2ZPXFwA9Qg 8TsDHy42vbCjpCQL8llRtX7xEPOXzUdaOmVdmlKaRYgmlajbZSTpwyzLGUCzccyJWG 7GPSsgDJF9n66rHvYw0w3QVRWwcPOdb95uB6/ao+tk0FIKL7zJtNO8QPYiuEbmyBSq P6xo22t2C133oH8akS/w8L4EFNp/kN2/RYvqJeBpQg6YN0XPuWoze30tzM+AUVf30E blyc/zij3X1QwmN89jKO9DEdGNHa17JTnGRAGZGveKrvRoiLzPuFHW94B6ZHQ2GT+J fgFQVNW82QQwQ== Date: Wed, 28 Apr 2021 02:53:48 +0300 From: Jarkko Sakkinen To: Lino Sanfilippo Cc: peterhuewe@gmx.de, jgg@ziepe.ca, stefanb@linux.vnet.ibm.com, James.Bottomley@hansenpartnership.com, keescook@chromium.org, jsnitsel@redhat.com, ml.linux@elloe.vision, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/4] tpm: Use a threaded interrupt handler Message-ID: References: <1619394440-30646-1-git-send-email-LinoSanfilippo@gmx.de> <1619394440-30646-2-git-send-email-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1619394440-30646-2-git-send-email-LinoSanfilippo@gmx.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 26, 2021 at 01:47:17AM +0200, Lino Sanfilippo wrote: > Interrupt handling at least includes reading and writing the interrupt > status register from the interrupt routine. However over SPI those accesses > require a sleepable context, since a mutex is used in the concerning > functions. > For this reason request a threaded interrupt handler which is running in > (sleepable) process context. > > Signed-off-by: Lino Sanfilippo > --- > drivers/char/tpm/tpm_tis_core.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c > index e7d1eab..0959559 100644 > --- a/drivers/char/tpm/tpm_tis_core.c > +++ b/drivers/char/tpm/tpm_tis_core.c > @@ -781,8 +781,10 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, > int rc; > u32 int_status; > > - if (devm_request_irq(chip->dev.parent, irq, tis_int_handler, flags, > - dev_name(&chip->dev), chip) != 0) { > + > + if (devm_request_threaded_irq(chip->dev.parent, irq, NULL, > + tis_int_handler, IRQF_ONESHOT | flags, > + dev_name(&chip->dev), chip) != 0) { > dev_info(&chip->dev, "Unable to request irq: %d for probe\n", > irq); > return -1; > -- > 2.7.4 > Why? https://elixir.bootlin.com/linux/v5.12/source/drivers/char/tpm/tpm_tis_core.c#L670 I don't see anything that sleeps there. /Jarkko1