Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2782884lqp; Mon, 25 Mar 2024 09:05:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXouTxcR51Wl5YWoGQJtw0ebLko8RxQe3uY1siSjrQbA+lX/t4JhrPLgUViDeqFg17HZ9GZ0oycEog0wCgOxlPhC0zz/FE7cS91WlBVIg== X-Google-Smtp-Source: AGHT+IF8lx1+PFTvDyfmQXwFVO+dJrXhPQcecI4c4YwQOf+pji96nUswQv6AKVxOEzcLTEEici3K X-Received: by 2002:a05:620a:56d8:b0:789:fe9b:3321 with SMTP id wh24-20020a05620a56d800b00789fe9b3321mr330069qkn.17.1711382741164; Mon, 25 Mar 2024 09:05:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711382741; cv=pass; d=google.com; s=arc-20160816; b=X9PHVRoSJUkV6VwiBnwJoha+VaFeZDK//pOLBqe7ekoMTPUR9W8QbVjQ/ZgHzeErgU 7j1N5Z9ZTxKZl79pvetX6Y0iLDRWzHhTO868NlCGA55Damm0GEnbEskBrag7usGBwMLX nbQIvn9p6lNLkm+kv20LqBlUd0oYPVFL2YPBDcqgL5QDsCXlmxtr/LtH1EndeW7ypee7 PCPviCovPNEofvdvRtMZGnW5HYiOWuKIDWuoAhfKBmqs9fQy0RlCCureXPzzRwz8XmrW lcomu4RJdmvjiDa5Sv1T5ioAHiZxuRrEeSoaJVAJHODJ2ZBAOtLDMdzhlDW4BdftUwrK Jxxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=OjrucB3wBbhQAMSDiYU110V4Jry+ELeXdh9amzt/biA=; fh=oXlpZxtQB6QMCnCVbPUo3/jGR4naL70wlx0GoY88by0=; b=CerZz4D7dxO7g1Ye0COuuGEdKApfhbkLADDlm27v78cTO0uiT8JrldeZKU/3hPXHeJ v1l3/OjUZnieO5RAMEdH+GVp/D6q7ARdgTSdKR+5fnKbwRLVMEHQfFqO0Ft/SLb+2E63 pljAa2+tbrFLlxWxNQxXicKei0ZF8BJ1tKVWIulAgq93y9rWJCANdWDpogpvCPEBiSza t9kFXMXtdrVgvDDav+1ifuisUnSJCnKm2ErWsScMiLlZYd5mqppMB+FcKwPscO4mVX99 y1LWmYbPhiiFa7scbnOi1Wxadp9S/j/D39gqzRjJeUnxVp9kk8PSpp0IjYDXXCRmD/YH paIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WY/AsTSe"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-117149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bn12-20020a05620a2acc00b00789f986b558si5590682qkb.60.2024.03.25.09.05.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 09:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WY/AsTSe"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-117149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E05241C3A618 for ; Mon, 25 Mar 2024 15:57:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60E6B4E1A2; Mon, 25 Mar 2024 13:31:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="WY/AsTSe" Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C29F54CB54 for ; Mon, 25 Mar 2024 13:31:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711373518; cv=none; b=PTxmHiiQjRQRzDs0WrmhwUtqzKutch9PCQv8FmqUtJQliSMLgKw6TwDl1DdJLPt1oZCqpGUfU9YZUG0V5Od3QCxxNl6C9oIpUqyBqmhSmbU2BVNUBgzxEEKRg/sKdioW0o3BGZHcMPrAf/2xP8ngPHqnta2hLpIV28lcrPAq9ig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711373518; c=relaxed/simple; bh=Noq9HJ+sO7FD5O4+z0BIm08ek7Wa19Uq39LkX/oIuTY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=JngMddQ1FKlkZokDXehO4d3BdpoNzE+7dk0WyfFuhTfG7PFquY+OElzYGfW8/ns+Y5rVYgstIBVdvd5vDfL24hOYwxSpubsf1duc2LlXACRAEuPBBvf7ZrSGa6iNPa98OZhmtUDKIItEFLqQ16NCVg2GmOeStTBFGqUnUXGRmA0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=WY/AsTSe; arc=none smtp.client-ip=209.85.219.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-dc6d8bd618eso4163515276.3 for ; Mon, 25 Mar 2024 06:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711373516; x=1711978316; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OjrucB3wBbhQAMSDiYU110V4Jry+ELeXdh9amzt/biA=; b=WY/AsTSeQv4Fmk7STSmBBvYrNa4tiyMrMwMaDjk6316K0lJgcITZWk0udGfkPaFy/Y bER5v541q6lDkrXFASVu8MmgqKKC8RUEmsLVvV7Eip5QgvJjOI7r9JGwliXH37UgGdM3 u0pn+2MKXPTzwqfxo0MHTDcbLmMZ8esKqFk1HE/Kj07zkgZkb9jeWLGlV8HxcfO8JgA+ QAWwNCgn0N07CVhS2qvBdMfixiuouFLI59sEVOZ60sh1ukYR1qlP6LeIhWwTv5GRT55p wE1PtKFrP73TLEwOj1HJhS/AOVWkhfr75NsGqmvCO+POb9kcwt7jDC0ITxHPPfSxDMMG 2Y3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711373516; x=1711978316; 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=OjrucB3wBbhQAMSDiYU110V4Jry+ELeXdh9amzt/biA=; b=NqoEcjU+q00R+SE/+9d44YekcIdOD8Rj38YqkL4b+/do007IzVNBgc9fGXQQGudNv6 YMIix7UK/SCPYnVASN5I3xQqEXS04M+P7teYzTXdR/tyIay0Bmlnsr1NR5bG74ieIxPZ mdsrh/zraCBO0aN7sNN21TbYXtFoSDLykVEIizVOziNdhGzwuWpILAHpPShOYzW++Dov BIw+YE4w1ULnPDTthEJumUNXE4AZfh+qc8Zvu1E0jp8v2AjoY4BDZysnYncnKeOMZ6Zf 9W7iGy7vA7a2Ifh7cCXvVvzxKXjULoqYtQgI2sglG0RpRqltoqW13dFZCtJ2EDtGLYeY LFVw== X-Forwarded-Encrypted: i=1; AJvYcCXkSIXP7mk9DhGEh5QPAVRIq+q8kKkSgzYQXRBbtuLJ5MWMvydKD30okTMkGD3aykuIZzLZYic4lSrIQ0hxiT1vyUPnnd/+1PJkX2p7 X-Gm-Message-State: AOJu0YySC/JpBqXdUjxu7nUdF6Agt+pu5/sA/xGFd+AQ4/UP4APlN/5F R6oZ5itng4dKzTXfSkIB7LhycZYXCx9wKMkJwCgP7+ui2dvknhsEss+H07MuLdlGG/8ySt2UiBI SbL2qowGN+CcBJGUCGa7Ef9zjTGCwGQv+dLDgjw== X-Received: by 2002:a25:c582:0:b0:d80:68d1:b826 with SMTP id v124-20020a25c582000000b00d8068d1b826mr4994709ybe.6.1711373515809; Mon, 25 Mar 2024 06:31:55 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <12417336.O9o76ZdvQC@kreacher> In-Reply-To: <12417336.O9o76ZdvQC@kreacher> From: Linus Walleij Date: Mon, 25 Mar 2024 14:31:45 +0100 Message-ID: Subject: Re: [PATCH v1] irq: Introduce IRQF_COND_ONESHOT and use it in pinctrl-amd To: "Rafael J. Wysocki" Cc: Thomas Gleixner , "Rafael J. Wysocki" , LKML , Hans de Goede , Linux ACPI , Francisco Ayala Le Brun , Mario Limonciello , Adrian Hunter Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 25, 2024 at 1:58=E2=80=AFPM Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > There is a problem when a driver requests a shared IRQ line to run > a threaded handler on it without IRQF_ONESHOT set if that flag has > been set already for the IRQ in question by somebody else. Namely, > the request fails which usually leads to a probe failure even though > the driver might have worked just fine with IRQF_ONESHOT, but it does > not want to use it by default. Currently, the only way to handle this > is to try to request the IRQ without IRQF_ONESHOT, but with > IRQF_PROBE_SHARED set and if this fails, try again with IRQF_ONESHOT > set. However, this is a bit cumbersome and not very clean. > > When commit 7a36b901a6eb ("ACPI: OSL: Use a threaded interrupt handler > for SCI") switched over the ACPI subsystem to using a threaded interrupt > handler for the SCI, it had to use IRQF_ONESHOT for it because that's > required due to the way the SCI handler works (it needs to walk all of > the enabled GPEs before IRQ line can be unmasked). The SCI IRQ line is > not shared with other users very often due to the SCI handling overhead, > but on sone systems it is shared and when the other user of it attempts > to install a threaded handler, a flags mismatch related to IRQF_ONESHOT > may occur. As it turned out, that happened to the pinctrl-amd driver > and so commit 4451e8e8415e ("pinctrl: amd: Add IRQF_ONESHOT to the > interrupt request") attempted to address the issue by adding > IRQF_ONESHOT to the interrupt flags in that driver, but this is now > causing an IRQF_ONESHOT-related mismatch to occur on another system > which cannot boot as a result of it. > > Clearly, pinctrl-amd can work with IRQF_ONESHOT if need be, but it > should not set that flag by default, so it needs a way to indicate that > to the IRQ subsystem. > > To that end, introdcuce a new interrupt flag, IRQF_COND_ONESHOT, which > will only have effect when the IRQ line is shared and IRQF_ONESHOT has > been set for it already, in which case it will be promoted to the > latter. > > This is sufficient for drivers sharing the IRQ line with the SCI as it > is requested by the ACPI subsystem before any drivers are probed, so > they will always see IRQF_ONESHOT set for the IRQ in question. > > Closes: https://lore.kernel.org/lkml/CAN-StX1HqWqi+YW=3Dt+V52-38Mfp5fAz7Y= Hx4aH-CQjgyNiKx3g@mail.gmail.com/ > Fixes: 4451e8e8415e ("pinctrl: amd: Add IRQF_ONESHOT to the interrupt req= uest") > Cc: 6.8+ # 6.8+ > Reported-by: Francisco Ayala Le Brun > Signed-off-by: Rafael J. Wysocki > -#if !defined(CONFIG_GENERIC_IRQ_PROBE) > +#if !defined(CONFIG_GENERIC_IRQ_PROBE) Is that some whitespace fix? Not that it matters to me, so: Reviewed-by: Linus Walleij I expect that Thomas want to apply this one. Yours, Linus Walleij