From patchwork Fri Jun 23 21:49:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 112349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6071254vqr; Fri, 23 Jun 2023 15:19:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7MXKbqEKQ+tlO1riQn2N/vpdPw4v8nX1aKXsbXgmMxLsqNrrENMrSnYImyj8Q5G6vB1Gsq X-Received: by 2002:a05:6a20:12c7:b0:118:384f:89bc with SMTP id v7-20020a056a2012c700b00118384f89bcmr27343932pzg.27.1687558781492; Fri, 23 Jun 2023 15:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687558781; cv=none; d=google.com; s=arc-20160816; b=xY37ftrdQX45zpRYaRlZ5w1RVmEB2QEU1e1Lcvy3v2xeyGfb6Y8Tvf+IpD5x9xXdSN WPNFl29BmbkVSVyr4tJKh62aDJlQ602Vkjqsr7Ub+BeJkxV1bgK1R26Q+PQbGzQy+XSA cvy7t20II6/vcvmYqa/t6n/79ipv/UVRltuP3R76lDTUT4Xs/6pUXGhUHjsCfHE0q3oI WIgVKzmJdE0gfEcrYoGrR//VGVE6XeKJmha+prC3zL0NfrhajEjRQ4BsmF97haoPgXmM lhIQZbJt9B96ZucpP+Q4u9/sPkd9RLY8end/RQJnfvZjKUUM7sQEqzmouoyFztaeV/3J JWEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=RT+DMw9+JmEB+4blOGBEOQCCmDaLSKVa4tRJvUDZHYw=; fh=VsX4z0tyvf0RAheyUx8BwMMyitohmjFBru78Qc382AE=; b=Nue7J02OxA19QPVMdqiYIifoYZyZq5VOoVJdUtFsMZE0naJ1ROxVezTnV1f4xQBcNA 0y7r7+GWjweb+dZjgm7EH+OYhqzWlQ/1AbnDqv/Xvu5ZXioiDNof5fqYDg06y3zklnTj k6/ZXt8ZzqF3dDUEFfn0M0cTTBp9uiEoUDBl8ZtgCGNqFSEbB4U3krEG26MuZPeaBxGV QOpnNRbbyEHS9kAmZIWEVJ2scC98vts01/NcgFjXEPKaYmpae2EWEn1kVLFNkWtMU2y3 Vf5IwEzl9UsDtefqClxOF4wzQ3tuQ5GKNokyyMTN+ExFRpvilSHq4siN/2JoxPFlJDRC ZXwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lecwxWvF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l27-20020a63ba5b000000b0054fe20c31e6si323884pgu.649.2023.06.23.15.19.28; Fri, 23 Jun 2023 15:19:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lecwxWvF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232877AbjFWVu7 (ORCPT + 99 others); Fri, 23 Jun 2023 17:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232792AbjFWVtr (ORCPT ); Fri, 23 Jun 2023 17:49:47 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CE342701 for ; Fri, 23 Jun 2023 14:49:45 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2b46f1256bbso27374691fa.0 for ; Fri, 23 Jun 2023 14:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687556984; x=1690148984; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RT+DMw9+JmEB+4blOGBEOQCCmDaLSKVa4tRJvUDZHYw=; b=lecwxWvFh2wABTwinbKbk2vXyK+vMqENR4o606JLOknjCo4R7wcHxvGUjmLWqT/pNp 6aZ/g+tzl+sRjGqw8AJ/A+09KAlA5CnoqeCh6VSOLFloP8o+/miSQhzVG8mrbivrSyA8 v0co5soOG49maSVuTMUkmwygSjbEDxl5Pe6JOQ5rKCiuNbboHHr4WiosZR73j+mXerQ4 D2BpLV1F6VNgc9eFxX4qs3UNBNPHaeOikR2B6jinv5Gwd0qurQJxmR+8vZEb+ebWM3K1 Zfw0LWBTNz5/ftSOHjrsWj8IzgdaiP6tqig9fgTtYqd2IoytDc2lNQGGfiVH+sKcU+oj UNwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687556984; x=1690148984; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RT+DMw9+JmEB+4blOGBEOQCCmDaLSKVa4tRJvUDZHYw=; b=EKG9Wzg4IomayfB8OBNNkFmgcDm2ZcpkCYqh1qydo9QY9Uw7bYExpif1UK641DN0wZ W318IfSXsIlQ9cvEiEgR5C7tHAnBF20olFppOvAGlRDPJDXhmGyETUUxS1l41snas1BV +yPDl4NaUAmwiz2LfPraCzivMUzwVAlgkClAwMhGdeULXHDoYCx1ijpbDtYHbQSGqXnp 1l7p2a4Jt3JNh3mMGo8OR0asUArgGG4XtGcBO+ydJA13uIm4gwSS+gf73zYHHm0xT5Jw YS5X3BsgvkeaJHBUH23mC4idCkZzuY84Kl5V8G0Q21FNiKoAQoZ5tbXWRcPzCRRzi2PY MxIg== X-Gm-Message-State: AC+VfDzdDYXMR2D/P8jEILSsEZ2NUeBeSVGh4HTOnaukI3JogJLN09Du lLfH2Uc+PArI3RN0sUKdcQy1ww== X-Received: by 2002:a2e:9d48:0:b0:2b4:50b8:5d3b with SMTP id y8-20020a2e9d48000000b002b450b85d3bmr7576901ljj.0.1687556983889; Fri, 23 Jun 2023 14:49:43 -0700 (PDT) Received: from [192.168.1.101] (abyk30.neoplus.adsl.tpnet.pl. [83.9.30.30]) by smtp.gmail.com with ESMTPSA id x20-20020a2e9c94000000b002b48437dcaasm1840919lji.103.2023.06.23.14.49.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 14:49:43 -0700 (PDT) From: Konrad Dybcio Date: Fri, 23 Jun 2023 23:49:42 +0200 Subject: [PATCH 1/3] firmware: qcom_scm: Always try to consume all three clocks MIME-Version: 1.0 Message-Id: <20230623-topic-scm_cleanup-v1-1-383089eae98d@linaro.org> References: <20230623-topic-scm_cleanup-v1-0-383089eae98d@linaro.org> In-Reply-To: <20230623-topic-scm_cleanup-v1-0-383089eae98d@linaro.org> To: Andy Gross , Bjorn Andersson Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687556981; l=4598; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=20MGaxR8SA/gitewjqJ05iW6t2qyGVNzk/M4vihgecc=; b=U+OJNRvlUVPfRdWvMndA3yI0+ew1J+eFh+Hvmxc5NRWEkkc7Hsdgqx5xIwmZmGGqlQmYtXvJ7 vCWfFMjPASBBOXevpw72vOUYRfsus9HEu+cBPvcoYYJFozf8XrBn6Ry X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769533637039922424?= X-GMAIL-MSGID: =?utf-8?q?1769533637039922424?= The code for handling more than 1 clock is a bit messy and requires one to add new, SoC-specific compatibles if one wants to attach a clock. Switch devm_clk_get to devm_clk_get_optional to prevent throwing it from throwing errors when the clock is absent and defer checking the clock requirements to dt schema. This lets us get rid of compatibles that aren't necessary for backwards compatibility *and* will hopefully prevent the addition of meaningless new compatibles. Signed-off-by: Konrad Dybcio --- drivers/firmware/qcom_scm.c | 70 +++++++++------------------------------------ 1 file changed, 13 insertions(+), 57 deletions(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index fde33acd46b7..dfa298347041 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -26,10 +26,6 @@ static bool download_mode = IS_ENABLED(CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT); module_param(download_mode, bool, 0); -#define SCM_HAS_CORE_CLK BIT(0) -#define SCM_HAS_IFACE_CLK BIT(1) -#define SCM_HAS_BUS_CLK BIT(2) - struct qcom_scm { struct device *dev; struct clk *core_clk; @@ -1425,43 +1421,22 @@ static int qcom_scm_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, PTR_ERR(scm->path), "failed to acquire interconnect path\n"); - scm->core_clk = devm_clk_get(&pdev->dev, "core"); + scm->core_clk = devm_clk_get_optional(&pdev->dev, "core"); if (IS_ERR(scm->core_clk)) { if (PTR_ERR(scm->core_clk) == -EPROBE_DEFER) return PTR_ERR(scm->core_clk); - - if (clks & SCM_HAS_CORE_CLK) { - dev_err(&pdev->dev, "failed to acquire core clk\n"); - return PTR_ERR(scm->core_clk); - } - - scm->core_clk = NULL; } - scm->iface_clk = devm_clk_get(&pdev->dev, "iface"); + scm->iface_clk = devm_clk_get_optional(&pdev->dev, "iface"); if (IS_ERR(scm->iface_clk)) { if (PTR_ERR(scm->iface_clk) == -EPROBE_DEFER) return PTR_ERR(scm->iface_clk); - - if (clks & SCM_HAS_IFACE_CLK) { - dev_err(&pdev->dev, "failed to acquire iface clk\n"); - return PTR_ERR(scm->iface_clk); - } - - scm->iface_clk = NULL; } - scm->bus_clk = devm_clk_get(&pdev->dev, "bus"); + scm->bus_clk = devm_clk_get_optional(&pdev->dev, "bus"); if (IS_ERR(scm->bus_clk)) { if (PTR_ERR(scm->bus_clk) == -EPROBE_DEFER) return PTR_ERR(scm->bus_clk); - - if (clks & SCM_HAS_BUS_CLK) { - dev_err(&pdev->dev, "failed to acquire bus clk\n"); - return PTR_ERR(scm->bus_clk); - } - - scm->bus_clk = NULL; } scm->reset.ops = &qcom_scm_pas_reset_ops; @@ -1512,38 +1487,19 @@ static void qcom_scm_shutdown(struct platform_device *pdev) } static const struct of_device_id qcom_scm_dt_match[] = { - { .compatible = "qcom,scm-apq8064", - /* FIXME: This should have .data = (void *) SCM_HAS_CORE_CLK */ - }, - { .compatible = "qcom,scm-apq8084", .data = (void *)(SCM_HAS_CORE_CLK | - SCM_HAS_IFACE_CLK | - SCM_HAS_BUS_CLK) - }, + { .compatible = "qcom,scm-apq8064" }, + { .compatible = "qcom,scm-apq8084" }, { .compatible = "qcom,scm-ipq4019" }, - { .compatible = "qcom,scm-mdm9607", .data = (void *)(SCM_HAS_CORE_CLK | - SCM_HAS_IFACE_CLK | - SCM_HAS_BUS_CLK) }, - { .compatible = "qcom,scm-msm8660", .data = (void *) SCM_HAS_CORE_CLK }, - { .compatible = "qcom,scm-msm8960", .data = (void *) SCM_HAS_CORE_CLK }, - { .compatible = "qcom,scm-msm8916", .data = (void *)(SCM_HAS_CORE_CLK | - SCM_HAS_IFACE_CLK | - SCM_HAS_BUS_CLK) - }, - { .compatible = "qcom,scm-msm8953", .data = (void *)(SCM_HAS_CORE_CLK | - SCM_HAS_IFACE_CLK | - SCM_HAS_BUS_CLK) - }, - { .compatible = "qcom,scm-msm8974", .data = (void *)(SCM_HAS_CORE_CLK | - SCM_HAS_IFACE_CLK | - SCM_HAS_BUS_CLK) - }, - { .compatible = "qcom,scm-msm8976", .data = (void *)(SCM_HAS_CORE_CLK | - SCM_HAS_IFACE_CLK | - SCM_HAS_BUS_CLK) - }, + { .compatible = "qcom,scm-mdm9607" }, + { .compatible = "qcom,scm-msm8660" }, + { .compatible = "qcom,scm-msm8960" }, + { .compatible = "qcom,scm-msm8916" }, + { .compatible = "qcom,scm-msm8953" }, + { .compatible = "qcom,scm-msm8974" }, + { .compatible = "qcom,scm-msm8976" }, { .compatible = "qcom,scm-msm8994" }, { .compatible = "qcom,scm-msm8996" }, - { .compatible = "qcom,scm-sm6375", .data = (void *)SCM_HAS_CORE_CLK }, + { .compatible = "qcom,scm-sm6375" }, { .compatible = "qcom,scm" }, {} }; From patchwork Fri Jun 23 21:49:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 112350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6071392vqr; Fri, 23 Jun 2023 15:20:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xYypRg+tz9pmwpU0yfkL+zPmiKAj/8kg45A6INonM6WlBXTsNgl1Zv79nGDMVurWYxDYq X-Received: by 2002:a05:6a00:1914:b0:668:74e9:8eea with SMTP id y20-20020a056a00191400b0066874e98eeamr16602927pfi.33.1687558802375; Fri, 23 Jun 2023 15:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687558802; cv=none; d=google.com; s=arc-20160816; b=lkiEevrY1SAsUDYn1pzOMLSf1/RY2xLiP76jvT4HrL8+MbpaXTHsHg6OiEpb25mER1 +mWNWQK0WKGT7NURgShnornVFgBYgnyLVj0El8+eWTKbt0ScTlqzYwsj8lHom3uYpJXn MzLxm2L+WXywPrXF4acsySuiYo651YMyGuq6q3JyZODhCMIBfUne7d5KOZsnHSyffN/G sT0PSTN+vpUV6mdhkeq83W5We/UqaZWp3rOAJl7MhnpdDMloSuT1JDpCef15rOvjF759 1tudYrQKCXONGr6EqTG4HPhMeGGG2UoMOTFJjBVrYyv2rW061DJyNng8JMvE0sHu+79F S1qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=5DBVmcbPM6O4YzyX5TBk3hTNZ7EUrOs7o/4qOremoNA=; fh=VsX4z0tyvf0RAheyUx8BwMMyitohmjFBru78Qc382AE=; b=LY/83BVNaFaionJNKnnNqSejkRx0Ye1SQlOkJfNBxdCQzAaurNInlRt62J44fYKk/f 3+BOiQn6jI3NUeBUkj9CgYIM65Hk25F9newkkXn/zDW6Cy8Zh8upk85P6gQON57Ccof0 GhcsQkj/g5GImRta5qdC7OaiCia0CZxnx2m788k81IvX1P+njz0r0nGhpinmui34RqQ0 1LLcpxyFlUwhMmgM5wdJRaa3FZVqpzcm9Bx61LFS3f3ofTXy9KQ+mWvrl3GlqcNtX6Jj S2uWR8rhEqdNVk55tsvw7y1Kp3YrWLbVitfJY2XZhC2m+PIuSw1MnGxADyfP/xuMlIA7 QN5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DLTVi3Ko; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n17-20020a63e051000000b005573ed4beb7si326812pgj.819.2023.06.23.15.19.49; Fri, 23 Jun 2023 15:20:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DLTVi3Ko; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232153AbjFWVuk (ORCPT + 99 others); Fri, 23 Jun 2023 17:50:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232807AbjFWVtr (ORCPT ); Fri, 23 Jun 2023 17:49:47 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8904E2707 for ; Fri, 23 Jun 2023 14:49:46 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f766777605so1504834e87.1 for ; Fri, 23 Jun 2023 14:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687556985; x=1690148985; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5DBVmcbPM6O4YzyX5TBk3hTNZ7EUrOs7o/4qOremoNA=; b=DLTVi3Ko6yVpZslF+BPqKOP0yiJUwxq4mfFrffeByYiurppR0iv8Pwj9rR+Es5MgkR 44er5a2wZohpMA5HoiEVmEhLqWdlTC6wKk0YQPdzimLPeV2brVMgFqaa4zGJ167odeuk LCqrxyhKuHvZ0RyxLdqqJhJ7vTTloIe/lTJoXFGxYGAbE9QGBgJLquMbFpvmGJJIwi4F ZJjkmQyfH9LuBHRFr6XXwd9V6ryr57hVuFPku3arzNnkJXBKofaNdsrcyVVwnRp1QKT9 v8qObWZs/Jk2iRhMEAYkagEpLKzTmL2zvS4WKenl0DO9/FbXHm/RQ4yM53u4/h4p2epQ QFYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687556985; x=1690148985; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5DBVmcbPM6O4YzyX5TBk3hTNZ7EUrOs7o/4qOremoNA=; b=XCJTvB+/oX0NpaaTS5dSdZDBTN3hKIg0glANEJ7/inY9SqsP2IUXxynPVc9YNQh8qS ue5P0CYR0ZrqnPyldGN0ihl36W2+TU8nl/V4YEIWdZRPZ8UZkV9MFvvyF3zalbRKajDz sD76bhAV5pxf9IBcO4tjE91yVKDF8iBxNy/eLDWDPNanu2iYmbl7nODcxehAYiR8Cjl7 PP/Rd1lAIXmMz55KBpDsASIReSRgW4M3eE3lEDw2dwY/LQRMlTTIGsS60rivllay+YTM ZgV2h3ZBcBpU82ZuiEAOd8gnf57RXHqhSU2g9nV6Afh0hPEkUVz48W4XcI9a1P6i+u1U yT0g== X-Gm-Message-State: AC+VfDyWp/Tv2NYwiblJXX+O+Fmg9DEa0T6cx3Jl7TY6HYx4bA9cYVi/ HtdEnOGfFRbuX2kDSE9omrrY8Q== X-Received: by 2002:a2e:900a:0:b0:2b4:6195:bb26 with SMTP id h10-20020a2e900a000000b002b46195bb26mr13985888ljg.25.1687556984775; Fri, 23 Jun 2023 14:49:44 -0700 (PDT) Received: from [192.168.1.101] (abyk30.neoplus.adsl.tpnet.pl. [83.9.30.30]) by smtp.gmail.com with ESMTPSA id x20-20020a2e9c94000000b002b48437dcaasm1840919lji.103.2023.06.23.14.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 14:49:44 -0700 (PDT) From: Konrad Dybcio Date: Fri, 23 Jun 2023 23:49:43 +0200 Subject: [PATCH 2/3] firmware: qcom_scm: Always return devm_clk_get_optional errors MIME-Version: 1.0 Message-Id: <20230623-topic-scm_cleanup-v1-2-383089eae98d@linaro.org> References: <20230623-topic-scm_cleanup-v1-0-383089eae98d@linaro.org> In-Reply-To: <20230623-topic-scm_cleanup-v1-0-383089eae98d@linaro.org> To: Andy Gross , Bjorn Andersson Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687556981; l=1572; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=pHysGjB4oZJ+5xN5W/FUx19qYCDxjkWrQHiYcbKX6uQ=; b=F9TfQwe9lA2sfHfajdi4PRDRwx/kETtoE4+UfIsGvDLi7W2Ey/0Aj1XfKriTsLSO9cvh0+L5l Aiesih+NUnqC8nf3K7HoDCSDZhyNQmUFCUg0jMBQKusn2IFa34idJ0v X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769533658496916691?= X-GMAIL-MSGID: =?utf-8?q?1769533658496916691?= If devm_clk_get_optional throws an error, something is really wrong. It may be a probe deferral, or it may be a problem with the clock provider. Regardless of what it may be, it should definitely not be ignored. Stop doing that. Signed-off-by: Konrad Dybcio --- drivers/firmware/qcom_scm.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index dfa298347041..d7fc972b20ab 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -1422,22 +1422,16 @@ static int qcom_scm_probe(struct platform_device *pdev) "failed to acquire interconnect path\n"); scm->core_clk = devm_clk_get_optional(&pdev->dev, "core"); - if (IS_ERR(scm->core_clk)) { - if (PTR_ERR(scm->core_clk) == -EPROBE_DEFER) - return PTR_ERR(scm->core_clk); - } + if (IS_ERR(scm->core_clk)) + return PTR_ERR(scm->core_clk); scm->iface_clk = devm_clk_get_optional(&pdev->dev, "iface"); - if (IS_ERR(scm->iface_clk)) { - if (PTR_ERR(scm->iface_clk) == -EPROBE_DEFER) - return PTR_ERR(scm->iface_clk); - } + if (IS_ERR(scm->iface_clk)) + return PTR_ERR(scm->iface_clk); scm->bus_clk = devm_clk_get_optional(&pdev->dev, "bus"); - if (IS_ERR(scm->bus_clk)) { - if (PTR_ERR(scm->bus_clk) == -EPROBE_DEFER) - return PTR_ERR(scm->bus_clk); - } + if (IS_ERR(scm->bus_clk)) + return PTR_ERR(scm->bus_clk); scm->reset.ops = &qcom_scm_pas_reset_ops; scm->reset.nr_resets = 1; From patchwork Fri Jun 23 21:49:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 112346 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6064604vqr; Fri, 23 Jun 2023 15:05:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6VIIyXua3s9vmiUCj2wsoe/a4uIoi9LVuxHZXq+RwBo13YKX4BEBGfXleCiq6TnZ+05CnE X-Received: by 2002:a05:6808:6243:b0:394:45ad:3ea7 with SMTP id dt3-20020a056808624300b0039445ad3ea7mr25554396oib.5.1687557909762; Fri, 23 Jun 2023 15:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687557909; cv=none; d=google.com; s=arc-20160816; b=Q3wJ52QnTrvkRLYcVK8atlhILkgo8PghHN+cuY9zS2hSfPam+xdzs0Yy+UzRNCzdKQ 0GAKxizMWEMOhY09hxqGmBmsaDqNhYkdB7W0KkcmB9MS4unO6P/AX9MUqPUjk+78BwZL p38801JGNb7H+OqKtrmiib+0sLbZz5silsM9eNczxTsoK1C0a08IvSHyvjQ5LVhjZr8U jV368M5F6keTWuZKzsydnIhBQL7nvVJPbgYoD4V4OLlCSY+WxiNaL2lT1ZuUlFpEsiu+ eFF3Ga48ft4Lnn8thJFuL52/kUYbWeMkVB3VRSR5QdFLbuoRCgv0Z6V6rmYKZPua6diF cCwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=SlONZ8TKyqT3PdFqD54Nj2aaobJzFqkktvSArbuqu70=; fh=VsX4z0tyvf0RAheyUx8BwMMyitohmjFBru78Qc382AE=; b=Q2zvAv1Le5QG/Ny2uS2D2tSBI1BGzWVMpxo+SQiVz8ZJt6ZskvCd5cJVqN+GGsqN3t 4Z1OK/68M2LnohaeqLDcL5KsVuPuvJ8cr4O2IiQO9lN02aD/tLEag+WWrdrEnY4b6mKy o8mrEm0MwsBlCtw5DmzvXiB8rZuot5edJlklD2+V4gsikzAKfObwe0cWJUQghU8+Es/3 gPO0aRdVOVviDh6yhyFjT73QiDkUzDxCitSJOESU6F5haH93ilryoDOBm+/i/mXqf9Jk BHlXt/JxwWJIqVfqV1G86WhCSlvgVhqJJ0ibQLnvySfdptU6Cr6tiUwl023CPRLJGT4D V+9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="d14/Sqwl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a654389000000b00543d2b94731si295544pgp.479.2023.06.23.15.04.57; Fri, 23 Jun 2023 15:05:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="d14/Sqwl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231752AbjFWVub (ORCPT + 99 others); Fri, 23 Jun 2023 17:50:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232818AbjFWVts (ORCPT ); Fri, 23 Jun 2023 17:49:48 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85C8A2723 for ; Fri, 23 Jun 2023 14:49:47 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f86bc35f13so1565403e87.1 for ; Fri, 23 Jun 2023 14:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687556985; x=1690148985; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SlONZ8TKyqT3PdFqD54Nj2aaobJzFqkktvSArbuqu70=; b=d14/Sqwli0wZo1aDlP1ix49NXOgH7Az2yJI2ZTAVgrTdZSAY7laI7V8/5jk5KRaB17 AkfudzVs4F6WQpi4MMr9O9Q9KJfSbkDlfrEjzJOZN6gcso065RCdVNJSLcgbgbP7Dl9n IvQw3hiDFbkZmIliWWNSV0d5wk+8/wOWjWBO2B14YUSvteqaWZuZKpEZXUo8k8f4R0Iv OqashMtNr449Lv4lT1EJkhZTe5gFcnXfivHmOWY/AOdYwFern7SpF6nTxcDMCVUmSJnJ J3SdsSxKBvwxgmKCINkEGS2BE+CkRW6QYSjjQTV6Ktf16AKbB14BZ7T8zoBkFAGJjhkG WCgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687556985; x=1690148985; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SlONZ8TKyqT3PdFqD54Nj2aaobJzFqkktvSArbuqu70=; b=Kv4XKXgFSdhK3sFQcpq0Q97JjKun5g80BeAA6E/pjiSNAj+iEITL5EVek2eFcdk8xe mI9Lkc6SHdy7HlVRJMH8pgGzbf5QGDmbjjKNB6+z1LZWCxRz247ls001UacspOPpA7ew GV3DVIWwAOWyZh84An/j8GJhrQaDVhb5WL75Zzdc3HfFGxmRijEZBeglqZuw780S1lMU Ay9DQEaeHcvZYybQZaxLFCQymIZEhk0pTQOqgKXS8BAULK7Kyxp2cbVctRz52kuMJQM4 UCSRceDBsiLOqfOJFHlIN5Rf80U+cM07M95ozmw67zu51dM8wGzR+ryiwg6OdOzLbO8P 240Q== X-Gm-Message-State: AC+VfDz7a+56V2j1uHhQFK9OGSd/lXCXcOG9Mh4rRWTddHRhgQFMIC6F X7pV5aHI1F2Uv8y8jBzObvemuw== X-Received: by 2002:a2e:9854:0:b0:2b4:756b:8e71 with SMTP id e20-20020a2e9854000000b002b4756b8e71mr12630714ljj.44.1687556985660; Fri, 23 Jun 2023 14:49:45 -0700 (PDT) Received: from [192.168.1.101] (abyk30.neoplus.adsl.tpnet.pl. [83.9.30.30]) by smtp.gmail.com with ESMTPSA id x20-20020a2e9c94000000b002b48437dcaasm1840919lji.103.2023.06.23.14.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 14:49:45 -0700 (PDT) From: Konrad Dybcio Date: Fri, 23 Jun 2023 23:49:44 +0200 Subject: [PATCH 3/3] firmware: qcom_scm: Drop useless compatibles MIME-Version: 1.0 Message-Id: <20230623-topic-scm_cleanup-v1-3-383089eae98d@linaro.org> References: <20230623-topic-scm_cleanup-v1-0-383089eae98d@linaro.org> In-Reply-To: <20230623-topic-scm_cleanup-v1-0-383089eae98d@linaro.org> To: Andy Gross , Bjorn Andersson Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687556981; l=1502; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=YeauYl4ZQZY5xFS1G6VWl/VwUEAHSGaL4eh3BOpBnEE=; b=sxaKygGpuvRJhsRXCw9CfYWD83iHXn9UfSEtVsNIFx5potBlUyoyY1D2CYYobi0D7yey7a337 E0RwUnUXfZ8AGyqZCKQAgdFaZSKTNauXyrqi4F2T0Z3LFUmHT+N4uKo X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769532723034117567?= X-GMAIL-MSGID: =?utf-8?q?1769532723034117567?= There are three categories of compatibles within the driver: 1. Ones which were introduced without a qcom,scm fallback 2. Ones which were introduced with a qcom,scm fallback 3. Ones which were defined but never used Keep 1 for backwards compatibility and axe 2 & 3. Signed-off-by: Konrad Dybcio --- drivers/firmware/qcom_scm.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index d7fc972b20ab..ff0e8911499c 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -1481,20 +1481,15 @@ static void qcom_scm_shutdown(struct platform_device *pdev) } static const struct of_device_id qcom_scm_dt_match[] = { + { .compatible = "qcom,scm" }, + + /* Legacy entries kept for backwards compatibility */ { .compatible = "qcom,scm-apq8064" }, { .compatible = "qcom,scm-apq8084" }, { .compatible = "qcom,scm-ipq4019" }, - { .compatible = "qcom,scm-mdm9607" }, - { .compatible = "qcom,scm-msm8660" }, - { .compatible = "qcom,scm-msm8960" }, - { .compatible = "qcom,scm-msm8916" }, { .compatible = "qcom,scm-msm8953" }, { .compatible = "qcom,scm-msm8974" }, - { .compatible = "qcom,scm-msm8976" }, - { .compatible = "qcom,scm-msm8994" }, { .compatible = "qcom,scm-msm8996" }, - { .compatible = "qcom,scm-sm6375" }, - { .compatible = "qcom,scm" }, {} }; MODULE_DEVICE_TABLE(of, qcom_scm_dt_match);