Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3346850iob; Mon, 16 May 2022 20:13:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3CF/KcQ8FT4bSRjvFja4z9vkbpjaPCELRQRkXH/ke1f/5QcqK0+t1sxcTt6xqM9iFNuyX X-Received: by 2002:a17:907:16a8:b0:6f3:e9fc:29e7 with SMTP id hc40-20020a17090716a800b006f3e9fc29e7mr17862440ejc.428.1652757183333; Mon, 16 May 2022 20:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652757183; cv=none; d=google.com; s=arc-20160816; b=pJ6AjlE45FooKV2172yOEd7VRe3uFOebsRYT/ajTggchjQFdlD1PWXNTrhd+ugoeAR IQgZwMP0+jiUQT3FXYjIbci7N0LGuLEmQJfs455+YkEjDd0240lZL7svLTJzkVizBTkO vtNZ5AjkY+bq6fxP3NBjQJAGCFKrUUDzFXAnbiVJUS6nHVH/65/5cdwt3U4HPIiV9Zqf jW+V79bN8G++duDToYRUAMvOCqQ224BQ7BcJTmSx1OQsKmLdlZerHszGTd5vG5h1QGLS Z9YqEHkGkw6534GTBYF+NH1Fz9DodCZ398ipXMMte4GY+rpYMF8NgzHQDteF8oSXjoqK DqaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=UNy2J4fkb7uNrb3sdw6sHacgYSf5R/YKgMseuZ9qomo=; b=1LGYIiI8c3BzX1P/i4GPD82aJmgyloA6hEYhGsIEHxc4R719d3Jo5+NQmr8IFSzfIo +AGEoIJRwyANhlj1ShuHkAo0pifkh/JoCV3vH8E7Q9xssCVXIHrZ1JHHQ++9KttsRTkj z3lWDmsAOFygIf1ozoVMHZ8zvttYKyzPpknqt2DkioDpdNF3OCAXYaHdtluunFNiblI4 s7zZMAgHaSgA+Dh025w+AX9QHLZwFLIvHX96v7yGKYI/ynlq/XznDyRExy2/WugUHwPz Kokb2aYOH8kfbOmsFWBn6V/f2svSpDxBWbUSgxRU8bSbmLKfZK0WwZSM6NEx77tCWZmO 0o1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Fjz4O2JL; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs38-20020a1709072d2600b006fa15acc456si1533530ejc.931.2022.05.16.20.12.37; Mon, 16 May 2022 20:13:03 -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=@gmx.net header.s=badeba3b8450 header.b=Fjz4O2JL; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240202AbiEPUUX (ORCPT + 99 others); Mon, 16 May 2022 16:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348896AbiEPT7C (ORCPT ); Mon, 16 May 2022 15:59:02 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F88613F1C; Mon, 16 May 2022 12:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1652730726; bh=UNy2J4fkb7uNrb3sdw6sHacgYSf5R/YKgMseuZ9qomo=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Fjz4O2JLj2wqI2k0QgbiyH2kXrx6LvpDfEBAcTqr0ZI6FUW9j8PY4F53LE0I5Y83G 90d1QoQx8ZBtPauOijPKcTi7wYphQO5FOj1y8qejkCj2tJAm0hlUTfHaVdpSW1o0An 3QQ/CuTjDvIR5xI20pZe/RD95oSU661YFNG50dUQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.33] ([46.223.3.15]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MxUrx-1nfu511aQ5-00xrE8; Mon, 16 May 2022 21:52:06 +0200 Subject: Re: [PATCH v4 1/6] tpm, tpm_tis_spi: Request threaded irq To: Jarkko Sakkinen 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, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo References: <20220509080559.4381-1-LinoSanfilippo@gmx.de> <20220509080559.4381-2-LinoSanfilippo@gmx.de> <486cec01-ec02-3f11-0b81-037e0700c503@gmx.de> From: Lino Sanfilippo Message-ID: <1b306d56-c6b3-e51f-1d63-2f6725fa7557@gmx.de> Date: Mon, 16 May 2022 21:52:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:4mC90Cdt0908TfXcpU5kwIXZz/I20/o2aOoBpxBAi66+E7Wo5K/ 9HAf13p9g462Tnkmpi2VW7QmLUEFEzu2E2yb51VYlr+cJdI4tQKFFgjG7kaNn8nbbV0x/Cj cs9pqMkVIibMHiar7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Yf+rsLMtNXvPiByjceb wazeHzMOodKIJvtRZuxIIw4f4N8deNHpEgWKXI5BmbD2OIdwZTEXxWkjrnClHfAvbWgdSspHz C9ZIaTp2qmEGPKuG0nCXKh4JvvZ1BdNmORkdYLgj1uqzsGq52ZS1/Gd32zipeZzHC+GeQW9q+ mEhon8fngHIfaaGq7CTTnNNhCGUK4MvrFbG3vVm0drApIfSvTyOuQVe0Q== X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,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 Hi, On 13.05.22 at 20:08, Jarkko Sakkinen wrote: > On Wed, May 11, 2022 at 09:18:39PM +0200, Lino Sanfilippo wrote: >> Hi, >> >> On 11.05.22 at 13:22, Jarkko Sakkinen wrote: >>> On Mon, May 09, 2022 at 10:05:54AM +0200, Lino Sanfilippo wrote: >>>> From: Lino Sanfilippo >>>> >>>> Interrupt handling at least includes reading and writing the interrup= t >>>> status register within the interrupt routine. Since accesses over the= SPI >>>> bus are synchronized by a mutex, request a threaded interrupt handler= to >>>> ensure a sleepable context during interrupt processing. >>>> >>>> Fixes: 1a339b658d9d ("tpm_tis_spi: Pass the SPI IRQ down to the drive= r") >>>> Signed-off-by: Lino Sanfilippo >>> >>> When you state that it needs a sleepable context, you should bring a >>> context why it needs it. This not to disregard the code change overall= y but >>> you cannot make even the most obvious claim without backing data. >>> >> >> so what kind of backing data do you have in mind? Would it help to emph= asize more >> that the irq handler is running in hard irq context in the current code= and thus >> must not access registers over SPI since SPI uses a mutex (I consider i= t as basic >> knowledge that a mutex must not be taken in hard irq context)? > > There's zero mention about specific lock you are talking about. Providin= g > the basic knowledge what you are trying to do is the whole point of the > commit message in the first place. I'd presume this patch is related to = the > use bus_lock_mutex but it is fully ingored here. > Ok, understood. I will amend the commit message to make more clear that reading and writing registers from the interrupt handler results in a call to tpm_tis_spi_transfer() which uses the bus_lock_mutex of the spi device and thus requires a sleepable context. Regards, Lino > BR, Jarkko >