Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp101134pxb; Wed, 3 Feb 2021 00:18:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2y1d0xRGplmPJCYXUyc8Tr1FNntRbyTJ/PbobfysC7ymy7/s+ORbWgmOaAfDJK/ZaMn7N X-Received: by 2002:a17:906:b351:: with SMTP id cd17mr2093858ejb.110.1612340314366; Wed, 03 Feb 2021 00:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612340314; cv=none; d=google.com; s=arc-20160816; b=dSOENjSN2FpLKEX08CaWVgiDwPloh1zbTePcQ/XVPaWo/LHi85W2GVcmegYecgBtF2 NbyvXBLKJRMR/lHxbgUqZCo4k05JVPZNc3fMut3hiu6E4+8yWLaagq9ObKSEY7vaZpd+ bvLv73PxiUDBU2rgnIUypWOzEIRnXncDBJ6aXpjDQy4+77bbNnnEqZP57ikk8xGKW+rn S2KQ9sHonG4jsqV67BlIXEd9I03ImRWn0z2Edq5L8JS2HII7kDantg5JurmmUXrGuFgk FE7G6e5UMakn/c3CVg2bZ7/0JB7L3S2pybVvuAtq3u5dTBnoCzhyS/4fQCo339R2CeT2 mUPw== 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; bh=OMNMC+xpp5BmBErZ7DTtHEEdPkb5Qun0a5vbRXVX3vY=; b=If3SC8qXFj4+PltpFrOyRugNZMUPLSoacFmiuWJdfA/f1SLn+pzPZYNpQWXuSxiTz6 9f3lS9nFQB98QWHn/UvC3EZ0rhDIEfLtSOedie1bqegSwGSciLYA0+3Ax4v3jzJKVGZP dGKsmxxx3bENzGlnTQPTi+jdrXNK1b+HqCQX0vB259jAliQunfm+LixHuqFnS8xQKx45 5xxCNqM+P5pP2BASXrMvoFSz4f88STj179c9PYY8pZ2Kxwjm8ydZ0OH2qQP2LHyGmshk J7zZBBCCvsjuGSGgxacmWDGvKZ+7ovZgQamiDzrzatCSlPHuxSp819Pjke9v2WEeKwth 2NCA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gx15si879077ejc.300.2021.02.03.00.18.08; Wed, 03 Feb 2021 00:18:34 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232754AbhBCIQo (ORCPT + 99 others); Wed, 3 Feb 2021 03:16:44 -0500 Received: from mail-oi1-f169.google.com ([209.85.167.169]:33114 "EHLO mail-oi1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232632AbhBCIQl (ORCPT ); Wed, 3 Feb 2021 03:16:41 -0500 Received: by mail-oi1-f169.google.com with SMTP id j25so25937448oii.0; Wed, 03 Feb 2021 00:16:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OMNMC+xpp5BmBErZ7DTtHEEdPkb5Qun0a5vbRXVX3vY=; b=POUgEegnMg7DMDQLrjEjgKdFHfrWjvwj8udpuPYIdEuwBzcLGEv0HtuWkrzYsb+pDp tlN79z4zrt40hE1IYgDWuENhJCz918W/sH0mLMrSfxsLIUyLrgD1qG7lNqjED5724oJH vek8NEL/52PkxUm4zmtpPvZ1hytLDkrzsE8QBafbdBtk5LcR1R7KSuiUicLK7lVTVNL3 9ciUS1rXYHwp0aUL0ZCSx2EtRteN8N4iEXFwIMqHnKFrgkY5ue9Y41RztEzChWmCYyFK AaQJsrG42B8qWF9D7nvj1dNV7KbcqxxUlDs/6kXJ7qrhcdfn40soMnth7hUx5FcUNZuI jXDQ== X-Gm-Message-State: AOAM532Rxdg1AKi+72YhT+dwmLpqXcsKy8bHewPPY+kqkcUr8KdovIZ4 gpUbObOwOqQHnYsxhXfickEFxdI87+QKKGIcF8k= X-Received: by 2002:aca:4d8d:: with SMTP id a135mr1200672oib.153.1612340160027; Wed, 03 Feb 2021 00:16:00 -0800 (PST) MIME-Version: 1.0 References: <20210202043345.3778765-1-saravanak@google.com> <20210202212231.g5tj3f7tv74gagm6@viti.kaiser.cx> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 3 Feb 2021 09:15:48 +0100 Message-ID: Subject: Re: [PATCH v2 0/3] Make fw_devlink=on more forgiving To: Saravana Kannan Cc: Martin Kaiser , Greg Kroah-Hartman , "Rafael J. Wysocki" , Marek Szyprowski , Marc Zyngier , Tudor Ambarus , Linus Walleij , Bartosz Golaszewski , Rob Herring , Frank Rowand , Len Brown , LKML , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , ACPI Devel Maling List , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Saravana, On Wed, Feb 3, 2021 at 9:11 AM Saravana Kannan wrote: > On Tue, Feb 2, 2021 at 11:55 PM Geert Uytterhoeven wrote: > > On Tue, Feb 2, 2021 at 11:44 PM Saravana Kannan wrote: > > > On Tue, Feb 2, 2021 at 1:22 PM Martin Kaiser wrote: > > > > Thus wrote Saravana Kannan (saravanak@google.com): > > > > All of those drivers have a gpio in > > > > their device-tree node, such as > > > > > > > > my_driver { > > > > gpio_test1 = <&gpio1 0 0>; > > > > ... > > > > }; > > > > > > > > with gpio1 from arch/arm/boot/dts/imx25.dtsi. > > > > > > > > The probe function calls > > > > > > > > of_get_named_gpio(np, "gpio_test1", 0); > > > > > > > > to get the gpio. This fails with -EINVAL. > > > > > > And you didn't see this issue with the fsl,avic patch? > > > > > > The property you are using is not a standard GPIO binding (-gpios, > > > gpio, gpios) and I'm not surprised it's not working. The gpio1 is > > > probably getting probe deferred and ends up running after "my_driver". > > > > So my_driver doesn't support deferred probe, as of_get_named_gpio() > > returns -EINVAL instead of -EPROBE_DEFER? > > Converting my_driver from of_get_named_gpio() to the gpiod_*() API > > should at least make the driver support probe deferral, after which I > > expect it to start working again on reprobe? > > The way I understood the API/example, you can't just change the code > and have it work. The DT itself isn't using standard bindings. And we Oh, right. > can't make kernel changes that assume the DT has been changed to match > the code. So, the best we could do is have of_get_named_gpio() return > -EPROBE_DEFER if it doesn't find the GPIO -- assuming that doesn't > break other users. Or have this specific driver remap the -EINVAL to > -EPROBE_DEFER. The latter would hide real errors, too, and would cause futile reprobes. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds