Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5526079rwb; Wed, 7 Sep 2022 04:23:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR5SmxzmX1SqhxWqu1nBGpuYRbhKNfKpkmpNzqRO6eWBMN8HM1rJNXmi+OChEG1hASKGDb/y X-Received: by 2002:a17:907:b17:b0:72a:edb8:7529 with SMTP id h23-20020a1709070b1700b0072aedb87529mr1929654ejl.749.1662549782243; Wed, 07 Sep 2022 04:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662549782; cv=none; d=google.com; s=arc-20160816; b=Av3xMf21AqE1cGVOoV24/inBzWgqLJRIFTEF71zN6NdLYicJMzGCatiAmEGebwGlgt za5fPMrvYbb3CoR5c3qzy75uQuDnvtqH7L6DzmCHcxArQQsPRsFDF/nq0cT8Rlsx5dUe qFvlqGLRB1rMR+QUkS9qX+sRIkbSl0aRroA76s4S2oYKdIatrO1rzy5seTtFOeN/TXGJ e3VSTZhUL9/ac1ieL1WhSXU1XhxY906ngbx1ckhjpdqRVVXUjpkHwE2kGdB6FysU7UZE 3cg1ldXMbLPmMWNIRHGWl1TkbrZbwAR0YfcMij0uTqb/Qgy9Qjx23DGU3NUrvv1D55g4 uRFA== 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=heSFzetbXWgbtnsASv1LZ6qPan1dJOs+6DCCGWIHMBc=; b=BD6SufvNhSvWbmRrGBF6FJi8T6gTxUj0NBoonKRMmQgrsSL6ttmPL4+ccIpmx4/Lx1 EKZkmFJ+HemcQtqarVXvjB8TDSVz/A2Ppa30/0ZA9+gqxqZvKkBD912pKSZ/c7k3MWQL LcHYj2DHC+tZMKhytAkU6YA5X/W2w9rvXOmRzvU1bepyuuBbaSQDXSIChjp0iqN3cUfi TYeb3+J+zeWJEUq7/lTPhsdkZtXwULjPK+7M44/Ng7IXXo/YZM82TqO2fGXLvzXtMEfz hINnbuZwvRFUpSAtmoqilTOWcWFu1Aat7vsVhzoamllrsoaWPVWj/l8crwfkziwjoqaG k2sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=vHf0XP6Z; 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 g4-20020a1709065d0400b007419d4781a7si13130220ejt.613.2022.09.07.04.22.35; Wed, 07 Sep 2022 04:23:02 -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=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=vHf0XP6Z; 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 S229820AbiIGJ7h (ORCPT + 99 others); Wed, 7 Sep 2022 05:59:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbiIGJ7C (ORCPT ); Wed, 7 Sep 2022 05:59:02 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6443B775C for ; Wed, 7 Sep 2022 02:58:40 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id bj12so29069658ejb.13 for ; Wed, 07 Sep 2022 02:58:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=heSFzetbXWgbtnsASv1LZ6qPan1dJOs+6DCCGWIHMBc=; b=vHf0XP6Ze2kKCdhKxtVAgOHIr2JsfMKXNXZBFepV2YBWzCPoSXlPG+D1rz3Zg9Rch0 ypMUtQMR9yyK7gQjXW2ZyJ2cnlHlg71InbxQR7ofH3deJAocrr+yORgDxvorjARevA1l tJHxHMkBbBa+CnVkksjAvgq0kmgk+59QTtXcjKW9zZhxRIFlhHlqchKmGRNkvoXe2Y85 F23ax+ngd/IlSAB6HD0FpqhIOJKU7jZkyGDdKtaAWVwaraHMfa6YxvtZnPZFhff7znmT 4e4T7YcqtsBKyZOiDnLNOkbTrFzdJQLHpf4Mu3ZhQsTPjK/8w9zsT/qHgDHipv7pBptk v+yw== 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:subject:date; bh=heSFzetbXWgbtnsASv1LZ6qPan1dJOs+6DCCGWIHMBc=; b=AFzLMqI+EVkkAifyGzeMpMRX/JtU/Xt+k/EoJHUGxsnZgE6vMyiwWHsePhFlScX9lN vcdoI5F8OP7GB/REMo4PADfPqHchzZhQQzZvsm+GYISGZUugyHxs1Mbc8VdcobDFTxcS EFmi4gIzp1YurhYxG2LoOuyY8IB4GWs26/5h8Obx/qsM/cDEG26qNX1JvEBLs+zSfjrb Ua6aL5tjTU6ghWhErfrUZameZZweFPKymNGmrsXAxf5dIEBky6Iy9YZ8usOc9T8GYseX 6JZO/WHk7jBlEjMBwNaMQdm1AYJlI+ucjC688M2DsgT7cPuviEu5DooJlgc1ByMO3Co0 Xtsw== X-Gm-Message-State: ACgBeo0UO97nNJIuQ0SNEa/Vx02ZEQq6A6sYUL4Qw+X5etgJub7Dixu/ uFzriUWRgpHD+yKIMGDRNTbDUUDFrwBAKCKV7IuwjA== X-Received: by 2002:a17:906:4fd5:b0:74f:2bad:f9d with SMTP id i21-20020a1709064fd500b0074f2bad0f9dmr1687207ejw.697.1662544719244; Wed, 07 Sep 2022 02:58:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bartosz Golaszewski Date: Wed, 7 Sep 2022 11:58:28 +0200 Message-ID: Subject: Re: [PATCH v2 0/9] gpio: Get rid of ARCH_NR_GPIOS (v2) To: Christophe Leroy Cc: Linus Walleij , 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 , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Linux ARM , "open list:GENERIC INCLUDE/ASM HEADER FILES" , linux-doc , x86@kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 2, 2022 at 2:42 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 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 > I'd like to take it through the GPIO tree if we can get acks for ARM and x86? Bart