Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2909761lqp; Mon, 25 Mar 2024 12:45:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4QMHarKm9RjpPJlBZ46Wjdd6zgftMGSvq2Uzh0VWvdV/iL8QXwYJCqTvxHg6Bdryg8+uP1oXzbfN4j+J6d65nRHPwyRoMUTmQoIx3Iw== X-Google-Smtp-Source: AGHT+IEdK0KIfgSXwAZzToTzzvn1xif4fYC0y/NqQHNF+by420ImSgr4qec9MEMrlOZAgjMAPPZG X-Received: by 2002:a05:6a00:4b54:b0:6e6:57c8:6ffc with SMTP id kr20-20020a056a004b5400b006e657c86ffcmr774231pfb.18.1711395939975; Mon, 25 Mar 2024 12:45:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711395939; cv=pass; d=google.com; s=arc-20160816; b=SNq5+APOVAladlSq5APcgAoDJWbqiEKBnIMIAfd/jFaX3tq14LFw21GnjN2mWu2Uef z2vFwxHGjEuIzPmL0SnL84z5oe7KiEc1m/QaIR5nTDJJTKDzSFgQO4xuSCKQxPanPNkt oD3P4uRQgWw04D4ZB0M68/PpbpXI3bdTgg2Z1w1XKq2nfWrmkf76dGXM6y7Fn7Bo0viN BmcuASpUbO04P5z4r2/MW5UtpxUE3adanl6odeYzuTbfAnMtY9Gp0BIHBlKdIx7S08Gj f9PN+80Jq3ZgJrnMU9P0AIJrT2JO+vrgJAXhpd5pewZFcrs78VuDsDW52kWqzKpXwr3X AC4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kU+LgPhpMuuCUwMJ0pLlxs5OLHymRrQDFShAltTdr4c=; fh=BbJfC1E9bmqBoYtXGTMqiHQtmo0jX9KXhsVDATUepJw=; b=lX0OoOBHUGA7dusrm+mcTVIZ9arL3MRxrZfn0r0Ikpnp/ctoRysGwnSxFEWyjIsODU jn5cq9RL3b+P4lRX9L2K04eKsJSslJQvhJlN9XiEBYVePR/u5EkMq7rcG075orVOCKa6 SbXAW/0H4JtZXI+v5OZkeILaVKCETkvo08PLkewG7RdmrAPtDzHZKpAnpQVFRDUDyQSE MW8KMr9ptRXoKYQJsjwSh6ncqlC4Kgw2WEJjq8HU+0rFYKw1HnqOxIJuB3mq2kN3QKzI faJnKtyqvFAWRUA+EDEbd8dl2icq9sOSQuSTH5ulMK6vRS4GE/kcPZ22cdThbqpn+ENp 5hpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="PInVnx/1"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117198-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f4-20020a056a00238400b006eaae491c00si2199762pfc.16.2024.03.25.12.45.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 12:45:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="PInVnx/1"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117198-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8041AC448D4 for ; Mon, 25 Mar 2024 16:13:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5067128824; Mon, 25 Mar 2024 14:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PInVnx/1" 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 C8C9714A8B; Mon, 25 Mar 2024 14:02:56 +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=1711375376; cv=none; b=XtUmuo+Madrl3nYJhBfkaNoEMuiwCd+72JMJ4rvSPL1WQV+svCt2aAxLwnlC+McWf0fr435dBkRpXdjsEBy47023CHMxcJmFGGE8nXditbR/bi2QmxeS3LY2BBJNvDwZ018ybSTrLMjV3f7L+aHDpwbYMScbJk8wIQuBEnqmTY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711375376; c=relaxed/simple; bh=LK9smWuFEaz05Mp9x+m54fvpRDKiNeTfa5BBHlCzGmc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rnZ+dyz7hgrAFES0LzH6sknoG2e3Sw/AvUN28cVMEjJ1JRMK76t+m9qjdQTNHh1EFOuA+HtqtksyGZg++GpiIb7xWP93cTJ4SufW98/j6vibL3MVtl0VHv/5R3NttHf2a+5ZoOKp3QFqrdWcpe6TQ8Lg6tsP/Izmv36DdS74yMw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PInVnx/1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 886A0C433F1; Mon, 25 Mar 2024 14:02:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711375376; bh=LK9smWuFEaz05Mp9x+m54fvpRDKiNeTfa5BBHlCzGmc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PInVnx/1wR5q2p6s1rAvd7TaCX+K8ktpCtuW0gLM/Kn1O1r4FnLG83UzhLEB5HclE rY+S2DUIfqXXEPGhl1g53LMhAwYz0FyqbMdFn4TtET3D4SK1/zlqtq6P48pfhMhJdi X9YWGgOYEP3r50Mf7reLFz/P14hTZlR9nKIUyTBwwELk9lwZXyw29LgyPV0BzC8Gak LzS4S9BtBisprlsuS9/XpCivHB3hGklkHQ7IqefIwAqu7G73Q0PvOi4/eEJBiOWf/M /pEuPlUGpwdjQUkQo0vni/gmlfWGMD0OMvt93XK0Sh/UdRzJCuknav2ktdLIE9YNlo CTOhy3QdaNCdA== Date: Mon, 25 Mar 2024 09:02:53 -0500 From: Bjorn Andersson To: Johan Hovold 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 Subject: Re: [PATCH] clk: qcom: gdsc: treat optional supplies as optional Message-ID: References: <20240325085835.26158-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240325085835.26158-1-johan+linaro@kernel.org> On Mon, Mar 25, 2024 at 09:58:35AM +0100, Johan Hovold wrote: > 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 Thanks for fixing this, it never made it off my todo list... Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > 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.0 >