Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3965275pxb; Mon, 4 Oct 2021 13:53:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIz1AkG2plZEFQVn6tvhjTvi/eDG60gvmZrZJOiS+9WoePLT13tt4PNxwd9ObGQw0PLRic X-Received: by 2002:a17:906:6c84:: with SMTP id s4mr20375409ejr.121.1633380817575; Mon, 04 Oct 2021 13:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633380817; cv=none; d=google.com; s=arc-20160816; b=VhBPPkHHJiYy9yjW86VU0E1HZPk4Oh5jksxTyypBYELKAn+/A0C7j4e50WwZHTfkvY GXiiKJ4jsFgTAbK6CyIQT2hdCqvneh/SI7iaPVoG/FPA/yXKDJTZ4v55rOyVxrzbDlT9 +w5dTvuI5XYsIdUFIgtIQUAqUte1SdmsG3ID4EfjF5bbtEEt7LuK+SuLGGS18U2+WVqR WtKrfb4CoxcTLAv3+10YexTbe8m1WVINmayCPq2jVa8BgfTVhW14yVctmPunGCxrQOKj VxTLNYep1Z9lMUD7814ol8xGgaSjUeC0+HpLPNJYN/OAo19bLg/5GkFdctaL3zdUxp6c vXuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Oz9vve8zThdv/wPK7/DByuqhiCMubVfBEBzCDs6tqrs=; b=C17WUFKphcpMx8tQESv5PJ1v3ltTGF5c/aJTE2zPH+sdh01ZVMSEVy3/ifyB0aGc/W 55/lMhL9iukyfBn76vAJLn1D1Jm6U92zU2aNLh7k6yTRg86/qJcowMiB/DHkG5Mx+oC2 Ud/Cmil+e0m5vTWmV9S0zLotB6xHiSUv6hSTfX4UCUeJo+VAgwFLsfhHM21nFuKOn3R9 rryo7lJadCxpC6KTGbgWEFsT2NJ5BDozyx5PP5m99FrPzUvJy+H5WHvOLoXhFfRnBKWZ hAEJTLBxbwecvIRFzFC9Mgsurf4OSxjwQnw7A4Omf2MN3NZyHTOV28RCjKrgCPmNSln5 GdQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=m6AMYsE8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ah18si3785647ejc.329.2021.10.04.13.53.07; Mon, 04 Oct 2021 13:53:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=m6AMYsE8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234838AbhJDNvC (ORCPT + 99 others); Mon, 4 Oct 2021 09:51:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237779AbhJDNu6 (ORCPT ); Mon, 4 Oct 2021 09:50:58 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B0DEC077848; Mon, 4 Oct 2021 06:21:32 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id z20so13370053edc.13; Mon, 04 Oct 2021 06:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Oz9vve8zThdv/wPK7/DByuqhiCMubVfBEBzCDs6tqrs=; b=m6AMYsE89oo56yvenoWJ5bhL0vlQJeSsBI3wfBZ8GcyyJCXpFQhNNniTO5Q+wWhbs0 aKNVi77NhYG2SiPMcCCiQUaSQ2prjJiUw6ieb2F8QLEIw3In7fZElaHwt7x6z24LBVLC Jm+6+Ci1NHBdT9ksTYlKWeMCFqpiHFoaIuDly/KZ5zysTnxLc3b+NkBdb5uXfUkY3kN9 cGDowUlx2ZE92sr/pBEda83jPMMit5++C8vIxgHz8+Xa9ve+O3V8Nmw6CjGvulKFq1MM w0vSlT53Txdy6PG7YlRbhdF90Ycdw09c1fx5xci8Z/67rJ5ouIwHz4R12wyY//88W4JG H1+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Oz9vve8zThdv/wPK7/DByuqhiCMubVfBEBzCDs6tqrs=; b=d9+xvStUg3VRZtdfcIfNsn7IF4KjK1dR4ilefHCfRd8GjJIDRH2CqvFNI95yfPNQeh WViTGtdqAORT2rdtwWcjIZW1yMqx7jiNBWMzzxmf8MCIkktIPqxqja05dnUL0oXFgrOp z8UM/IX5gWoaWbDXjOnT/XPenQwhSEK0QzlhwWaMeLb1dbrh5XdH+wHwGgEDsdQ/piy2 AUndoXbBUsIpThi0IhiK2zorZCyYhZbPy2pswvcM+dExqD6f4VhP6qs3SitAwms24yVZ X3pHBPbTaX5XGr555UwPPnf8UhBkZIucmn35g4rDGfDnC2U0gD9n4ufZKjXuN68myuBR pciA== X-Gm-Message-State: AOAM531hLwfHzW1hys//XI/YvNo3bYjd59ydCbwmxxuXJevblHv9lFgq vF12nMnMFN1xRCp2wPWiTjg8zUaAGQrDfLOf0YGEQdaIX+4= X-Received: by 2002:a50:e142:: with SMTP id i2mr17841867edl.107.1633353666627; Mon, 04 Oct 2021 06:21:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Shevchenko Date: Mon, 4 Oct 2021 16:20:30 +0300 Message-ID: Subject: Re: [PATCH] gpio: aggregator: Add interrupt support To: Geert Uytterhoeven Cc: Linus Walleij , Bartosz Golaszewski , Viresh Kumar , Enrico@rox.of.borg, Weigelt@rox.of.borg, metux IT consult , Andy Shevchenko , Arnd Bergmann , "open list:GPIO SUBSYSTEM" , Linux-Renesas , Linux Kernel Mailing List , virtualization@lists.linux-foundation.org, stratos-dev@op-lists.linaro.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 4, 2021 at 3:45 PM Geert Uytterhoeven wrote: > > Currently the GPIO Aggregator does not support interrupts. This means > that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(), > and userspace applications using line events do not work. > > Add interrupt support by providing a gpio_chip.to_irq() callback, which > just calls into the parent GPIO controller. > > Note that this does not implement full interrupt controller (irq_chip) > support, so using e.g. gpio-keys with "interrupts" instead of "gpios" > still does not work. ... > @@ -414,7 +421,8 @@ static struct gpiochip_fwd *gpiochip_fwd_create(struct device *dev, > for (i = 0; i < ngpios; i++) { > struct gpio_chip *parent = gpiod_to_chip(descs[i]); > > - dev_dbg(dev, "%u => gpio-%d\n", i, desc_to_gpio(descs[i])); > + dev_dbg(dev, "%u => gpio %d irq %d\n", i, > + desc_to_gpio(descs[i]), gpiod_to_irq(descs[i])); This is an unconditional call that will allocate the IRQ descriptor even if we don't use it. Correct? If so, I don't like this. -- With Best Regards, Andy Shevchenko