From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E60BEECAAD5 for ; Fri, 2 Sep 2022 12:47:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=SfK1uXqz52SxHxn/eFhHP9k0aAFpncxpz3AL5TEjmzg=; b=JVpgmHfBQwYJ+s T+9GCrodSvBYvori6E9tKqRa/X8sz4MRR+zkbIfHtUmelgtjSh+6G4TK56+0bvYuWEgQ4S4C/XfoC n/UfrIWFWSd9nfrW9d23A3G/rUn9MYVBhEbBrt/4kw2NbiRAi3ewE3BR/NMSCJSGGdrCfaj6ytUo7 axWPK+ZbX11KH9QUDyvZcLAtIvz3AkqfZUm2GowJcorr1OQ5s0yx/lMg2VW/V5R5PutPS/zKcu9uL if2/Coj8WBpStpJ52hsW64eG6nhoV1pZfY6nge5C8MWcFKgoHUKHROKGSySR9xOIZADaFoYKhC0sj p1imZxddm5WL8UQCJl+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU63a-004hEa-1t; Fri, 02 Sep 2022 12:45:58 +0000 Received: from pegase2.c-s.fr ([93.17.235.10]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU612-004eoc-CO for linux-arm-kernel@lists.infradead.org; Fri, 02 Sep 2022 12:43:21 +0000 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4MJyHV10X2z9slJ; Fri, 2 Sep 2022 14:42:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uJ9sQ1iosXZi; Fri, 2 Sep 2022 14:42:46 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4MJyHS08Mhz9slX; Fri, 2 Sep 2022 14:42:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E5B4F8B764; Fri, 2 Sep 2022 14:42:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id VkoA-ZwenvJq; Fri, 2 Sep 2022 14:42:43 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.232.39]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C63938B788; Fri, 2 Sep 2022 14:42:42 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 282CgQAm2141483 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 2 Sep 2022 14:42:26 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 282CgJFl2141476; Fri, 2 Sep 2022 14:42:19 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: 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 , Davide Ciminaghi Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org Subject: [PATCH v2 0/9] gpio: Get rid of ARCH_NR_GPIOS (v2) Date: Fri, 2 Sep 2022 14:42:00 +0200 Message-Id: X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1662122526; l=2276; s=20211009; h=from:subject:message-id; bh=uF2ugppKcNYhBb40cETiJzZZ4ufilgv7zNMG29uEExY=; b=33bzuRtpXfVzr2aEXMap91dqdq8rFoHVXSNQn/SkOKB1ryRlNRxHqt8Yx5t2n1U1ccy/P1lg70vi YjCIe8m+D5IxW+CS8NJZzd16LvzBRget8pyV9mh8S+ybvKNGluT4 X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220902_054320_605034_BD138911 X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 512 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. Main changes in v2: - Adding a patch to remove sta2x11 GPIO driver instead of modifying it - Moving the base of dynamic allocation from 256 to 512 because there are drivers allocating gpios as high as 400. 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 Davide Ciminaghi (1): gpio: Remove sta2x11 GPIO driver 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/Kconfig | 8 - drivers/gpio/Makefile | 1 - drivers/gpio/gpio-aggregator.c | 7 +- drivers/gpio/gpio-davinci.c | 3 - drivers/gpio/gpio-sta2x11.c | 411 ----------------------- drivers/gpio/gpiolib.c | 13 +- include/asm-generic/gpio.h | 55 ++- 12 files changed, 33 insertions(+), 509 deletions(-) delete mode 100644 drivers/gpio/gpio-sta2x11.c -- 2.37.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel