Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2086588rwe; Fri, 2 Sep 2022 08:17:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR42kzzUdTv2J4BuRxnH7ShuMNzjsCCMcG7VuYi50kMdluEQXlrqyFbtV3yi7p+TDvVdaHeT X-Received: by 2002:a17:907:9610:b0:741:757d:62a9 with SMTP id gb16-20020a170907961000b00741757d62a9mr19119764ejc.726.1662131858635; Fri, 02 Sep 2022 08:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662131858; cv=none; d=google.com; s=arc-20160816; b=MVL9evdgsoYngHQ0+68Vq5s0JddijOZFxp7FaX9t4y3UA7FInXyPeauVMJEIk+il5A MvTXJ5+uTgXOE7UBddxXAEpIljX8NqWtlptqCGsA1+PDydZWyTjpzLWSzopXPX2M3PSO Iosh7Vlv9s3bPKQmS7ec/UlfOUsriBeLwibI/IlkeRShFBZazP7+NVJEUMOuo9bQ55Mf GPwt8xoSK3CA7ys5CW6nq69xkNZcnfgf2O55RkVdkF9LyS06/w5HSxhB1kCqYfiHwHnR rFwWVGOUcpDs0VOethio0Q9DeqT4GL3R8CPkZPKEYKaUyoc0GKFTbqpyZfMTKCSM+Hj4 RgCw== 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; bh=3KEaSiPe3e/swBORCwP3X+c37kxFg1WS5iznYmuwqPs=; b=cTwWnHKTcE5JuHOCzlegsrvQEHCbda+qDn0UlXCinq1BhJ0+thVC9bVAu8VmOKGAxE l6HXWoPca2BAcSeMwiWQEmm68il5atZxP6VQfLZDxTtJbzADHUk6ASNyFXDMC9zXcAjQ hVS5BwibjSBtEGymCd4HOfMDFYx2cSwuFm4eWVnhPnEsviWXppGxA3AqMlXPIz80rH5/ nEUwiCSf07B28fxmjlzunHR/iE3CQ/6zC8T5MY1FZhBVLDySPOaS2A8xNftL9d6oe5EB TfOjjq80WkiuAwNbdfZNYawZRkgprbaf0vh6e/Jp6HS/TaLZGBPPentl/chm8M/awO3d PYkg== ARC-Authentication-Results: i=1; mx.google.com; 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 dd13-20020a1709069b8d00b007303646197csi2428596ejc.596.2022.09.02.08.17.11; Fri, 02 Sep 2022 08:17:38 -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; 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 S236690AbiIBOzr (ORCPT + 99 others); Fri, 2 Sep 2022 10:55:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236547AbiIBOzU (ORCPT ); Fri, 2 Sep 2022 10:55:20 -0400 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64A103B6; Fri, 2 Sep 2022 07:20:11 -0700 (PDT) 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= Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 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