Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2078185rwe; Sun, 28 Aug 2022 03:24:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7MFLukFq6ddcJUJt3Kzj+16GNoUdKFm9r2EwHjn2XRfTfMLDyGmKEZAkZejpbeRywmYptY X-Received: by 2002:a17:907:6288:b0:72f:90ba:f0b2 with SMTP id nd8-20020a170907628800b0072f90baf0b2mr9886834ejc.696.1661682287517; Sun, 28 Aug 2022 03:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661682287; cv=none; d=google.com; s=arc-20160816; b=T0C/iL68I1712utXcbXcaxC9umgg5cUVE7UxaqnNlrqUHjAQsCTA/xY20BoHk7xl1P iuFxRdmo5yDMVNJbwuSEmOhVsmYxE0S/l7nCReCz62cciHI0HJLjd94B2YBEk5s96AqP TtmhlCBjK7IGNJe3oq+8ZRin201cGukawbFElbD4vjqljoURRwv9molicVPYPRTdX9UD fNgAWKEeJGkomOBkSGzxSF3r/sP2BcDr9xa9p1zwQn9B6zAA++L7AyMfUFOcKTHnpJg7 nB0yiGF8qQLvaC/buzI47bZw3LVsbovprk2fVjEtAyx8hF59zNNcMkYjeRVUFA1KzwlQ cY5w== 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; bh=iNBgg/LBXhyekUBmrtK1yP6HvIW3G9yLNF35LrNNYHI=; b=nCwtRy9qjTWapD15Mb1owj4seYPjEVmOzun9pgv3hQvovjFxl2v6R05I7/ZzqUr/qJ JUa2t748cTXunRxNL3wVT7zZj9/gSrllWRR5H5SP9q/k5cSvdno27prc920iIOz/sNbD 7e5N+8K7CCsVf7wzjF4LNz87ys+IRuUzjbisGZTpsMnyyop+SxgFrds+oMqxIoqmgWn4 6yuQ87SjUcCpsweVwuQtEbEitkKIm0jyLbREGhu0SJG4WaBA9P7PrUgROKD61wZwUJji M+rPbF7V2gefAnT+p96fAPkORWW9xb8bUkzyXJnp586tNMuOgNaH0u6nnqrUTlaQ3HiB AkhA== 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 t1-20020a170906a10100b0073ddf717266si4067463ejy.449.2022.08.28.03.24.15; Sun, 28 Aug 2022 03:24:47 -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 S229608AbiH1KEv convert rfc822-to-8bit (ORCPT + 99 others); Sun, 28 Aug 2022 06:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiH1KEu (ORCPT ); Sun, 28 Aug 2022 06:04:50 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6205F38B8; Sun, 28 Aug 2022 03:04:48 -0700 (PDT) Received: from mail-ed1-f52.google.com ([209.85.208.52]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MBV2f-1oZ4VN2IWt-00D109; Sun, 28 Aug 2022 12:04:46 +0200 Received: by mail-ed1-f52.google.com with SMTP id s11so6906814edd.13; Sun, 28 Aug 2022 03:04:46 -0700 (PDT) X-Gm-Message-State: ACgBeo2ch44KgL2Jb6PS39Vp5lXpwWeCEj95onF7+tkB/sw6F2G0fqEc qggrG40up4ejvDwinpdmael92xQo2No+ZAUHR6A= X-Received: by 2002:a05:6402:5190:b0:448:5bdb:b27d with SMTP id q16-20020a056402519000b004485bdbb27dmr1665421edd.49.1661681086136; Sun, 28 Aug 2022 03:04:46 -0700 (PDT) MIME-Version: 1.0 References: <87f2ff4c-3426-201c-df86-2d06d3587a20@csgroup.eu> <515364a9-33a1-fafa-fdce-dc7dbd5bb7fb@csgroup.eu> In-Reply-To: <515364a9-33a1-fafa-fdce-dc7dbd5bb7fb@csgroup.eu> From: Arnd Bergmann Date: Sun, 28 Aug 2022 12:04:29 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] gpio: Allow user to customise maximum number of GPIOs To: Christophe Leroy Cc: Linus Walleij , 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" , Davide Ciminaghi , Alessandro Rubini Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:q7AU2884sD9a1G/Wzgl7haFBCm2tktWi+C9nFAcCOtfszTS0hvk NIg2klUjvMnQB1+DqRwaIfPTRPQtBA2OhykVvoe6NjqcCoF/gMOBliUtodlCCfocdFDssL5 NfVg9wSHtRGjz1bXrY5Eh6XEbGBzbZfXbVizl/w34JoLYTQ7/QeDRl7GF8BT+0RbCyBAw5g 4VzDnQMbRsnH4xjX3fXlg== X-UI-Out-Filterresults: notjunk:1;V03:K0:MlFDtVOvLfE=:Xe0ivX8BrMffWwzQzmP2DB o3m12LgKZ+9xUu7xFBcy5qw1E1b6BW0HFvCWXwSBrRWzGRbfbRb+NxjCG4A4H12EfvZmuUHyu AmXrinaowvZ9mQjd51DUKaibsjB+kDw8aRccN+BPzVF5zBFOLvaqBq/QWWgKvCKmXHlnGY565 wzO1bblBqO1ctbB3R/EkJLY/UVj6lGgKdnIqBg4mtZGdw5iisj0nIvy1uytVoh4DOI2orEbWB HPM0QRsOTtxl2c0ZLMaTCT5Jmhnf+SMc0hhYSgx/pB2aieQKOezyjwFdpdg4n5drrLQYoE7bY j/d49451Eo4yTiTp+i5Ld10JjTQM3T08pejdsgoq/8MgTKO0IwtiLUAmoh8qsAwaY+2FRlEkd WNMIqpmgA9zQ7wdbRJVRSI8GSHG8bZ3lplhOKE+84UbC0ZgapmBFWHhpMSn1q5TqOrg9y50WV UwY24Yn6Km8ZZjR3nSTCAG3vP3tJmQaqy6w2F31IoGdkS9FCyVhd10OcaYE+tMO12qGcvY1u/ 7AbPzN7RV8jviRfRHH/kMI5R8V0a98Obp6fS8oTQ4JKDPVNCcLoyGFt+CjPYrQsENpf+fEOQF SDxxV+zD+BuhiHm/CQgrXby5peZ/k9quOYDbrPd2W9olFT9P7VQBQSJcPAAz++eiHJONpt26L N3wxaFrCI9qUmRdGnIIcpriF+BZaFTdWxya3p8wfgKL9qL0HtO4Edwv9mol5pBHdp/sTQ6Ni8 +Kta1UNTFeeHs3OnfLDftUBctYVH6JTxlVHBipO56q8Bgkdhu0MX0zXxNyNBdyeTt6WRSzy6t nqe2PwpxZzBOGAyBmQ/N0ZR0C3DhM4WSqV6igHch6QSByLuI2n/2RIXd8GBiHPPUPuYcnD9w7 TDmasLgWlU+SOZCq1JFw== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 Sun, Aug 28, 2022 at 11:06 AM Christophe Leroy wrote: > Le 26/08/2022 à 23:54, Linus Walleij a écrit : > >> But what do I do with: > >> > >> drivers/gpio/gpio-aggregator.c: bitmap = 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. > > > > And what about gsta_gpio_setup() that requests base 0 with the following > comment: > > /* > * ARCH_NR_GPIOS is currently 256 and dynamic allocation starts > * from the end. However, for compatibility, we need the first > * ConneXt device to start from gpio 0: it's the main chipset > * on most boards so documents and drivers assume gpio0..gpio127 > */ > > > And I guess there might be other drivers like that (I found that one > because of its comment mentioning ARCH_NR_GPIOS. This driver is clearly incomplete: there is an mfd portion in drivers/mfd/sta2x11-mfd.c, the gpio provider in drivers/gpio/gpio-sta2x11.c, one gpio consumer in drivers/media/pci/sta2x11/, and some glue logic in arch/x86/pci/sta2x11-fixup.c, but nothing that seems to set up the platform data that these need to communicate with one another. I think that just means the code that one would have to modify is in vendor kernels of devices using this chip, but there is no way to fix those if they are not in mainline. The last meaningful patches on this SoC support were in 2012 by Davide Ciminaghi and Alessandro Rubini, though they still Acked patches after that. I wonder if I was missing the interesting bit about it, if the driver is just obsolete and can be removed, or if there is something that is still worth fixing here. Arnd