Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2678500lqp; Mon, 25 Mar 2024 06:28:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXUKokfJTQsfe1RqZbF1ddalqR3QIOD4vZ9YpHLAORkLpCN3qYXXzLFk9mOkfUmehqEkT5Vp5+e4RSkdpkOtFLDWZdAAOcw3vSy0UeRDQ== X-Google-Smtp-Source: AGHT+IF9b4txkntWWE665izMowXY2RB4IvwfzqHxEq8SmXjZeUjwsmq3mXYTErcvNk458MIZKV6m X-Received: by 2002:a92:c681:0:b0:368:75ce:a057 with SMTP id o1-20020a92c681000000b0036875cea057mr7696019ilg.28.1711373329837; Mon, 25 Mar 2024 06:28:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711373329; cv=pass; d=google.com; s=arc-20160816; b=KIf6YHFrbsWScN+28hPDhER3pK4OxUyNUJ09UNWNJM9SMhCX2J3ugUnmes9hCqYQAz 8cAyrX51UAPKNiAsqHfjOuVA5bXdtZaZmDOwtdAx5ey3IOkAIX3DQdBXxda3Ds2ozpW+ yxOFCADmSxAo8TctZvp3LlJIeaJcG1OIwvY2be/ZVNGec9PvXqZlOrNOejdA6FdDAcjN l48Jeea7iYLU1Nd5Zen9i9+Pj9pqm88gLFBBmEyBfU+lo0AJ+VVKvoZ4wurqaX81baPG mayq5ZzUeyNAxb+ynRxNhUxtTPzgClU2zx8qi+n1ufSDiizh5cWTWhXJbK7b3a5nE7RA AYsQ== 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=KD6msl6CzTB6Uz9CWn4pohB9FAyzyZ+y6/jaHsus+H4=; fh=1bxph7JuguQdLRKlgWRVuE1iKtsQ6/OOo/3ltO6LjD0=; b=He6PRUBKUN6ZIcZH+lTrKEor7pUkW1uSoTg1OpJZGCw/EWgdZX5q740YinFJKzvyqe fqxJx/Zplp85k7y+tt4x39lW9ZY8fhZUsabIOoSXnZuiUkcezaB8XKSmmzx3xCEiTX0y YwMb6FCIV6MvoZ8GOfjcqiHQCucC915xIjBu/0ln2qW2aYLFiFZfCf0BZMlv92GgJl4s ZmC/09NDtX0r++W69WSFESQEA6jF16hefGBt2ECISv25BeueY16XBtAOimV/WtIT1evh nEAIblpVilmVLMoE+DCwnY1GGz7dy6ScTAWKvT7MOjS20EyOwdyYv/PuTwomDfWTfye6 nTSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oImfIzH4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116726-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116726-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 m21-20020a63ed55000000b005dc927ee2fasi7520343pgk.710.2024.03.25.06.28.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 06:28:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116726-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=oImfIzH4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116726-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116726-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 C90462A3E0B for ; Mon, 25 Mar 2024 13:28:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 292FE15FA93; Mon, 25 Mar 2024 10:31:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oImfIzH4" 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 EB953153BFB; Mon, 25 Mar 2024 08:58:53 +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=1711357134; cv=none; b=XPY+INgcuVOwP1sOyj/Hf6075nuvx1hdRsj8XYzWOsp2jLpRtBX6khYg5ciWR6aYY6P37KIY2U48cULu2vYUEeHrMfHTS+m32MDlNy+VWKJzrskxw+kZ6vpJhScdmxqsNJ5VwzjEBUrABSuM1q3DG1e4RBb+UXF10s88Fhvlebw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711357134; c=relaxed/simple; bh=3kNKmqcvjVl9nlFohKUhmUZ38lAcXqFMYW0taY9PxKY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=azzh19sbivbktodqcLXw+Ym1iMFEwtYjlfP00Ht71uIPhpD0tQRkZ/VXB2F5QrwWz6VEh76yc3GGhQ3K1YPG9EsE5EUi6RGUfmRmtL/uyEdU5qhV8g8y3y3xJ8M1W62z4EzV4pflbOPt+bgDkj3JxjWSa9w0ZWx5MJ92ZSdrqvo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oImfIzH4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DD60C433C7; Mon, 25 Mar 2024 08:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711357133; bh=3kNKmqcvjVl9nlFohKUhmUZ38lAcXqFMYW0taY9PxKY=; h=From:To:Cc:Subject:Date:From; b=oImfIzH4/qvEdDO3AwkDkR7EnD3/B2jEwyrx1KjwbLPqJBL4JJUdDOWCDz1OHLFn5 +flteqqS+TY+iBHAQkqp6hlAjMT64I/p9vSwOCbfFHOfi97mm3m02BraIZOxMDijvH cFn7+1F1y4ySeq+m19i0DUQ0jlv2jCP4W4fI201zasC5Ulj17ZzJASVWXZUlXjBjkG kQO6EBv+9bvHjUcGLf1gu6gI7n091LENfmyK2cE3G7PZgIdGnH3ka5hDw1mTN3eBIT HCrsOFwZ/aT59EaShg422gResSK/054X1ytTYI0OCgx6AbNYZgE0+OMMIsVVoKZE9w deZWOnVsqVZeQ== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rogAV-000000006o6-3A6x; Mon, 25 Mar 2024 09:58:59 +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:58:35 +0100 Message-ID: <20240325085835.26158-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.0 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.0