Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2316417rwb; Mon, 15 Aug 2022 03:13:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR5z6eeF9g4GK3AWA/AO0nq7tFYEg/f71rQNvyJt/cFPatQwQgBHI+r0iMK+S5FnV27hnv9V X-Received: by 2002:a63:8049:0:b0:41b:e8db:d916 with SMTP id j70-20020a638049000000b0041be8dbd916mr12968144pgd.40.1660558404679; Mon, 15 Aug 2022 03:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660558404; cv=none; d=google.com; s=arc-20160816; b=JXpAJyjIGVPYZjIMyT7l5c5f4aEo3vT8yIbEwPY38d2Hkr/qCuhefr4ZgnfyD8LGT6 O5ld8kzUO7H1H2olljVFP+z+szZM7gix4AK96zyRttpIsVAQlYzzOyLFl0GpUntcK7at VviJKzjUvZlNGPY84VWXYaVUG46dg6pUdi3vQdw08um3eXAzEfiwVjTiTMtW9gt0QPcR wvxW4EyxfiCkt9WnaIjmKTcR4lsG++DgepqQJdLH0EflMmKv3PWgs2+H9zeZiyY+ELqb ns/nMYbsT7L1GPSxiBmcmOniUv1Q4NRuhC67tUHk2dvywV0nZXUS96rFo9AZcIlX33X2 Luzg== 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=r1NsrzieKJbz0xeysq9ijMttBXf0JDgLn0ohifJ6FV0=; b=001LPATaZqHeb2ZUK8tfoX9BncjzBno5baNEARGDD97f0AlNGLBpEHDlZKXrgaoPSv tNBXsgR0Eur2YQTM6nWh/4FdDPINvCWls2d9FyVV/br9V6z5re29CNHStoDwokO6qMEv 1XTUBMPens375sRdcwHugZcH+cYQI1U8u5tcSmk19Ywo+kQyqpQgNYUhRbw/1pJoDJ5H 3cZbaojCRXEpdT7XNOZ1vwY5Fh2M84Ku0KPVfBfGnqxj5NuYRQMNaW5OxMlowlz+CXCl O5JTWDCQGc2Yj53chthyR/jJwsbjclAJDVy9eIZqN/3P25ZfMubcR7zvdnWR5AaphoiA pGfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=gFptx6rd; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h6-20020a625306000000b0051c10b55b92si9243476pfb.187.2022.08.15.03.13.14; Mon, 15 Aug 2022 03:13:24 -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=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=gFptx6rd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242219AbiHOJ5o (ORCPT + 99 others); Mon, 15 Aug 2022 05:57:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242216AbiHOJ5m (ORCPT ); Mon, 15 Aug 2022 05:57:42 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 836A61CB2A for ; Mon, 15 Aug 2022 02:57:41 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id y13so12636064ejp.13 for ; Mon, 15 Aug 2022 02:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=r1NsrzieKJbz0xeysq9ijMttBXf0JDgLn0ohifJ6FV0=; b=gFptx6rdf1WmUqIRWVe+56U/Fl2x7Vlevj+kn9aSdpUpmlTGT8zizF89evlAIXSLr0 qcp4N/y8VKls98M6J9BBaplfbsqSiDbFZuWf/4hACiKKSOAj6QuMMsxoRfyLjRCS5ynX BWgAPx00uVspe9NbSXzukFJptl4K6fbbFVi56ECvPsX9N45wwEt6GA7TRgYueiGoIbMe N4YA5FtvIMKaIU/XuIm+47VmJ99k7WMAhXmNwaVK1qMMcmUI18SymK23LPQ4RCIGRy2p 627xhWBGUoql2p8Lz/bjmhKdXNE6u+YdFOiEN7OT2QnaPqX9PwFExEDljV42PTk4A6EH Nk/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=r1NsrzieKJbz0xeysq9ijMttBXf0JDgLn0ohifJ6FV0=; b=aYE9zHqZ70uoYCFW/CiFerskrauyucZ4I88+EnhlVndCBzWzWwGWQQ6TDN7eVGWNFq vDWwfljfE1KF02Xod/xHbkD8CG2wdTKloGOR5+hXUamKpt9XMaCmHTpjv7dPdWaVxwqM GGndJC9qBQ5qoC3hWzeRNAmGj3CaqlYLuDq2EWPUNIvp4vziDe+FNaR79O+UH9eOhnDo hPJmY4WhKsWlOy0CwzO6w5pDFauQ3rJi0Gto/toLjmloud0DW7PhiWZH6E/bGlh+Xc8Y xUgeAWsAeoPW+Nz4BGCuvGlSs0uysM2l7Vf66jg/BjcHQ0tNlRZbPBiA1a1W4ApaxieI GiWw== X-Gm-Message-State: ACgBeo1HM0LcOhNaogOD8icTNeFf13cEbub1X86964vBlJvwU5ZCS3jj XxSL8hAR1w+gjZm/ziQ56l4PB4RATpxvtQtNdZUF3t1BzkKhUQ== X-Received: by 2002:a17:907:7254:b0:731:61c6:ecf9 with SMTP id ds20-20020a170907725400b0073161c6ecf9mr10009999ejc.101.1660557460076; Mon, 15 Aug 2022 02:57:40 -0700 (PDT) MIME-Version: 1.0 References: <20220810060040.321697-1-saravanak@google.com> <20220810060040.321697-5-saravanak@google.com> In-Reply-To: <20220810060040.321697-5-saravanak@google.com> From: Bartosz Golaszewski Date: Mon, 15 Aug 2022 11:57:29 +0200 Message-ID: Subject: Re: [PATCH v1 4/9] gpiolib: Clear the gpio_device's fwnode initialized flag before adding To: Saravana Kannan Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Linus Walleij , Rob Herring , Frank Rowand , Geert Uytterhoeven , Magnus Damm , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Len Brown , Abel Vesa , Alexander Stein , Tony Lindgren , Sudeep Holla , Geert Uytterhoeven , John Stultz , Doug Anderson , Guenter Roeck , kernel-team@android.com, Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , devicetree , Linux-Renesas , ACPI Devel Maling List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, 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, Aug 10, 2022 at 8:00 AM Saravana Kannan wrote: > > Registering an irqdomain sets the flag for the fwnode. But having the > flag set when a device is added is interpreted by fw_devlink to mean the > device has already been initialized and will never probe. This prevents > fw_devlink from creating device links with the gpio_device as a > supplier. So, clear the flag before adding the device. > > Signed-off-by: Saravana Kannan > --- > drivers/gpio/gpiolib.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index cc9c0a12259e..1d57d6f24632 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -522,6 +522,12 @@ static int gpiochip_setup_dev(struct gpio_device *gdev) > { > int ret; > > + /* > + * If fwnode doesn't belong to another device, it's safe to clear its > + * initialized flag. > + */ > + if (!gdev->dev.fwnode->dev) > + fwnode_dev_initialized(gdev->dev.fwnode, false); > ret = gcdev_register(gdev, gpio_devt); > if (ret) > return ret; > -- > 2.37.1.559.g78731f0fdb-goog > Acked-by: Bartosz Golaszewski