From nobody Sun Feb 8 19:35:42 2026 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 1C5C73168FE for ; Wed, 15 Oct 2025 11:29:42 +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=1760527787; cv=none; b=VLncYtyPN0nbIq0Jw/isZt/6B8rm6hyH+SIk6bLiZS3FRusuoUPBVkw2CzXO+TL6UHRYy2oCoocYULkRifDDT3x9lFrjUturd9bBv7gs2B1o/rBEuWFrvftaPHtS2lIBOu09NjLhluGR2ShyE7mfaJIDgHFFwhColC5L8RTkxOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760527787; c=relaxed/simple; bh=cvbc4bQsfp6XJXPd4RR86XSedJxcuv8j3+iJpY/Z290=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IEyaPjhTqhso9gw4bg4q2trw3MAJgKgq94c6hJPXAfvH66pRcAMPvZkgYYV5KGJxkthhk4kGDOVlrQZPNEuxNWfXIolh1bNo+P/l5LVtGN3hSaOqMwkVnFuyxAd0CFU4xxOQFqs/T05CUMoyGqLQvANPMey+OTVSoCXbopQrv4g= 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=AuYOSJPq; 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="AuYOSJPq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=k1; bh=M2uLmgje3ebm4+ kl1NOOb5d0r1B8OIFraXJQh54wt3Q=; b=AuYOSJPqfGiIXF7sJjp2f8TXTRX6jf kgNKHGGwDxt9EmF6diCEjxTCcM87I9z9g4JLZi3lRcPKZO+T/O9B3dtN25iBartJ s0PU3Pt7Nj+Gb9qgjttju99FljNgtA04xOxZKmLy4+NkAnsWreSIWkW3E0RcXoua 1TyTo6Y9OBXjifVAOjN2r5Sx/VAEWmxQP4nfBes1tzb8sz5pHTkza4vwgkzNkftI QJxnZGzrwLu+CLKc1vG5iIo8WGEEd4Xe/SxAUMjPYuWfNjij3t78tFUV8DvZfjWK OSnGJHs9B/Ld8Zk1yq2eEny653T5YyD7+6SCHV5QL+3kDUtVu4R5N1hw== Received: (qmail 3376364 invoked from network); 15 Oct 2025 13:29:41 +0200 Received: by mail.zeus03.de with UTF8SMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 15 Oct 2025 13:29:41 +0200 X-UD-Smtp-Session: l3s3148p1@L5Tt0DBBxLkujnsG 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: [RFC PATCH] reset: always bail out on missing RESET_GPIO driver Date: Wed, 15 Oct 2025 13:28:59 +0200 Message-ID: <20251015112921.19535-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.47.2 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. Reported-by: Kuninori Morimoto Closes: https://lore.kernel.org/r/87a51um1y1.wl-kuninori.morimoto.gx@renesa= s.com Signed-off-by: Wolfram Sang --- 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, con= st 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); + if (!IS_ENABLED(CONFIG_RESET_GPIO)) { + pr_warn("%s(): RESET_GPIO driver not enabled, cannot fall back\n", __fu= nc__); + return ERR_PTR(ret); + } =20 /* * There can be only one reset-gpio for regular devices, so --=20 2.47.2