Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8897838rwr; Thu, 11 May 2023 07:33:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4i+FlEwSx0RkFV2HgSmcSjg/b8KXjktkOWigoqnI261s3Ev/f8w+98b4/uR7RaL7milWp5 X-Received: by 2002:a05:6a20:3d26:b0:101:69ad:e488 with SMTP id y38-20020a056a203d2600b0010169ade488mr12431387pzi.29.1683815582097; Thu, 11 May 2023 07:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683815582; cv=none; d=google.com; s=arc-20160816; b=fJLXuKtWtltEgsJ+CHLtFGBu6PzbjnIebyo1JMIwiFywN1TCN1gW920JLXNOQo1Y29 HMTVWZ+G3qsX7GE+Mw4ux7sOfPwE5ak2DYARD4Yj2G7swM4r+AspiKwwWghfPRrFFz0X zWiVwv1jIFMoHMwPKubH88T2f/9iQzS6To1CTqx5xt0AfN1AmgCHHmFwpYxxkCDcPmR0 /BhsO8IPgAG74AWCc//qe5Wm1OSxJ3acoiJAcd18qqASZiOa6LifP1zg3aIFR56nNgAS WFTNVNWgZjJCSojlYjeU68kphsIocuE3jVH7A/GS9RXSV/0imvcUi5ZKDNGzT3UQEmaz 0AMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=dpcGjQOvOjcVd8A7k+B29qQqbc7F7NXn2WIMBS85kPM=; b=jbZ5W+Q5tnwcqiFFEuG06aSuij7bOhNKyckE/Peym8NOYqfMbBoRy+drj7HJe+/f2t 1Y/mU94ODaoiJzD2Sn76qUa08z08/R33jKuU82laSjNm3LZn+e7CaFU8pfy0SQiUh5RL rQxedXuCz53i77jLiKfMXb0IhJK75hAqtOiW8/WnR1MfQXx1FWkW3KaN1g30o0xHmFPS 744nIuMvQR/LgTl8F7T32kwmDBTbwhhmQGp7fWvLtlEj95E4bFDQw3T/+laSLVUV4PDt oHVPxdf1dOmo9mPrlm0VOo/VOlcVHjtg2PIhI3EXehX8tEcu3Sp3qEsWA0wX8CefleDm VyVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a635607000000b005250c24fa2esi6537942pgb.428.2023.05.11.07.32.49; Thu, 11 May 2023 07:33:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238409AbjEKOYG (ORCPT + 99 others); Thu, 11 May 2023 10:24:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238248AbjEKOXt (ORCPT ); Thu, 11 May 2023 10:23:49 -0400 X-Greylist: delayed 456 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 11 May 2023 07:23:45 PDT Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3544E66; Thu, 11 May 2023 07:23:45 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 95419100EEFFE; Thu, 11 May 2023 16:16:07 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 7102E261A98; Thu, 11 May 2023 16:16:07 +0200 (CEST) Date: Thu, 11 May 2023 16:16:07 +0200 From: Lukas Wunner To: Lino Sanfilippo Cc: Jarkko Sakkinen , oe-lkp@lists.linux.dev, lkp@intel.com, linux-kernel@vger.kernel.org, Michael =?iso-8859-1?Q?Niew=F6hner?= , linux-integrity@vger.kernel.org, Philipp Rosenberger , jsnitsel@redhat.com, peterz@infradead.org Subject: Re: [linus:master] [tpm, tpm_tis] e644b2f498: RIP:acpi_safe_halt Message-ID: <20230511141607.GA32208@wunner.de> References: <202305041325.ae8b0c43-yujie.liu@intel.com> <42ea93a1-3186-b8ff-c317-d51f3e13856e@kunbus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42ea93a1-3186-b8ff-c317-d51f3e13856e@kunbus.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, 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 Thu, May 11, 2023 at 01:22:19PM +0200, Lino Sanfilippo wrote: > Since beside the one reported by Peter Zijlstra > (https://lore.kernel.org/linux-integrity/CSJ0AD1CFYQP.T6T68M6ZVK49@suppilovahvero/T/#t) > we have another interrupt storm here, it is probably the best to handle those in general > and to disable interrupts in this case to fall back to polling (this is also what Jerry > suggested in the thread above). > > I will try to provide a patch for this. In tpm_tis_probe_irq_single(), after you've requested the irq, you could convert it to a struct irq_desc (via irq_to_desc() from ) and cache that pointer in priv. Then in tis_int_handler(), you could access the irqs_unhandled member of struct irq_desc (from ) and check if it exceeds, say, 5000. If it does, schedule a work_struct which calls disable_interrupts(). You can't call that from the IRQ handler because devm_free_irq() waits for the IRQ handler to finish, so you'd deadlock. You *can* of course clear the TPM_GLOBAL_INT_ENABLE bit from the IRQ handler, though it's unclear to me if that's sufficient to quiesce the interrupt line. By reusing the genirq subsystem's irqs_unhandled infrastructure, you avoid having to reimplement all of that. Thanks, Lukas