Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4612869rwe; Tue, 30 Aug 2022 13:30:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR79LFnw0eyPlMhaPRF39BKeHkBupj+1gYIwHkJXqk4fepRPqraI8q38Wwus9Tg9W7L+Oc/W X-Received: by 2002:a17:90b:38c6:b0:1f7:35d8:26e2 with SMTP id nn6-20020a17090b38c600b001f735d826e2mr25714619pjb.168.1661891416293; Tue, 30 Aug 2022 13:30:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661891416; cv=none; d=google.com; s=arc-20160816; b=wUuUXToNtysaO1Lkx8iGbry5VNLYDIEhznzLyYqX+XBx8ABj7JmM8vgluENMM2Dr16 4VV62t01DUR9bv5ErPZ1V+MoJLDoturNyho6pgVzaK+a8qCo3C3y1XDG/6JFOAUNJpjn cODKDik4IqiD7qnjkBIsCPKUHqqLSbNf6bB9LrrB2im6RUJ+M4UsgTiVMleCklWUqN7k 2saeWXr2WLyxYn8Zz7pYlVINa+7xNSkBbhs9dNc+md6lgp6RqGTSVFElX8ZysujCzBag 6WYgXUbOUVYxBhgLzd8+vkbVRIJm4BwQOUSFDldAiIw0tWWPBgBBNW9kzOHuLjG12Vez e3qg== 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=Bz05174cqW7AMJyc+1JWBKlip7+1YmmDgJ2cawhFu4c=; b=egP3JOdIxwdNRkGbxIoi6hhIYqIpLFx2S91kwxFiG9+H+kp50QHgyHG9sKblpbUAbU RaQctqs7VFBr7PqE9ZPTIiZwpXOrEQaxe/vNa6Dt/HLtfFiyB38EqkTQZ6MF/FxDZFMO la4OmsFXIKJr6t935YiWauLFnFLNJ/nJujzyHQ1xpnwsIQM253kLJTluwNm2zsAm6AiX 4f17ugZ7BsYTN8l0DV7jdUjEoAQyP9khvscCCr2ZI2KtL97IwdXmWUM+PdorAyUvjt+v zLDMASekrEIaEBI+HUsL4bfOxcU87SsoI85VhmzWV4Wym8yn10Zd0weBb0spdZstb3zu BCrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gj0Nt3Kf; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h70-20020a638349000000b0042ba10f6783si3028536pge.594.2022.08.30.13.30.05; Tue, 30 Aug 2022 13:30:16 -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=@gmail.com header.s=20210112 header.b=gj0Nt3Kf; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231871AbiH3UVM (ORCPT + 99 others); Tue, 30 Aug 2022 16:21:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbiH3UVK (ORCPT ); Tue, 30 Aug 2022 16:21:10 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A83FE74DDC; Tue, 30 Aug 2022 13:21:08 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id g14so9483112qto.11; Tue, 30 Aug 2022 13:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=Bz05174cqW7AMJyc+1JWBKlip7+1YmmDgJ2cawhFu4c=; b=gj0Nt3Kfe7oKlaasQM0+pr69WnfRr6SXKyZpFUQn0OOmPGD1eNeaTX6dGK+w1p6EZV +rDx2cujr94wYsIKWm35MNqcnq7QKByDb2L/4TygQcZOJMDP/+1u6lkcW1PqRr7wTT4T 8vqNF17itYMfobBmaaQOz5N1O6U325tWC+aS/ryAYcPWsVKP607APVOiSR0Vr78DjK50 /3/umVXuzVTQni+o7FativAUOTelebzUmdKQj/Xi8gqXLFc9532TV+i73L+UFR8h9Mq8 XcaZALp7iS4CPOWyozHBGXrsmFn9DrK165/phQSi4/X9I514bj/HqiLq3FQNmVnpHqZ2 B5Fg== 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=Bz05174cqW7AMJyc+1JWBKlip7+1YmmDgJ2cawhFu4c=; b=bgayfL4MHjvXjgmkTNARtyu9aBW7MlHkwujJ5Yuh4n/JSKAb5ggDQ7rF/EYEjezHtr uUq93rkdH4uvQiMT76zLtVifrhyUWdpPuzczSg6ls/83OE73bfnfsbkrYajNapUJnIMV NhpZkZ3ig6GfOW9hbv38XvN2w4smVEPmEeh9dhnU/1EXHP1Qb9V1p60IfJaryah9ZBaA wm4OtpWOzn/uZ8ZinZ1VQltpakPOAEKEGDYULObK2BnpC/ToWC4EdZrhwYpgw4zcn4kb OBI5TW6JtxRJjeULAmQjW7Fj6r/2/3YZ+a1cecJW8xJ2ZXWPz93k2XyvnOFiqDMuRkaX JZjA== X-Gm-Message-State: ACgBeo3uaR2ZSu0Swo3t4KjagvarqRF+yZvOP/fWcE2a+yOaBTr7ElF4 bnWAgWNJW7nYN4IE1Xni6zXP1yrev7P6UvHGjXE= X-Received: by 2002:a05:622a:491:b0:344:95bf:8f05 with SMTP id p17-20020a05622a049100b0034495bf8f05mr16412498qtx.61.1661890867719; Tue, 30 Aug 2022 13:21:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Shevchenko Date: Tue, 30 Aug 2022 23:20:31 +0300 Message-ID: Subject: Re: [PATCH v1 0/8] gpio: Get rid of ARCH_NR_GPIOS (v1) To: Christophe Leroy Cc: Linus Walleij , Bartosz Golaszewski , Geert Uytterhoeven , Keerthy , Russell King , Arnd Bergmann , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Catalin Marinas , Will Deacon , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , linux-arm Mailing List , Linux-Arch , Linux Documentation List , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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 Mon, Aug 29, 2022 at 7:17 PM Christophe Leroy wrote: > > Since commit 14e85c0e69d5 ("gpio: remove gpio_descs global array") > there is no limitation on the number of GPIOs that can be allocated > in the system since the allocation is fully dynamic. > > ARCH_NR_GPIOS is today only used in order to provide downwards > gpiobase allocation from that value, while static allocation is > performed upwards from 0. However that has the disadvantage of > limiting the number of GPIOs that can be registered in the system. > > To overcome this limitation without requiring each and every > platform to provide its 'best-guess' maximum number, rework the > allocation to allocate from 256 upwards, allowing approx 2 millions > of GPIOs. > > In the meantime, add a warning for drivers how are still doing > static allocation, so that in the future the static allocation gets > removed completely and dynamic allocation can start at base 0. For non-commented (by me or others) patches Reviewed-by: Andy Shevchenko For the patch 1 if you are going to address as suggested by the author of the driver, you may also add my tag. > Christophe Leroy (8): > gpio: aggregator: Stop using ARCH_NR_GPIOS > gpio: davinci: Stop using ARCH_NR_GPIOS > gpiolib: Warn on drivers still using static gpiobase allocation > gpiolib: Get rid of ARCH_NR_GPIOS > Documentation: gpio: Remove text about ARCH_NR_GPIOS > x86: Remove CONFIG_ARCH_NR_GPIO > arm: Remove CONFIG_ARCH_NR_GPIO > arm64: Remove CONFIG_ARCH_NR_GPIO > > Documentation/driver-api/gpio/legacy.rst | 5 --- > arch/arm/Kconfig | 21 --------- > arch/arm/include/asm/gpio.h | 1 - > arch/arm64/Kconfig | 12 ------ > arch/x86/Kconfig | 5 --- > drivers/gpio/gpio-aggregator.c | 8 ++-- > drivers/gpio/gpio-davinci.c | 3 -- > drivers/gpio/gpio-sta2x11.c | 5 +-- > drivers/gpio/gpiolib.c | 13 +++--- > include/asm-generic/gpio.h | 55 +++++++++--------------- > 10 files changed, 36 insertions(+), 92 deletions(-) > > -- > 2.37.1 > -- With Best Regards, Andy Shevchenko