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-next>] [day] [month] [year] [list]
Message-ID: <20251015112921.19535-2-wsa+renesas@sang-engineering.com>
Date: Wed, 15 Oct 2025 13:28:59 +0200
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: linux-renesas-soc@...r.kernel.org
Cc: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
	linux-kernel@...r.kernel.org,
	Wolfram Sang <wsa+renesas@...g-engineering.com>,
	Philipp Zabel <p.zabel@...gutronix.de>
Subject: [RFC PATCH] reset: always bail out on missing RESET_GPIO driver

Optional GPIOs mean they can be omitted. If they are described, a
failure in acquiring them still needs to be reported. When the
RESET_GPIO is not enabled so the reset core cannot provide its assumed
fallback, the user should be informed about it. So, not only bail out
but also give a hint how to fix the situation.

Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
Closes: https://lore.kernel.org/r/87a51um1y1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
---

This happened because of this (in general) nice cleanup patch for the
pca954x driver (690de2902dca ("i2c: muxes: pca954x: Use reset controller
only")). Our .config didn't have the RESET_GPIO enabled before, so sound
regressed on some boards.

Actually, my preferred solution would be to make the reset-gpio driver
'obj-y' but I guess its dependency on GPIOLIB makes this a no-go?

On the other hand, the fallback is a really nice feature which could
remove duplicated code. But if the fallback is not present by default,
it makes it cumbersome to use IMO.

Has this been discussed before? I couldn't find any pointers...

Happy hacking, everyone!


 drivers/reset/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index 22f67fc77ae5..8a0f41963f6b 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -1028,8 +1028,10 @@ __of_reset_control_get(struct device_node *node, const char *id, int index,
 	if (ret == -EINVAL)
 		return ERR_PTR(ret);
 	if (ret) {
-		if (!IS_ENABLED(CONFIG_RESET_GPIO))
-			return optional ? NULL : ERR_PTR(ret);
+		if (!IS_ENABLED(CONFIG_RESET_GPIO)) {
+			pr_warn("%s(): RESET_GPIO driver not enabled, cannot fall back\n", __func__);
+			return ERR_PTR(ret);
+		}
 
 		/*
 		 * There can be only one reset-gpio for regular devices, so
-- 
2.47.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ