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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201215170308.2037624-1-bjorn.andersson@linaro.org>
Date:   Tue, 15 Dec 2020 09:03:08 -0800
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc:     linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org
Subject: [PATCH] gpiolib: Allow name duplicates of "" and "NC"

Not all GPIO pins are exposed to the world and this is typically
described by not giving these lines particular names, commonly "" or
"NC".

With the recent introduction of '2cd64ae98f35 ("gpiolib: Disallow
identical line names in the same chip")' any gpiochip with multiple such
pins will refuse to probe.

Fix this by treating "" and "NC" as "no name specified" in
gpio_name_to_desc()

Fixes: 2cd64ae98f35 ("gpiolib: Disallow identical line names in the same chip")
Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
---

The introduction of 2cd64ae98f35 breaks pretty much all Qualcomm boards and
grepping the DT tree indicates that other vendors will have the same problem.

In addition to this the am335x-* boards will also needs "[NC]", "[ethernet]",
"[emmc"], "[i2c0]", "[SYSBOOT]" and "[JTAG]" added to this list to allow
booting v5.11 with the past and present dtb/dts files.

 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index b3340ba68471..407ba79ae571 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -302,7 +302,7 @@ static struct gpio_desc *gpio_name_to_desc(const char * const name)
 	struct gpio_device *gdev;
 	unsigned long flags;
 
-	if (!name)
+	if (!name || !strcmp(name, "") || !strcmp(name, "NC"))
 		return NULL;
 
 	spin_lock_irqsave(&gpio_lock, flags);
-- 
2.29.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ