Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4614272rwe; Tue, 30 Aug 2022 13:31:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR7AxidyJsPK1mO4hgQhkAdIU84UGB8jjDSUyc6wksvshmyo+xkhhQfon/OH2nk9Yj6irxhC X-Received: by 2002:a17:90b:3e81:b0:1fd:8357:cbc8 with SMTP id rj1-20020a17090b3e8100b001fd8357cbc8mr19222pjb.48.1661891516728; Tue, 30 Aug 2022 13:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661891516; cv=none; d=google.com; s=arc-20160816; b=Ft2pmH97qGNIoFw6oF7O9crBUuxZeNP/7GFdaCn0dohJaveYQM5H6CwidaIGOQr+Qq MLxN5Q9zyR1GU2PfHLli6TbSCkcVd0dG1H66txNoKIe+jyKCe0RWDjwfqfZRD56stIS5 KdiDlkZsLFABELxQpE3jfWz3+k+pOfuy46AK1oLzlsrw3B1QefUhRuo2SEQ0LFQom8HH kJPQoLn1ONiMKaoNZf7GztSM8OlG86zVj1Y6gTUJAczWMXxEgYgV088Ft62Wr9iSXg6H hVfpL12grFTok67nWm/6xOsBIztbVLcADQkQXBDDiGZzMlyo2Po/0ccH825CEf22dtYP vYfw== 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=LVn6qx7D95RyzzEUvV9vWSYtbWzc15zDFAjhUMtiT8U=; b=FDDmM6Rixyjt4R+bYRBMtsPYKPZu8lllQjGAQBUc2A6pLI8Dlj3IJf5NWPrzrUjVYP wJZk9VxYsjDDsYoESR4bBK7LhGhiL9mqSkpyoLd7EaQZn5JToN61SloYyhzTe8gPGCN+ Pju76W0P7/lPKhA7JU90SX9dHt1Wvvnt1wLX0IM1JeOY91dZ09ktRO6zuU9J8Kb//g+P vcmYf426PCgtyUut+vwuQR3gHGx5vDMPLR5u3c4jA0/lEEdpfd/a9U6bTunvZE66zTGe Z0K7EJp6fVJtAXliezpqTa5YC5p8UhnUIF9WBathoSJoQJDyfxzYqmuevWyPMqLD9v9y t0ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=n4D10XaD; 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 21-20020aa79255000000b005256b0ab23bsi11914242pfp.191.2022.08.30.13.31.42; Tue, 30 Aug 2022 13:31:56 -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=n4D10XaD; 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 S231454AbiH3UTH (ORCPT + 99 others); Tue, 30 Aug 2022 16:19:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229875AbiH3UTE (ORCPT ); Tue, 30 Aug 2022 16:19:04 -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 B7643286C3; Tue, 30 Aug 2022 13:19:03 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id x5so9484719qtv.9; Tue, 30 Aug 2022 13:19:03 -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=LVn6qx7D95RyzzEUvV9vWSYtbWzc15zDFAjhUMtiT8U=; b=n4D10XaDUSei5RLSsY+I//s3biEMQ4gimTe364fs28GKuTXZ6h39Dr8c968TsbE1FK YhJV38UY5llldYqcHq5Ao7rIATy9Lr4OSXns7i89iAxB+ieW4hFd1pEXACPZ9q5euCk3 uZc3gAfHf7wzcgI5O8L+COYoibPJj67mpjjtAdjJUabbtHBfkFas3CNPKglSUgXgyXA/ sqWLAxxoRelv4TB2yit1JpPsHXWvprRQa944PUCVRTVLlyJ6ILrAnBrPmVGhJT6ydErn 6fAlYcj7Ox1YKnu8+TuptVg2bctQogTTHmOniVxbsNJjvou4q1RApNT/dxJnOR3n/kSg a20A== 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=LVn6qx7D95RyzzEUvV9vWSYtbWzc15zDFAjhUMtiT8U=; b=qp2Bt4ZKkf7+4lnYhRt30fftP7NWlNx0scx9PBg1WBO7R8qhh/sRQB4AhXWedm3eqi FdGhDn6Wke+7mOJbzE3KQmVizrzxgbzZ9n94GTYioOAHMotZXK5AbR4nGlw+KAcLow2Y RS+KElkLIoVQOa2G3IzJa9LQNjaYWPhIA1asfkW6B++/0wnJD7fjotp6nc5FdQTDIJ3+ b+LhrMeTl5LR+HIINpSUjtxLW6EOtvFWX1TTth109pEiiA8jkvZZbVXOCcFfNXWoOo/p cPaSWG8/fXTvIc1FrLCOAQujmbQSPrMHchGJ7LwQgGQ29gQKelq1l7Meer1kkHa1fkRj CBsw== X-Gm-Message-State: ACgBeo2VDunQgZ6l9N2uV7IGFEahTr2hJe63VgvKeTINW0ZOyl8Zn/9i fpJb7OhSR7ClhprO3uwQAFUWC2IUvl2gRMtkBXY= X-Received: by 2002:ac8:5786:0:b0:343:3051:170d with SMTP id v6-20020ac85786000000b003433051170dmr16165431qta.429.1661890742791; Tue, 30 Aug 2022 13:19:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Shevchenko Date: Tue, 30 Aug 2022 23:18:26 +0300 Message-ID: Subject: Re: [PATCH v1 4/8] gpiolib: Get rid of ARCH_NR_GPIOS 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:19 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 upwards, allowing approx 2 millions of > GPIOs. > > In order to still allow static allocation for legacy drivers, define > GPIO_DYNAMIC_BASE with the value 256 as the start for dynamic > allocation. Not sure about 256, but I understand that this can only be the best guess. -- With Best Regards, Andy Shevchenko