Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4432448rdh; Wed, 29 Nov 2023 01:02:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCEuhicNVcNz5m8sZ3GghdXR9fmlxwZ2oszv91ee9y+rxKDGfT8zafTYSxunrIh4zhRrx3 X-Received: by 2002:a05:6808:1910:b0:3b8:5bee:6ba7 with SMTP id bf16-20020a056808191000b003b85bee6ba7mr20000052oib.7.1701248536965; Wed, 29 Nov 2023 01:02:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701248536; cv=none; d=google.com; s=arc-20160816; b=sss/L8hKhGLNZKma+yBv2oqISLhAw+zr4auUYI3gv+mdvkBcjdyF9P+c1s6UZH5yn2 H7ZYftLBuuIIpnUArSKlGGdYjDFhKp5yJcmqqzTI9dbe+i+EFama1AkpTPhRHckvz1Kq exAzIMRbykBjvoS3MgTsV201hNEAlpgVze6GOwN30XmZFOMJhxZk0ImXh6QT7RgzhXPB VX5eYYRn2uqC9XgNwdilXx9lZZ62xLf8E7HRWr7AwJCZjoHT5eOGqcj7g7zP5OhM4NOI 913X33j73V6TPYLCTSZmgqmbZ8H7c4hgPXs3hpWmv858/0WGvVdRa/FBn4l+LoTt8ZXQ JDtQ== 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=0xR+bIOKFsc6i7JfWqjL7s4WWTzS5HxqS41f81HInJU=; fh=qRbNJ2g7OhOq3TFMt/nR9WomteeectHRNv1KHJCxppQ=; b=mSLFz9XFRFjxBO+rBEyxBdQMjdnXE00BG53ivBQm+ifptJ/dd8lA3kl0PMvarEq6Fl dvijjiexMBeCJcRIpj8wNQMmw+N43Go6QFioQRHKkte8+nHsIqTeSTsNqQNgP+KjLHfY qRScA7gzkviI7QqJp2CSpnE1DpshIlvnh0ygGATPa44ySZ0MBwjegWgtT5TYcLvDynDi gIbMUQiidbFmFW27rlXEghHSD7A3NS5jq1J6t3QxjUJdNtqdEGo94q1gtJ9etuLab0vI 6yQiZl4AdXjr297bn8ERPegnhIojDK2a3CXHq3/qaeE8lSkYQJqXlThv8W04mqLRM+no bebQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K+bFL8qf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id e20-20020a656494000000b005b96662f77asi13510906pgv.482.2023.11.29.01.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 01:02:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K+bFL8qf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 0971F807C5EA; Wed, 29 Nov 2023 01:02:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232328AbjK2JBr (ORCPT + 99 others); Wed, 29 Nov 2023 04:01:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbjK2JBq (ORCPT ); Wed, 29 Nov 2023 04:01:46 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 314E2F5; Wed, 29 Nov 2023 01:01:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701248512; x=1732784512; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=jUfEMJcGPk/pC7rsEa3j89yXra3uK2XLsI3C0myADGQ=; b=K+bFL8qfFmlKh1ttGEsFUEZAFiFY9d04DIw8qK6wpWJgus4rMeXk39zJ GqPPTawDDUPx/ocm8YUxOA7p0ue7x5k/Oc//IYEiuTSzHzn45VLCsGm85 vxZQvCTgBmrG8hD8GIMQP1ehZ7mYmQctXG9pCl5idyOiDxzGwEEy9KSrN uWzjrey9zrswmXIcRoqzkIoSUcjAN58OMowJjkCdLWkmbuPJp8gngsEEV P9Bi0ZI8ML0JRwRnnL48YGNViIkxM+goUq8H/DLh3vxpm8Gwuxs8C7sKh 3RNGxUnULO3y1MGcQHg7HjVrT5h5sRbxc1gtcl2WBD20Dw54bP+CvqLib Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="479328165" X-IronPort-AV: E=Sophos;i="6.04,235,1695711600"; d="scan'208";a="479328165" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 00:56:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="942247871" X-IronPort-AV: E=Sophos;i="6.04,235,1695711600"; d="scan'208";a="942247871" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 29 Nov 2023 00:56:01 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id 9036B23A; Wed, 29 Nov 2023 10:56:00 +0200 (EET) Date: Wed, 29 Nov 2023 10:56:00 +0200 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML , Zhang Rui , Srinivas Pandruvada , Michal Wilczynski , Hans de Goede , Andy Shevchenko , Heikki Krogerus , Mario Limonciello Subject: Re: [RFT][PATCH v1] ACPI: OSL: Use a threaded interrupt handler for SCI Message-ID: <20231129085600.GQ1074920@black.fi.intel.com> References: <5745568.DvuYhMxLoT@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5745568.DvuYhMxLoT@kreacher> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 29 Nov 2023 01:02:08 -0800 (PST) Hi Rafael, On Mon, Nov 27, 2023 at 08:57:43PM +0100, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > In the current arrangement, all of the acpi_ev_sci_xrupt_handler() code > is run as an interrupt handler for the SCI, in interrupt context. Among > other things, this causes it to run with local interrupts off which > can be problematic if many GPEs are enabled and they are located in the > I/O address space, for example (because in that case local interrupts > will be off for the duration of all of the GPE hardware accesses carried > out while handling an SCI combined and that may be quite a bit of time > in extreme scenarios). > > However, there is no particular reason why the code in question really > needs to run in interrupt context and in particular, it has no specific > reason to run with local interrupts off. The only real requirement is > to prevent multiple instences of it from running in parallel with each > other, but that can be achieved regardless. > > For this reason, use request_threaded_irq() instead of request_irq() for > the ACPI SCI and pass IRQF_ONESHOT to it in flags to indicate that the > interrupt needs to be masked while its handling thread is running so as > to prevent it from re-triggering while it is being handled (and in > particular until the final handled/not handled outcome is determined). > > While at it, drop a redundant local variable from acpi_irq(). > > Signed-off-by: Rafael J. Wysocki > --- > > The code inspection and (necessarily limited) testing carried out by me > are good indications that this should just always work, but there may > be still some really odd platform configurations I'm overlooking, so if > you have a way to give it a go, please do so. Tried this on ADL-S and ADL-P systems that I have here and both work just fine with the patch applied. I can see SCI interrupt count increases in /proc/interrupts as expected. Did a couple of s2idle cycles too, all good. Tested-by: Mika Westerberg