Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp305152rdb; Thu, 30 Nov 2023 05:29:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGt8rmfv1pbjtmyY9y6hxsBBn3T9kTDzwW2+ek9CEpPwhYWPgeOxY4zbbVaS4fTZ5bJJ2q1 X-Received: by 2002:a17:902:c408:b0:1d0:1e49:3f60 with SMTP id k8-20020a170902c40800b001d01e493f60mr5431544plk.27.1701350948971; Thu, 30 Nov 2023 05:29:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701350948; cv=none; d=google.com; s=arc-20160816; b=U6Ta56v8ulkUjojcv5ReLxwPUf3rB3SZRdUiWXaY7I8NfpTZB3ra+HHdu43pIrSKWt bk5/vtMpZfBqE7BqFEqDSS9QUHx2sR3hTNWh82jaruP7LVUNk1w7928aZqp12Bd924W1 BWmVFrPhp6ldUJ0TSsxzMTU5HrUiA0u530nkd9l7Dvii8PNkeAZrtgXodXS22Ik9uBEQ r69wQixFXNmBNMQ13vRviKcAQfLkw9cgc4jYkGW4lqR37570gFFDvrkKdyzxaib35fQZ SI/TcjLFSp2tIFx2Zps5dRtsu6LBhTJjI2NiyF9sYfkijxX7UQaGukOMltJMdA94j0WK k5EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=p4tKBk6BUJ34a21Pd1F5QvENRWxVkPRROYwARhGBX3c=; fh=YRe9FQ/aLQgTvvlfi3X/9NaTyEf5yyeBUvqAqyqatos=; b=H8LtYqmsXKCgMKgRyalNNHNBQ+cvuc9LxlEpw4ll1rp1hleWM5VaCmF+iCK63xhNYZ nSEODgQvSW29aNeiytQBtZFnCfs9e5ZhkUiRME4Wqs4OWgQVE5vzKJ36HvLTDEV+sboY ZPHdtZEdiXKJNCF3jdfwSfR4QQ0myHGkuouc9ARDLRXjsCvQPNgaCt9X6tz2uJ7x0/6k +qVDkll7hm21EJdi+o3e7c/X08R75nn6YGDXFWZurEWK8NIzASqWp9UIBkwZ2C93Nnoh GDAx4oDLQ+60QMuhZ8hLxUGAaFW0rGuFzprFgg+8Rhce552MVdXsoz9f1loefi2Mv66o 0g/w== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id z10-20020a170903018a00b001cfdb94ee48si1235052plg.376.2023.11.30.05.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 05:29:08 -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; 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=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7567182A7E01; Thu, 30 Nov 2023 05:29:05 -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 S1345549AbjK3N2f convert rfc822-to-8bit (ORCPT + 99 others); Thu, 30 Nov 2023 08:28:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232169AbjK3N2d (ORCPT ); Thu, 30 Nov 2023 08:28:33 -0500 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCA3610D9; Thu, 30 Nov 2023 05:28:39 -0800 (PST) Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3b89d4be037so157501b6e.0; Thu, 30 Nov 2023 05:28:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701350919; x=1701955719; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UocFr9z4iBYyzRXWEBLNC0QmTk2pcl3A0aXeddwo3SQ=; b=VbZu3znvnO27Ks+92eHrYRlRgs3zUT7rCqpFp7K/vz0bK1FmUYgmqYqfuff1Q9THfU lXVuzcSaLYC/pQslvSzX9TLUOuVgyzXIhUozwsw65eY8TTqrccwSVgKIVXrhhRl8aBwO 7xzZQdg9XKyv9+CAsb6WTAoF4TzDEfwfWDqrxH3vmQdRRMPwh/07UjKEYOzIudCl70fh dGd6GB3rQa+BuUH+LYJbugo8qm0hpHj8cUntTwnEHJkqIWi94WeU3ONliHcgy8n1m5sq x/WmVjbr74iFTnmarwP1za/UwnW2WqFBlDkFVuKKOkFnKm0RfJiqq9Y8dzbtbF3z5C4x tSbg== X-Gm-Message-State: AOJu0YyDR4RCadRzgVEsKLn0qcYWdIWiQhxsWKOyVykIUutthvJ5OE2D PifZj0vARmiCCwvKPbbxEVpvB1dLTavDC+GnjW8= X-Received: by 2002:a05:6808:2016:b0:3ae:5650:c6ae with SMTP id q22-20020a056808201600b003ae5650c6aemr2258178oiw.0.1701350919037; Thu, 30 Nov 2023 05:28:39 -0800 (PST) MIME-Version: 1.0 References: <5745568.DvuYhMxLoT@kreacher> <20231129085600.GQ1074920@black.fi.intel.com> In-Reply-To: <20231129085600.GQ1074920@black.fi.intel.com> From: "Rafael J. Wysocki" Date: Thu, 30 Nov 2023 14:28:27 +0100 Message-ID: Subject: Re: [RFT][PATCH v1] ACPI: OSL: Use a threaded interrupt handler for SCI To: Mika Westerberg , Mario Limonciello Cc: "Rafael J. Wysocki" , Linux ACPI , LKML , Zhang Rui , Srinivas Pandruvada , Michal Wilczynski , Hans de Goede , Andy Shevchenko , Heikki Krogerus Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=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]); Thu, 30 Nov 2023 05:29:05 -0800 (PST) Hi Mika, Hi Mario, On Wed, Nov 29, 2023 at 11:39 AM Mika Westerberg wrote: > > 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 Thanks for your replies and tags! Given the lack of response from anyone else I'm going to move this towards linux-next with 6.8 as the target. Thank you!