Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2674315lqp; Mon, 25 Mar 2024 06:21:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMStbU9rdYTpny/+SngWseYGSA7/7nBnMn5sn1F6u90PUZiLYkjxLjZOWBXpMTPQJUOjyxC0+tSDNSITnEylV1L2G8AnvNwysIcufWhA== X-Google-Smtp-Source: AGHT+IFUjdzhD1XTqMAHm4ITJq0pWqNBJ2LrTd2NFRR4WHD9QlUvmo4FTp7r92X3weIa9Z86ni/f X-Received: by 2002:a17:902:c40d:b0:1e0:30ca:62c with SMTP id k13-20020a170902c40d00b001e030ca062cmr10468413plk.1.1711372906459; Mon, 25 Mar 2024 06:21:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711372906; cv=pass; d=google.com; s=arc-20160816; b=B4ztdz0kPfzjVfcxOXVZMRT7hzhP3lnF/wv9jaMJxRWReZ2UVIDmSgMbs4+OEE0wg5 ENTEH0LKE31KIKO6siP2xmf34hN/JzZ8kYl0YHPLk0tZ2ZCAbhoqhGcb/YSCXjNbjbEl xAxtykjMtKwUypT2GFhua8ebqouUsWXrWMi6f9wZ8VkOg1VxUv26gVABNSTgGoe6Lf/a aSU26QxTWgX5sRUrEgT5/U8OBtKYuXvOnT51ysRH8GFvCbi6SqfoEjUduVjG2oTyjSV9 OHYefS9GLgcD0agdpFVJrEJLdrbIvsPyExmrgnR93YY9Vr8FWjLH4qEQGRg0Aq1GoazF 8TNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=0e6gJzrH+joprqOrJDBhZYsmT33EgzralNmKerfCVs8=; fh=1bxph7JuguQdLRKlgWRVuE1iKtsQ6/OOo/3ltO6LjD0=; b=Uc9Yp93C/Xq2qQQMnWCqFJN83ykB3dol7kclsFGM41jqW/vKGAdy2UcGngveNIYKRz JJ6cYDfuXLmifxFshzdGGKD5J13T1C0MGp/qwNqoOXwRz20eNm5pB0Ai7CGPZmJN0EmM xIiy5Yyz2aazQkrl6bAYe/RY7qQMjVl8KtRCe62mOGgEDqLH4JpIxsobPo5uSxsmEYth +kKI6su6c20w3Bqj8LKH4C7uETeaZh7GeHCLZ63SUSot10OmaYAC8g4yXeaFxURAzlL5 PyEQRKr34FgEbrPXGKGgkbpmpzxgns9BZ7vwdZu1gUjJBwdIZjAQv0Frjbk5V/rz1d6J 5akw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=saVe5D7Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y1-20020a17090322c100b001e073e45b79si5226690plg.148.2024.03.25.06.21.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 06:21:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=saVe5D7Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9E8F22C4352 for ; Mon, 25 Mar 2024 13:20:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51EA514D45E; Mon, 25 Mar 2024 10:26:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="saVe5D7Y" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AB13818E0CA; Mon, 25 Mar 2024 08:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711354800; cv=none; b=D/zQ/TFzM5VK51NHnozyJs7Hkj2F9N5OYRAQ5Z0NDsYcoWeo2bkn7VI8SzWpfRhxoox/43JBOgTVStM+n5CkDKzjvW3Weo7eqt53wtCK2w+5t6OrYvxVBKfhtJ/zh/pM+Fhq962jUohut6NTfdMsLkt4a6IQ669+OKnpdoULN+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711354800; c=relaxed/simple; bh=VUHc+tkUJVEFMl8ci6fuYuXOdzY9EDJ895oRdy4VAlE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CdC8ZKMK1psPQOsHITCYAJmIG/xBJpVkt85Qxe0YHLXrkIojedULvNLaRJp50o+toS+l/Pj9+TxloX/MvwTzxfQ/rogelKbiYslTquTsLngxKyEHnFcCjcqLXT5zfcEIx4IT/5PSeLGt4E2j7QvS3TuHDF9eaTIx0UMgyu9CYgI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=saVe5D7Y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32B22C433C7; Mon, 25 Mar 2024 08:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711354800; bh=VUHc+tkUJVEFMl8ci6fuYuXOdzY9EDJ895oRdy4VAlE=; h=From:To:Cc:Subject:Date:From; b=saVe5D7Y4O3+jJDgqxIrHPbSGo2YsWpd+AOxuhmE9oLb3lm54/OcNDzO81fMDSYDT ZCNfZRa2DuVfTNxu5jTjaivLtSorJD/eCSHDs0jageMy8yGJzfSjIaYfLJD2UKSdhF dqtj/C2L87IVILdRIrQ+OidJvolDuqjL1R57+YfD6imqNxvkjmeWhaK/YrEJjP88Ql 5CdIl/4QAA2eBtUexAK5RE3CfQaNoVGG2U0/5SMnVR+HufB9rtTnMNoUoNyNV5lxYI GrhgtP5jLtMIs89n1nqSFLFxoYAHrYntCqKyFTAvCWKAnz7BIzsA6brtGIX0v8bnOJ DpI61KpZpYN2g== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rofYs-000000002qj-28tE; Mon, 25 Mar 2024 09:20:06 +0100 From: Johan Hovold To: Bjorn Andersson Cc: Konrad Dybcio , Michael Turquette , Stephen Boyd , Liam Girdwood , Mark Brown , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH] clk: qcom: gdsc: treat optional supplies as optional Date: Mon, 25 Mar 2024 09:19:57 +0100 Message-ID: <20240325081957.10946-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since commit deebc79b28d6 ("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") the GDSC supply must be treated as optional to avoid warnings like: gpu_cc-sc8280xp 3d90000.clock-controller: supply vdd-gfx not found, using dummy regulator on SC8280XP. Fortunately, the driver is already prepared to handle this by checking that the regulator pointer is non-NULL before use. This also avoids triggering a potential deadlock on SC8280XP even if the underlying issue still remains for the derivative platforms like SA8295P that actually use the supply. Fixes: deebc79b28d6 ("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") Link: https://lore.kernel.org/lkml/Zf25Sv2x9WaCFuIH@hovoldconsulting.com/ Signed-off-by: Johan Hovold --- drivers/clk/qcom/gdsc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index e7a4068b9f39..df9618ab7eea 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -487,9 +487,14 @@ int gdsc_register(struct gdsc_desc *desc, if (!scs[i] || !scs[i]->supply) continue; - scs[i]->rsupply = devm_regulator_get(dev, scs[i]->supply); - if (IS_ERR(scs[i]->rsupply)) - return PTR_ERR(scs[i]->rsupply); + scs[i]->rsupply = devm_regulator_get_optional(dev, scs[i]->supply); + if (IS_ERR(scs[i]->rsupply)) { + ret = PTR_ERR(scs[i]->rsupply); + if (ret != -ENODEV) + return ret; + + scs[i]->rsupply = NULL; + } } data->num_domains = num; -- 2.43.2