Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp809560rwe; Fri, 26 Aug 2022 15:16:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR6szemVMLK8ttYVde/SNupl4nZitNdDWXcXHhzlMWFFEbcuORW4ymJqFwojrNgviATgBEjQ X-Received: by 2002:a65:6ccc:0:b0:41e:2339:f9a7 with SMTP id g12-20020a656ccc000000b0041e2339f9a7mr4943064pgw.415.1661552210089; Fri, 26 Aug 2022 15:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661552210; cv=none; d=google.com; s=arc-20160816; b=CBswuU6/wstxSNJm+LyCS+QZN9d+4KQhS8y/JHyzzgtpq/s4t0/OUuNJeOrOuihmJp nHeUNrUmvVjDRkaNZGKbpFdeXUDdoiVyBjP+7WiCUBTSf6UA+q2Fz++aEDLoYN7t8J9w xz8hPKVde88jh5N2kooWuxjCMCJJrGPzebefRYO6kNeh/KJO4+wDBlHiqGorvG6grn9F CNk7r3H0KA2gj/qHOkyCTjIMK/TIs25QenMUhifHgHZIVWLpOJqc23RYW8LPOsHzfNRo ZFM63bfsI1BSElQlMl3ZROKSpFE/mIwnYpFZpECfcjEeTNQnW8hFQ2G2regEG2GGfwaA HzVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=iD+oDgmA+uqkgZAjiZVwNKXzpAuCVIysHt0xaw4YizU=; b=Kb33bQVnQOkmuEG7A3K4WttqM4DMLZ/S1iNbLlf35K+ZI57Uql7WSacvsBH8gDAgUl gLxfz8nAXlxbmckvWLFlpFTiJ7oOh8S/OsVJCSXNb2mDomeOwQwG1U0O79Vxz9/iCESC 3DHVVGWfYXM5mAlfx/FZUNR5Ci+89ctipB6qoN+Dcjgptn/DuZI6vol58VyLRsFLveSJ aaUr9sJedAjUjWeqoZ09WL+TwgMmRy6nTWfp46iSdBT7xguvpnY/bj7tZCsfGITuFLve raY/tiTl0C1JTmLHwn9WpYkdgg+OKNlzRTLUr7l6llRSdSwBAGgm7EZ3Ub5cVrlP8xgO YrEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ca+dkdvT; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a170903230200b00172a67c1371si2625790plh.328.2022.08.26.15.16.39; Fri, 26 Aug 2022 15:16:50 -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=@linaro.org header.s=google header.b=Ca+dkdvT; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231645AbiHZVyi (ORCPT + 99 others); Fri, 26 Aug 2022 17:54:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbiHZVyg (ORCPT ); Fri, 26 Aug 2022 17:54:36 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7B9795BB for ; Fri, 26 Aug 2022 14:54:34 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-33dc345ad78so68470927b3.3 for ; Fri, 26 Aug 2022 14:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=iD+oDgmA+uqkgZAjiZVwNKXzpAuCVIysHt0xaw4YizU=; b=Ca+dkdvTTZAOLDvgw3Z9TkaUnMZcEWn4NTxm5+zjenuU2n7vyLOc9KPh6+KdZ5gwBJ tn/9thf3hXLJO9QmMCTrPu9UeA9bqXKkdHcD3t26KAQo8P0j/mO2Wsp3546vXy2g5DVe 7hsSOEj3K89mu/jqNLHDZpbjrvMfyUGLE++bdQHX7CDFGQhtlU3YxsNnf8kvVYpVHf5L lxVu/SLHlqgK0HT7NNi6O08XfosRfNiRI1W7yI7n62C0LRD+iwPjN2kz2hv3wdQVmP8E SrxuPd7hPHS0iDGfnSjx5LwMaLY9kxqbUtS5dWAWogDi+uOzyJWbWoS9ExFdkez6KFbW ThmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=iD+oDgmA+uqkgZAjiZVwNKXzpAuCVIysHt0xaw4YizU=; b=M8yX28rVFB6dP6EMmwLGcUflGBYKvP874ZOMx/IpRw/mVLq48xJjWMtyZVNvwGzxV7 AYAFzWdM8ZHVQAnFwFCKOAaPvaBzcNlzOIJC2C0rZg3XSaOhIZwQd9p1ONOGBl+ma97a whDbDy9ts3O/YmerZSrLCHmpiOU9sjZTYNOYmbIb26XHOX/ZL8v5dE3KyDSBjZi6f5wI gcX65AqeGlxofzH0mLZ7QNQ/TcQoUYXLDjMjgl6uJefHZHjFRgkdvrQMZwDUun4iJwhF 2Ewxth6/A6mLNBVjBAKkT7eZ9nnR1BaP9kHwJB65aenQosNhZXago0cwvYiSI1p4R7M+ B3vQ== X-Gm-Message-State: ACgBeo0a5cRqBGzMVw9i4v2M5ioj5O7GaQfuDQmJlfDs1VTPQBul/Rfs 8l5NWfMxYN+dZc/ekBLU5obm4PX6+63o/0y6PcrpgQ== X-Received: by 2002:a25:7902:0:b0:67b:d842:1184 with SMTP id u2-20020a257902000000b0067bd8421184mr1609196ybc.374.1661550874022; Fri, 26 Aug 2022 14:54:34 -0700 (PDT) MIME-Version: 1.0 References: <87f2ff4c-3426-201c-df86-2d06d3587a20@csgroup.eu> In-Reply-To: From: Linus Walleij Date: Fri, 26 Aug 2022 23:54:22 +0200 Message-ID: Subject: Re: [PATCH] gpio: Allow user to customise maximum number of GPIOs To: Christophe Leroy Cc: Arnd Bergmann , Alexandre Courbot , Alexandre Courbot , Bartosz Golaszewski , Jonathan Corbet , Russell King , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , "open list:GPIO SUBSYSTEM" , "open list:DOCUMENTATION" , open list , "moderated list:ARM PORT" , "open list:GENERIC INCLUDE/ASM HEADER FILES" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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, Aug 26, 2022 at 5:08 PM Christophe Leroy wrote: > Le 26/08/2022 =C3=A0 15:49, Linus Walleij a =C3=A9crit : > > On Thu, Aug 25, 2022 at 4:00 PM Christophe Leroy > > wrote: > > > >>> Christophe? Will you take a stab at it? > >> > >> Which patch should I write ? > > > > One that removes CONFIG_ARCH_HAS_NR_GPIO entirely, then > > allocate bases for new GPIO chips from 0 and upward instead. > > And then see what happens. > > > > Ok, I can give it a try. Nice! > But what do I do with: > > drivers/gpio/gpio-aggregator.c: bitmap =3D bitmap_alloc(ARCH_NR_GPIOS, > GFP_KERNEL); That's just used locally in that driver to loop over the arguments to the aggregator (from the file in sysfs). I would set some arbitrary root like #define AGGREGATOR_MAX_GPIOS 512 and just search/replace with that. Yours, Linus Walleij