lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0017caf-8fd7-4046-ab7c-71c6560b7a95@gmx.net>
Date: Tue, 20 May 2025 12:54:49 +0200
From: Stefan Wahren <wahrenst@....net>
To: Haibo Chen <haibo.chen@....com>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
 Sascha Hauer <s.hauer@...gutronix.de>,
 Pengutronix Kernel Team <kernel@...gutronix.de>,
 Fabio Estevam <festevam@...il.com>, Stefan Agner <stefan@...er.ch>,
 Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>
Cc: devicetree@...r.kernel.org, imx@...ts.linux.dev,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
 linux-gpio@...r.kernel.org, peng.fan@....com, conor@...nel.org,
 Frank Li <Frank.Li@....com>
Subject: Re: [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio
 controllers

Hi,

Am 20.05.25 um 05:46 schrieb Haibo Chen:
> After commit da5dd31efd24 ("gpio: vf610: Switch to gpio-mmio"),
> the vf610 GPIO driver no longer uses the static number 32 for
> gc->ngpio. This allows users to configure the number of GPIOs
> per port.
>
> And some gpio controllers did have less pads. So add 'ngpios' here,
> this can save some memory when request bitmap, and also show user
> more accurate information when use gpio tools.
sorry for asking this dumb question: why do we need the redundant ngpio 
property in case there is already gpio-ranges defined? AFAIU the last 
cell already contains the necessary information. Or do I missed something?

Best regards
>
> Reviewed-by: Frank Li <Frank.Li@....com>
> Signed-off-by: Haibo Chen <haibo.chen@....com>
> ---
>   arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi | 4 ++++
>   arch/arm/boot/dts/nxp/vf/vfxxx.dtsi    | 5 +++++
>   2 files changed, 9 insertions(+)
>
> diff --git a/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi b/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> index 3c6ef7bfba60986b797bb01b843830d364c96d45..880b9a4f32b0846a773dbf9ad30715c84ac2fda6 100644
> --- a/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> +++ b/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> @@ -399,6 +399,7 @@ gpio_ptc: gpio@...e0000 {
>   				 <&pcc3 IMX7ULP_CLK_PCTLC>;
>   			clock-names = "gpio", "port";
>   			gpio-ranges = <&iomuxc1 0 0 20>;
> +			ngpios = <20>;
>   		};
>   
>   		gpio_ptd: gpio@...f0000 {
> @@ -413,6 +414,7 @@ gpio_ptd: gpio@...f0000 {
>   				 <&pcc3 IMX7ULP_CLK_PCTLD>;
>   			clock-names = "gpio", "port";
>   			gpio-ranges = <&iomuxc1 0 32 12>;
> +			ngpios = <12>;
>   		};
>   
>   		gpio_pte: gpio@...00000 {
> @@ -427,6 +429,7 @@ gpio_pte: gpio@...00000 {
>   				 <&pcc3 IMX7ULP_CLK_PCTLE>;
>   			clock-names = "gpio", "port";
>   			gpio-ranges = <&iomuxc1 0 64 16>;
> +			ngpios = <16>;
>   		};
>   
>   		gpio_ptf: gpio@...10000 {
> @@ -441,6 +444,7 @@ gpio_ptf: gpio@...10000 {
>   				 <&pcc3 IMX7ULP_CLK_PCTLF>;
>   			clock-names = "gpio", "port";
>   			gpio-ranges = <&iomuxc1 0 96 20>;
> +			ngpios = <20>;
>   		};
>   	};
>   
> diff --git a/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi b/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> index 597f20be82f1ee044e14bfaf3bd05cff37a8ad39..a275821c35d41e97eb2139a081ef5765d07672aa 100644
> --- a/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> +++ b/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> @@ -318,6 +318,7 @@ gpio0: gpio@...49000 {
>   				interrupt-controller;
>   				#interrupt-cells = <2>;
>   				gpio-ranges = <&iomuxc 0 0 32>;
> +				ngpios = <32>;
>   			};
>   
>   			gpio1: gpio@...4a000 {
> @@ -329,6 +330,7 @@ gpio1: gpio@...4a000 {
>   				interrupt-controller;
>   				#interrupt-cells = <2>;
>   				gpio-ranges = <&iomuxc 0 32 32>;
> +				ngpios = <32>;
>   			};
>   
>   			gpio2: gpio@...4b000 {
> @@ -340,6 +342,7 @@ gpio2: gpio@...4b000 {
>   				interrupt-controller;
>   				#interrupt-cells = <2>;
>   				gpio-ranges = <&iomuxc 0 64 32>;
> +				ngpios = <32>;
>   			};
>   
>   			gpio3: gpio@...4c000 {
> @@ -351,6 +354,7 @@ gpio3: gpio@...4c000 {
>   				interrupt-controller;
>   				#interrupt-cells = <2>;
>   				gpio-ranges = <&iomuxc 0 96 32>;
> +				ngpios = <32>;
>   			};
>   
>   			gpio4: gpio@...4d000 {
> @@ -362,6 +366,7 @@ gpio4: gpio@...4d000 {
>   				interrupt-controller;
>   				#interrupt-cells = <2>;
>   				gpio-ranges = <&iomuxc 0 128 7>;
> +				ngpios = <7>;
>   			};
>   
>   			anatop: anatop@...50000 {
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ