Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2933762pxy; Mon, 3 May 2021 11:11:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxW0R3jNUMe8os9XiA+A6OVWNTTLSxghlrs9ym0R3fsi8Buvdu+iIseUyiTv200I3FZCjcG X-Received: by 2002:a17:90a:384b:: with SMTP id l11mr22285461pjf.222.1620065485502; Mon, 03 May 2021 11:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065485; cv=none; d=google.com; s=arc-20160816; b=tboLiWZeRC0djlWT7WkNbhzpcZxCdtYlSepkpRrlHTWUFbOsywze2pVYKdgir8cMTm UqqSvUlvXEV3d1h98DwXy02CyMbvE8MYbZ94CP0Jdgq3dNCdidhKc5xkEKqSf+wJA/PS LfbqIgmXiOE0HL96nPU9KRIYurJi90PNVKJ3NIy4heXa7KVe8oAZlC9PiPk46EqRLVOZ EOtc1lkF0sUkptP1jl0cDhxX6zg4JlinwWDhZVZ66xI0D1mqwf/3+tzFLf33+h6c/eNr LC97xEszESOM7Lh6WjE4NChpF6R60zous7jvqiz+uie17Rl4ZEK+EJ2Rv+58hxbLENhd 2E2A== 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=BDfDVM+lEd+AIdOgacCxmWdi2v3a8PKl5X/XWEY9S2Y=; b=FSoWtHH94z5lor8ezIW6a41DZ8f3f6yKJUpEBbBQDmj+FgBsVeFPDy964P9s/3bCZC 6BphMhVJp3qSCzN7cmKaMrzlJNHEqhuB8RBaVcSg3NiMV+iNeF2hCVuVOaJTduquxHFA pQbRcCzIIn+QKqeUtvaVJAu+/ZfOZVD+FSb1kdSNJTcu01hAASEPRbu/FPQOmiaXCdAk k7m5TN0FTaTeHCxmIg8rmBXUVhLvZvEnnYgU/bp44n6zNjnNYjBamZoGAec4nnoOv3bK LGu8FMBZ06N9C8JJPq8aaZL2PL3FAZ89Qt0uNZHh2teEFil1j/USCxTOqEpd1QZPDAmK QCyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="VYjgs/I+"; 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 c17si216871pjs.70.2021.05.03.11.11.12; Mon, 03 May 2021 11:11:25 -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="VYjgs/I+"; 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 S230344AbhECPPK (ORCPT + 99 others); Mon, 3 May 2021 11:15:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:55118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230334AbhECPPI (ORCPT ); Mon, 3 May 2021 11:15:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 78C4661244; Mon, 3 May 2021 15:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620054855; bh=l/oW44h3R465Lu0dfjfqdreggvzt5yyu9gr3b7Ukl8g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VYjgs/I+MALOqkwkZ61dV5jreY1ObtB9q1kjCfSVVVV2f2o5uHhYt+vbmJkw35Ibd NVttw/rz4YoZ0fbwQcJstY2st9UMIkXL1pTtB10MTPm//eY6R8hZcoIXR3SuW3gXTY 5hoLtIkNrJ7nvjDXbcws5Ni5KdFAlW8HRCNL66az+Afek4M/tajVJ857tMXPmtKlXJ JkiLbmtc9TAZ8n6LxMneOB1xaK050PO89WkYShdU0u04y8sXfZl8NBCRjFrJPn+CpB pMKNM13HVyRsqJBFQpQaPFztaKZQ3r8E44EgFIk2i3L/tnJRyqnldBeOCyiNhJgy1a CX9gzyz+ddzkA== Date: Mon, 3 May 2021 18:14:12 +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, Stefan Berger Subject: Re: [PATCH v3 1/4] tpm: Use a threaded interrupt handler Message-ID: References: <20210501135727.17747-1-LinoSanfilippo@gmx.de> <20210501135727.17747-2-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210501135727.17747-2-LinoSanfilippo@gmx.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 01, 2021 at 03:57:24PM +0200, Lino Sanfilippo wrote: > The interrupt handler uses tpm_tis_read32() and tpm_tis_write32() to access > the interrupt status register. In case of SPI those accesses are done with > the spi_bus_lock mutex held. This means that the status register cannot > be read or written in interrupt context. > > For this reason request a threaded interrupt handler so that the required > accesses can be done in process context. > > Reviewed-by: Stefan Berger > Signed-off-by: Lino Sanfilippo No fixes tag. The short summary scopes now the whole TPM subsystem ("tpm:"), but the fix is targetted *only* for tpm_tis_spi. How about "tpm, tpm_tis_spi: Allow to sleep in the interrupt handler"? This also changes the semantics tpm_tis_*, not just tpm_tis_spi, which is not acceptable. We cannot backport a fix like this. Probably you should just add a parameter to tpm_tis_core_init() to hint that threaded IRQ is required, and then only conditionally do so. /Jarkko