Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp811566iog; Wed, 15 Jun 2022 12:55:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vlhuXBk2UTX/eXOpRFn2gNcFAOBTTQJARfRfNsDaU0szA5UKfzkjIrBulVEdjcrS5xSQBh X-Received: by 2002:a63:c63:0:b0:3fe:e14b:b5a0 with SMTP id 35-20020a630c63000000b003fee14bb5a0mr1288223pgm.428.1655322917139; Wed, 15 Jun 2022 12:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655322917; cv=none; d=google.com; s=arc-20160816; b=eu8/Vm8SQVQrUw0GmtfkN7LGQcd74vfBOnWc4Ic/rPmxeRmhASQbvSV8sCend66tJS T/oDOTXnjP37JwfYUZyXxfhnhKvmyfMLAC8bsNGdZh21mIk9As0GGDFW66NHrz7kBZr4 x9orHNXZt25XvtonhbREGGMCsENALpXbgEob8JIGNJqQYQzrf1zd8TcZFLio4OpZWob+ 1xCfg2OKQcHk75ZkDLIUJ1s0/T8/fx/nOIS+aJd5zXvVhbM3PXZ2Qp/t1cRRlwXcVvaR MDh5DQqxIt/7HtW4zzPliRn3PlCXF5qA4D8B62Y82um+UWW5BDgeS3atx7jacY6VvYiq MS1Q== 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=QQm+mIZAjcMuMzSkbC6plp9ssMnJ/GYh4cgYCRqc+i4=; b=LcAcbcqE98bPsnGjcR/um8uBN88S2PKOoSx9j0M7TgUCWje9QjINP/LE5LIu9DPp4B 23KCnsfH/YHn4OrMtcJM4yDR9ejfl/NG6LSL/oXuvMEg68WW64nnwyP6siQvWtOrcxpF 9JXT4F/InCX5dWKkFXnWGbiIkSFpgi/BtJGt5S/h0cptVTBvCt6HUpmU6XNP9PeJjJ3V +99osQOGsqc93NYneXAiUFZzquw5VY4yhpjPCXfC+zIZDu0dug5v4lvcuuCWizqwK1mq CTt1Y8YsRBK6XyC3bBjo+/61vVvdec63h8KqVrzF0mQ3mmELZwp2kq2bGcVYW10sii2y kG2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HtDiTPjl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020a170902e89100b0016511314bb7si85923plg.151.2022.06.15.12.55.05; Wed, 15 Jun 2022 12:55:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HtDiTPjl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1345788AbiFOS05 (ORCPT + 99 others); Wed, 15 Jun 2022 14:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242474AbiFOS0z (ORCPT ); Wed, 15 Jun 2022 14:26:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0702C46CA2; Wed, 15 Jun 2022 11:26:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B2F47B820BE; Wed, 15 Jun 2022 18:26:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2465C34115; Wed, 15 Jun 2022 18:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655317612; bh=fRkYpPI/6cwJUF3rOB9VLtfSWvCjuLf4RTvivAv/DBk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HtDiTPjlMT83zHhELaNuA/+2c1NlwH5Ow5Rm8ZVZtoRg5o3/ZhroNh4y2vyZNzIRN FE8V9FvXXCQgBiJeeSMGP5/pDfgIdgLn3LLAJktTzMK8nVIgSdbtMTvXnPM5yC0cAR y1UQofHHjAb48UsyJ212i+uFOj5w0x8C9ou7iPh8fCDRiF8iu76zWIqrhwv+z5OkCc ZgWAxxUeRlbgqbdPVOvY6Dg+sg7id/ce2aeFMv3ZRdEhnFtOOBgJY2qeMQUJIqDZBy PMe/IdmNWhkT7ZaHbDdC/0vC3XUjMtmbCGbqa+SQl7HKqrUA2vmytkaenvorjvr78f +4SNJuWrzVaxw== Date: Wed, 15 Jun 2022 21:24:43 +0300 From: Jarkko Sakkinen To: LinoSanfilippo@gmx.de Cc: peterhuewe@gmx.de, jgg@ziepe.ca, stefanb@linux.vnet.ibm.com, linux@mniewoehner.de, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, l.sanfilippo@kunbus.com, lukas@wunner.de, p.rosenberger@kunbus.com Subject: Re: [PATCH v5 08/10] tpm, tpm_tis: Request threaded interrupt handler Message-ID: References: <20220610110846.8307-1-LinoSanfilippo@gmx.de> <20220610110846.8307-9-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220610110846.8307-9-LinoSanfilippo@gmx.de> X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 10, 2022 at 01:08:44PM +0200, LinoSanfilippo@gmx.de wrote: > From: Lino Sanfilippo > > The TIS interrupt handler at least has to read and write the interrupt > status register. In case of SPI both operations result in a call to > tpm_tis_spi_transfer() which uses the bus_lock_mutex of the spi device > and thus must only be called from a sleepable context. > > To ensure this request a threaded interrupt handler. > > Fixes: 1a339b658d9d ("tpm_tis_spi: Pass the SPI IRQ down to the driver") > Signed-off-by: Lino Sanfilippo > --- > drivers/char/tpm/tpm_tis_core.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c > index 0ef74979bc2c..8b5aa4fdbe92 100644 > --- a/drivers/char/tpm/tpm_tis_core.c > +++ b/drivers/char/tpm/tpm_tis_core.c > @@ -794,8 +794,11 @@ 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) { > + > + rc = devm_request_threaded_irq(chip->dev.parent, irq, NULL, > + tis_int_handler, IRQF_ONESHOT | flags, > + dev_name(&chip->dev), chip); > + if (rc) { > dev_info(&chip->dev, "Unable to request irq: %d for probe\n", > irq); > return -1; > -- > 2.36.1 > I actually would not add fixes tag to this because given that interrupt support is quite unusable, this should not cause any harm. The code change itself is fine. BR, Jarkko