Message ID | 20230226205319.1013332-1-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2097693wrd; Sun, 26 Feb 2023 13:03:54 -0800 (PST) X-Google-Smtp-Source: AK7set9w6e54G17IUd3RSQFqGXIImhrnl3zrvYvDzCFFh9G4wGAuctOgFh5mIK3MF0S8FnPZfG+S X-Received: by 2002:a17:902:ab57:b0:19a:839d:b67a with SMTP id ij23-20020a170902ab5700b0019a839db67amr24139273plb.5.1677445433773; Sun, 26 Feb 2023 13:03:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677445433; cv=none; d=google.com; s=arc-20160816; b=vpAena6K4kmYQtj+DvwiN9QYiAnViR32QvGVKeBZkyuyoxqnVyDS7m6Lo4xNKaqh9Q 4VIagxbhBzmAbxVZ6O6kYoripklma16u/29FEeoKt0sN+itUs/9TcpxGmQTxyM1yrhuY 5LKp54hrn1muB5xn/fzd/rn70um+IRbvk6LtOf9Lngg4d07pKAGpsghBZjb46HiU+Ctm Lse5xBN+yZ5KC+z1DRnq/tdn+akrzbPhFMBTjJFOOyN3FvYCNBt28YSS4Npl9LQGo8AK LClBd7snKI3227Nr3yVxuhJqbvHBSqIMp5XFJXIOwp77IlTp3vNaCNVXtgACOuxsIZ3/ 3SLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JR/xaxtSDlKmw7YS+qfiLoBpoTU0MOOpIKaw5YJTCOk=; b=jF7ugLUI2huinEhrTRZpdkrDGbnAh5sF0r0gOvsAjjhNQIidNSga36iissLjcgjnt0 hHpEoI3RGa9+Hk4cgtTj3vKRkP8oyHyoyQ5+z+Gvvn9C83AaP7QX0+akmjOscd5cbbeV ehK+c98p4G+1wyvwSAiqfJEWBeShysAiiFKRsOiaSRPqHp9roI3baA8QV4aT0A+FkwNr huUFGWYjCqGDGEXsg7dlnRLJeOFwX9zLOrcSYU1B2SwlHkkDJiVCfHwKB5bPOKyEVjBE gQ9L7zYQKEGkxH1p1YCH/ACAVsEDVUakpoaz/fKCkDsWJI4Jx3ral8lI2c90vRCmXX+6 xcLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="FW/nKNh3"; 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=amarulasolutions.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kq15-20020a170903284f00b0019aa6d30d64si4951954plb.183.2023.02.26.13.03.40; Sun, 26 Feb 2023 13:03:53 -0800 (PST) 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=@amarulasolutions.com header.s=google header.b="FW/nKNh3"; 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=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229545AbjBZUx1 (ORCPT <rfc822;tertiaryakionsight@gmail.com> + 99 others); Sun, 26 Feb 2023 15:53:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjBZUx0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 26 Feb 2023 15:53:26 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90DD210AB1 for <linux-kernel@vger.kernel.org>; Sun, 26 Feb 2023 12:53:24 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id o15so15533964edr.13 for <linux-kernel@vger.kernel.org>; Sun, 26 Feb 2023 12:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JR/xaxtSDlKmw7YS+qfiLoBpoTU0MOOpIKaw5YJTCOk=; b=FW/nKNh3fHOfReuXwxYmOniq6e6RvXBbrPhgd4uZCkUfFf6UUaNPX5kgCeRlyu3rdT 1b5NYLxxYHp78G7KfPlZXf1MNOgPjirYu8R4Hv3Ze/vU4EGZ+KKagSZ5f0L6uFvatVNv lEny/6gqgd1mPvaeUxKxGJoZj87PoO5h4JhxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JR/xaxtSDlKmw7YS+qfiLoBpoTU0MOOpIKaw5YJTCOk=; b=c/wBFAelkcze9wOeSgIkAa+NDcVEuEj0lkz9s5laWZjxd8bzz2/wZ6y5t0FtLCc/Yt v+XPfyC6WQK+fytb72+upwLnvI/wmOhovHus5KKfNQXozWLRzYEYEWNBrpZ+d6k/39sK JjXgu1fL3UlIWZCCHOhJMVY3vldaUPsu+6dIhR2giPByGISINSTBhsv2Ws2VLhQq37Bz HyIxu5Bnbav6mS363LEjcPPgNm76xyRdNoAhrTqiL4ALw9edBkkFad1Sj5N1helSdDdg pcCu73NE18bRR87emY8fmyvXVJNELWNZmyPnRemQzYDxLpA/YhuyxD3RaAsz/eJ5DL/H s5Ug== X-Gm-Message-State: AO0yUKVIutd8/TcdBzauDI+n0oCf5iU6WlUrO+I0vMhcfX5q3I1Uu3aU Pxuta7lxZ9GfvzRF2KB8NjZnialv9tHwn3ZBj+E= X-Received: by 2002:a17:906:4fd5:b0:878:54e3:e3e1 with SMTP id i21-20020a1709064fd500b0087854e3e3e1mr38571076ejw.73.1677444802852; Sun, 26 Feb 2023 12:53:22 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-82-56-22-12.retail.telecomitalia.it. [82.56.22.12]) by smtp.gmail.com with ESMTPSA id l17-20020a170906a41100b008d5d721f8a4sm2322954ejz.197.2023.02.26.12.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 12:53:22 -0800 (PST) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: linux-kernel@vger.kernel.org Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>, Bartosz Golaszewski <brgl@bgdev.pl>, Linus Walleij <linus.walleij@linaro.org>, linux-gpio@vger.kernel.org Subject: [PATCH] gpio: mxc: use dynamic allocation of base Date: Sun, 26 Feb 2023 21:53:19 +0100 Message-Id: <20230226205319.1013332-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758929022960281462?= X-GMAIL-MSGID: =?utf-8?q?1758929022960281462?= |
Series |
gpio: mxc: use dynamic allocation of base
|
|
Commit Message
Dario Binacchi
Feb. 26, 2023, 8:53 p.m. UTC
Since commit 502df79b860563d7 ("gpiolib: Warn on drivers still using static
gpiobase allocation"), one or more warnings are printed during boot on
systems where static allocation of GPIO base is used:
[ 1.611480] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 1.622893] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 1.633272] gpio gpiochip2: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 1.643388] gpio gpiochip3: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 1.653474] gpio gpiochip4: Static allocation of GPIO base is deprecated, use dynamic allocation.
So let's follow the suggestion and use dynamic allocation.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
drivers/gpio/gpio-mxc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Sun, Feb 26, 2023 at 9:53 PM Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > > Since commit 502df79b860563d7 ("gpiolib: Warn on drivers still using static > gpiobase allocation"), one or more warnings are printed during boot on > systems where static allocation of GPIO base is used: > > [ 1.611480] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. > [ 1.622893] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation. > [ 1.633272] gpio gpiochip2: Static allocation of GPIO base is deprecated, use dynamic allocation. > [ 1.643388] gpio gpiochip3: Static allocation of GPIO base is deprecated, use dynamic allocation. > [ 1.653474] gpio gpiochip4: Static allocation of GPIO base is deprecated, use dynamic allocation. > > So let's follow the suggestion and use dynamic allocation. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- > > drivers/gpio/gpio-mxc.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c > index 9d0cec4b82a3..abc129a88a62 100644 > --- a/drivers/gpio/gpio-mxc.c > +++ b/drivers/gpio/gpio-mxc.c > @@ -462,8 +462,7 @@ static int mxc_gpio_probe(struct platform_device *pdev) > port->gc.request = gpiochip_generic_request; > port->gc.free = gpiochip_generic_free; > port->gc.to_irq = mxc_gpio_to_irq; > - port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 : > - pdev->id * 32; > + port->gc.base = -1; > > err = devm_gpiochip_add_data(&pdev->dev, &port->gc, port); > if (err) > -- > 2.32.0 > Linus, I'm afraid we'll need to do something about this warning, because we're getting the same patch for like 4th time already... Bart
On Mon, Mar 6, 2023 at 11:03 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote: > On Sun, Feb 26, 2023 at 9:53 PM Dario Binacchi > <dario.binacchi@amarulasolutions.com> wrote: > > > > Since commit 502df79b860563d7 ("gpiolib: Warn on drivers still using static > > gpiobase allocation"), one or more warnings are printed during boot on > > systems where static allocation of GPIO base is used: > > > > [ 1.611480] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. > > [ 1.622893] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation. > > [ 1.633272] gpio gpiochip2: Static allocation of GPIO base is deprecated, use dynamic allocation. > > [ 1.643388] gpio gpiochip3: Static allocation of GPIO base is deprecated, use dynamic allocation. > > [ 1.653474] gpio gpiochip4: Static allocation of GPIO base is deprecated, use dynamic allocation. (...) > Linus, > > I'm afraid we'll need to do something about this warning, because > we're getting the same patch for like 4th time already... OK what about reverting commit 502df79b860563d79143be7a1453c2b3224cd836 "gpiolib: Warn on drivers still using static gpiobase allocation" Until we have less drivers with static allocations? In a way it is good that it is fixed, but it's not good if you get snowed under by patches and discussions about this. Yours, Linus Walleij
Le 07/03/2023 à 00:07, Linus Walleij a écrit : > On Mon, Mar 6, 2023 at 11:03 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote: >> On Sun, Feb 26, 2023 at 9:53 PM Dario Binacchi >> <dario.binacchi@amarulasolutions.com> wrote: >>> >>> Since commit 502df79b860563d7 ("gpiolib: Warn on drivers still using static >>> gpiobase allocation"), one or more warnings are printed during boot on >>> systems where static allocation of GPIO base is used: >>> >>> [ 1.611480] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. >>> [ 1.622893] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation. >>> [ 1.633272] gpio gpiochip2: Static allocation of GPIO base is deprecated, use dynamic allocation. >>> [ 1.643388] gpio gpiochip3: Static allocation of GPIO base is deprecated, use dynamic allocation. >>> [ 1.653474] gpio gpiochip4: Static allocation of GPIO base is deprecated, use dynamic allocation. > (...) >> Linus, >> >> I'm afraid we'll need to do something about this warning, because >> we're getting the same patch for like 4th time already... > > OK what about reverting > commit 502df79b860563d79143be7a1453c2b3224cd836 > "gpiolib: Warn on drivers still using static gpiobase allocation" > > Until we have less drivers with static allocations? > > In a way it is good that it is fixed, but it's not good if you get > snowed under by patches and discussions about this. > Well, I have no strong opinion about that, as far as I remember that's more discussion with Arnd that made me think it was the way to go. The Documentation has been saying since 2015 that the sysfs ABI is obsoleted and will be removed after 2020. So are static allocations required at all still ? By the way, there are several other places in the kernel that have had such warnings for years without making any problem, at least that reminds people that something needs to be done. Christophe
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 9d0cec4b82a3..abc129a88a62 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -462,8 +462,7 @@ static int mxc_gpio_probe(struct platform_device *pdev) port->gc.request = gpiochip_generic_request; port->gc.free = gpiochip_generic_free; port->gc.to_irq = mxc_gpio_to_irq; - port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 : - pdev->id * 32; + port->gc.base = -1; err = devm_gpiochip_add_data(&pdev->dev, &port->gc, port); if (err)