From nobody Fri Dec 19 20:33:48 2025 Received: from mail.zeus03.de (zeus03.de [194.117.254.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7483A2D9EF2 for ; Wed, 15 Oct 2025 20:59:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760561982; cv=none; b=RPAjX930fS2HNP99brzwK6jwr+LMkVVOfADKPx5J3gyN/15QSQiHYsHahx9HxRjF1nSdYR8neqeUNFfHOeYe4nAGAP/wrXjPgzhm+QQYjid1Ww9LVh+DY3R6P1nJayPYA5ID74G+TAWpcvaxaS6tDlCv/U2ybmG5d3dRHVH24v0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760561982; c=relaxed/simple; bh=FGc6lCmQPgIariDqqATWhZu/+cnd36zIPScbB2qlhXI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GU470SW6JM3LbukwTbtCoeLMbFD1Ad+nmWyGjdoDEzmpfg8ZsLwL6RIP5TGs4NHMpRFo9/f3QWi01ibXzl8Lq2KIP+JoR1Zwr8hcKcG0lc7wAlFlx6zfHy+z9GcJDajhZF+Dv15yBIywBlhZDEbVLLsK6FBmXWq9Vxi79JKhEHY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=lTg3shNO; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="lTg3shNO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=TmMo7UfKp9jPjoJxaD8G1+/QMcyWYOk4wYhcprXR6As=; b=lTg3sh NOAg3DSPo30M6o803binPnO1vZrTiQDZfqbylmMJ3mn+zFth7ki3+O68xISuVIn9 GBhdQN75LTnGMOIu0q0YhWRF6UdxK1fU0SZRpUM7OxB0NWgOAAOQZ0IzNRnd+ejW v1h+3A/CA++mBwWvyJQUy5OjAL0bVmxzo5p55l777exG/7GAv4MRNLV81asITjni JUIXwD+jnZfD/U6qP2fShcm/yZs/E3/ObgExeVpDsJ2TepMjzm0btBOCeHiahd5j 0IQR7RBYEYTjVSeUUJhotJ3N/kZqxad93NWRWs/td2YuAkROy24rF+2hvg9FHJyP JarJILQo95UFI5iA== Received: (qmail 3544968 invoked from network); 15 Oct 2025 22:59:33 +0200 Received: by mail.zeus03.de with UTF8SMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 15 Oct 2025 22:59:33 +0200 X-UD-Smtp-Session: l3s3148p1@zckBxzhBbLMujnsG From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Kuninori Morimoto , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, Wolfram Sang , Philipp Zabel Subject: [PATCH v2 1/2] reset: always bail out on missing RESET_GPIO driver Date: Wed, 15 Oct 2025 22:59:21 +0200 Message-ID: <20251015205919.12678-5-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20251015205919.12678-4-wsa+renesas@sang-engineering.com> References: <20251015205919.12678-4-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. This means the check has to be moved after ensuring the GPIO is really described. Signed-off-by: Wolfram Sang Reviewed-by: Philipp Zabel Tested-by: Kuninori Morimoto --- Changes since RFC v1: * moved the code after second phandle check * switched to pr_err * updated commit message * moved Reported-by to patch 2 drivers/reset/core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/reset/core.c b/drivers/reset/core.c index 22f67fc77ae5..c1909074f715 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -1028,9 +1028,6 @@ __of_reset_control_get(struct device_node *node, cons= t char *id, int index, if (ret =3D=3D -EINVAL) return ERR_PTR(ret); if (ret) { - if (!IS_ENABLED(CONFIG_RESET_GPIO)) - return optional ? NULL : ERR_PTR(ret); - /* * There can be only one reset-gpio for regular devices, so * don't bother with the "reset-gpios" phandle index. @@ -1040,6 +1037,11 @@ __of_reset_control_get(struct device_node *node, con= st char *id, int index, if (ret) return optional ? NULL : ERR_PTR(ret); =20 + if (!IS_ENABLED(CONFIG_RESET_GPIO)) { + pr_err("%s(): RESET_GPIO driver not enabled, cannot fall back\n", __fun= c__); + return ERR_PTR(-ENOEXEC); + } + gpio_fallback =3D true; =20 ret =3D __reset_add_reset_gpio_device(&args); --=20 2.47.2 From nobody Fri Dec 19 20:33:48 2025 Received: from mail.zeus03.de (zeus03.de [194.117.254.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76AEF2D542A for ; Wed, 15 Oct 2025 20:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760561979; cv=none; b=qvL9dk2ou1LptMfIBRT5Oav0ZW4vqMhP5PvcRm+OHV+6RQzGQ470JpkQZqCdKIKQEPCBSdEEL+zho6mvSQj3tmcYo1Cl8HTQdsfQcbr3YaJLssBUEhDlYBKIgVFHUApcJkoP2Bgs1CkHYyJGbbjVCR9NoxYuz1C99fXqBNEqg1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760561979; c=relaxed/simple; bh=hHkJaslv9pTSLcWmR4NJ6/1Y+F2EdqwOR0WtkBGIEVI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MMqRpwMMqICmAD83JRCy1xirgDilJDGpmOuVR+9xjGYorWCnZiX7/AQtwNfG/93eIlYYDpjCFbATH9WoKBzOCyi4WRBKbJreg3dniJsd+vO4A98am/jL8cjYCapoHhUg0N/0/4QoZtWH90m6GQHcGq2w8bZ6szY9Eg2t1JmhMEg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=h4KSYI8e; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="h4KSYI8e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=qrOpAnaFk5u2q+ex2NLTTT5QD1yc7kE8oi/y+jafIAE=; b=h4KSYI 8ev+93M6g7vq6J1HaNJZADJsTcu7SaBksA8eT+62i9d6K8+8fJK6I9QhvnDvRAe3 gwyq6PTMFB6GzNgR90g4Vy8iKjWj7NczAgxBtxz7zyAqTSVpsZ5awyU4xphBMqwn W4z4/GaqYkTO1RA8fLgynkf/XDRCMPwjkmRfeN61JbTWlLx1qgmVsepYmxh8y1UP lh7GDw/BH0Wwd3TNM1xT+KKCrvVxXZdyM52p2m/eXDbdZTbr18VTQsgi0yBOW6Y/ 4ysxC5NHQFs62aF4bsjwmwZbaATA8TFc4nIKWS1qMRrHtszCRUjCalaygXpkhDC3 5042f9n5rY2BojZg== Received: (qmail 3545000 invoked from network); 15 Oct 2025 22:59:33 +0200 Received: by mail.zeus03.de with UTF8SMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 15 Oct 2025 22:59:33 +0200 X-UD-Smtp-Session: l3s3148p1@yU8NxzhBbrMujnsG From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Kuninori Morimoto , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, Wolfram Sang , Philipp Zabel Subject: [PATCH v2 2/2] reset: always include RESET_GPIO driver if possible Date: Wed, 15 Oct 2025 22:59:22 +0200 Message-ID: <20251015205919.12678-6-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20251015205919.12678-4-wsa+renesas@sang-engineering.com> References: <20251015205919.12678-4-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reset core uses the reset_gpio driver for a fallback mechanism. So, include it always once its dependencies are met to enable the fallback mechanism whenever possible. This avoids regressions when drivers remove open coded solutions in favor of this fallback. Reported-by: Kuninori Morimoto Closes: https://lore.kernel.org/r/87a51um1y1.wl-kuninori.morimoto.gx@renesa= s.com Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Tested-by: Kuninori Morimoto --- Changes since RFC v1: * new patch drivers/reset/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 78b7078478d4..7319bcd251dc 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -5,6 +5,7 @@ config ARCH_HAS_RESET_CONTROLLER menuconfig RESET_CONTROLLER bool "Reset Controller Support" default y if ARCH_HAS_RESET_CONTROLLER + select RESET_GPIO if GPIOLIB help Generic Reset Controller support. =20 --=20 2.47.2