Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8448484rwr; Thu, 11 May 2023 01:06:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IWTKnY6bAGnPoBzF7U8ZRXQ3m0AdeLBKvbPzkyEXvwxzBVdFA0OVfn7A/UkvLvnFx12+5 X-Received: by 2002:a17:90b:120d:b0:24d:f1b1:4bea with SMTP id gl13-20020a17090b120d00b0024df1b14beamr29058231pjb.0.1683792414718; Thu, 11 May 2023 01:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683792414; cv=none; d=google.com; s=arc-20160816; b=b4DR/j0VQgNNf3+iDNw5zFFK+pcpo1vnDHbhkPFTjGBlAGGLHck4YKsmC9byhPY+xs 3VhWy8ms8IXaqYiyyxSe6e6w1Ax8mTKL/zIOwAlMLgMN7MSi/yY7wW8jTUQIgkfRzAeY 1XbjR4vDqswaTfIRb391FkyychWiQIYc4Lrno2zAt4yPzjbq/DwysM61p60ijca18slU 0GQg8KJSMv9jQ11aH5zwole211IApP42XLpTCv4tZHvPS27SwUuFSZctgNybRmC1Nqdp 3/b9D/HX/41wszhD2cbUwZb1T+zWNEqvCr9lY9Tcw3T6NNxk9ILGZ/bD6za83G86amDw kz+w== 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 :dkim-signature; bh=McUfZXxoyN68Pz8/SqIaHkQ+qaI7jQjXaWVxB70Fbm4=; b=G/S8ohQxgvdGcvDf3L1Ro8uMaI3S1sghnZOwZfTm9qVSBfmwk3P3uDpabFx5ifWyIX BD5iJCBIhmpNlM1VYoS8WxAk0CdcjFF7fw/TWJtyG1kpv/B4J1K6qEdXQ5tTq+KgBgDj SbA/tOzvB0bOxF3YZ400o7stSpG18AMq5jMWWsz02KHmfVc0sXLt/nnhTwwXdGawNLIf I8uOQm7AvKEH4i9qa0vk3IZzlITqv9HJjkhxXs1bgFozFR0puNiFDQgdpm/jZF+IjRps lRgi8BiV3ZGiHq/III7tiK8JVUz6CtxqAV0ebSnesEsLkA/y6+C4cuP/yDf+4s8uPP+b V6qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ie57tBLP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h88-20020a17090a29e100b0024e10a1fe16si19051750pjd.105.2023.05.11.01.06.41; Thu, 11 May 2023 01:06:54 -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=@linaro.org header.s=google header.b=Ie57tBLP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229538AbjEKICp (ORCPT + 99 others); Thu, 11 May 2023 04:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231629AbjEKIBN (ORCPT ); Thu, 11 May 2023 04:01:13 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1314D59E6 for ; Thu, 11 May 2023 01:01:10 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-b9a6f17f2b6so39922538276.1 for ; Thu, 11 May 2023 01:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683792069; x=1686384069; 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=McUfZXxoyN68Pz8/SqIaHkQ+qaI7jQjXaWVxB70Fbm4=; b=Ie57tBLP0SjAU+q9HkRqXH7w1Ak/h2UMEEx8u1HKC/qxYM2FqDgcksZr9LIsYNWUsl 1OdWVQEMUvPnH0x/W01FXT4sZ0HV7RlstJTxL93uNhfbp8b2uWZtzvExkv2Bq84J0Xdx E7M7vQK5HDjsRQYBSVSBZlV9ajH4qqBTy+xtP2nZ+hnYo/hPjqejkIKIuJlpJ4femakR GnT2CcNFg2SFwMnjdsT9tYJDIREBVSPB8aGgt2EGKdLe3Q1RPbLqoRGObo9z3q4PY/+c ebpTl+aHx97sPkYebtmGUQpug/RUHQ7pXaGzmtX1F+0dnavV4WhjNE3ASyqg8WjU3AHv u5sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683792069; x=1686384069; 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=McUfZXxoyN68Pz8/SqIaHkQ+qaI7jQjXaWVxB70Fbm4=; b=eq+hyTjUfUjtagFTctbA8z+t6kmjNwICeeWpo4SLxd4A8DvRMXnBFodA6ohXWW7Gud uDjsMChil6lGvn1IJWHo2Eid01CtUWMfFOC/FoAQuL2E8j1Tjpcv59LFr23gUG+gyYnR wDCikmCszNLgg3PjERU74wdvu5AwEJJonJH17RaLcWKkUyuzFzIH6uujVReWr/Y9/00I YqqOYZiCs9/NJaOF2M2u1MVBcbnyrbBDYB8o3qPNYvhq/3zIDsJUivRF8IBsM3hHRP3c crNTEPO3YFpe+cbhokk0N8mtXSqwXpWQsOsTjKYJxbKYSuO+N/GqnZ6j7a0BvO3ODhoj 2n/Q== X-Gm-Message-State: AC+VfDxoJGeQhpwvXsnT8mC0c/DUoVaVfS4JSKPDXlYtgg7TctRoktGo dxvJD94bOvFCvygUTiT+4qbcZu2Cgp+NudVDBicdUA== X-Received: by 2002:a25:24b:0:b0:ba6:956f:22d0 with SMTP id 72-20020a25024b000000b00ba6956f22d0mr1765478ybc.2.1683792069275; Thu, 11 May 2023 01:01:09 -0700 (PDT) MIME-Version: 1.0 References: <20230510001151.3946931-1-chris.packham@alliedtelesis.co.nz> <760ae58f-cb0b-dfe6-9e24-664310651e18@alliedtelesis.co.nz> In-Reply-To: <760ae58f-cb0b-dfe6-9e24-664310651e18@alliedtelesis.co.nz> From: Linus Walleij Date: Thu, 11 May 2023 10:00:57 +0200 Message-ID: Subject: Re: [PATCH] gpiolib: Don't implicitly disable irq when masking To: Chris Packham Cc: "andy.shevchenko@gmail.com" , "brgl@bgdev.pl" , Ben Brown , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Marc Zyngier , Hans Verkuil Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 On Wed, May 10, 2023 at 10:59=E2=80=AFPM Chris Packham wrote: > The coupling of gpiochip_irq_mask()/gpiochip_irq_unmask() with > gpiochip_disable_irq()/gpiochip_enable_irq() goes back to the same > commit a8173820f441 ("gpio: gpiolib: Allow GPIO IRQs to lazy disable"). > It's not immediately obvious to me why the coupling is needed. That is just a refactoring of what existed before. The use case is here: drivers/media/cec/platform/cec-gpio/cec-gpio.c The driver needs to switch, at runtime, between actively driving a GPIO line with gpiod_set_value(), and setting the same line into input mode and listening for signalling triggering IRQs on it, and then back to output mode and driving the line again. It's a bidirectional GPIO line. This use case yields a high need of control. > I was > hoping that someone seeing my patch would confirm that it's not needed > or say why it's needed suggest an alternative approach. Which IRQ-enabled gpiochip is this? Has it been converted to be immutable? I think that could be part of the problem. Yours, Linus Walleij