From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40628C433EF for ; Mon, 2 May 2022 11:11:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384695AbiEBLPE (ORCPT ); Mon, 2 May 2022 07:15:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232143AbiEBLOx (ORCPT ); Mon, 2 May 2022 07:14:53 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99E72B1C4 for ; Mon, 2 May 2022 04:11:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C066ECE1986 for ; Mon, 2 May 2022 11:11:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE4F9C385A4; Mon, 2 May 2022 11:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651489880; bh=VBWeD8I9VmdspyMeqlI/tqUVuRLOivZtywbFOQG2e5w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Xo8lPtG7bDSzpv6PVe539ozJbsq3Kqjs6MzL6Z0b+wq/H6iXhZrN3y/ocBhUzjo9A TzQZoKpn59OlZrw2LNcaYRRsoWm+n9mWMP9O5JCwtLcDlD1HKS4HeiPlKL/cx1/Kb9 qgYkiMpE3yE0BeqCww+aQkvqIPOkW9NiLrmPlfiC6PCQT2Ea3OReByLRFkK410D4XM bKyuogy343Vfhf5BJaSHt0+OrKO4EpHzKpJq2bDLlfymhwpmtYryaYgSMho1VhYWvi kZD3++P/XAqWvc5v4Xy4s2VSTo4xkty7OiRnbPUiK4LBZ2PNhPcEY5G24cfI2My3C3 ijwvIxTAc9khQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nlTxW-008OtW-Bf; Mon, 02 May 2022 12:11:18 +0100 Date: Mon, 02 May 2022 12:11:18 +0100 Message-ID: <87czgwi3zd.wl-maz@kernel.org> From: Marc Zyngier To: Hector Martin Cc: Catalin Marinas , Will Deacon , Sven Peter , Alyssa Rosenzweig , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE In-Reply-To: <20220502091427.28416-1-marcan@marcan.st> References: <20220502091427.28416-1-marcan@marcan.st> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: marcan@marcan.st, catalin.marinas@arm.com, will@kernel.org, sven@svenpeter.dev, alyssa@rosenzweig.io, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 02 May 2022 10:14:27 +0100, Hector Martin wrote: > > We're already running into the 512 GPIO limit on t600[01] depending on > how many SMC GPIOs we allocate, and a 2-die version could double that. > Let's make it 2K to be safe for now. > > Signed-off-by: Hector Martin > --- > arch/arm64/Kconfig | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 20ea89d9ac2f..b0da0a28aa2d 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -2050,6 +2050,18 @@ config STACKPROTECTOR_PER_TASK > def_bool y > depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_SYSREG > > +# The GPIO number here must be sorted by descending number. In case of > +# a multiplatform kernel, we just want the highest value required by the > +# selected platforms. > +config ARCH_NR_GPIO > + int > + default 2048 if ARCH_APPLE > + default 0 > + help > + Maximum number of GPIOs in the system. > + > + If unsure, leave the default value. > + > endmenu > > menu "Boot options" It may be worth pointing out that this doesn't seem to result in any extra memory allocation, as this only controls the GPIO numbering. My only worry is that since the allocation is done top-down, the new limit is going to have a userspace visible impacts (i.e. anything in /sys/class/gpiochip* will get renumbered). I don't think anyone should rely on this anyway (they should use the canonical bus path), but this is worth pointing out as a potential side effect. Otherwise, Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.