From patchwork Sat Jun 24 12:23:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 112453 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6376932vqr; Sat, 24 Jun 2023 05:47:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fvjataFJLhczMXbKNvAAHghC4ly643l54+HJT1P3kT6G4YbdmyzFjgNmH6+VZwF+AhRJ5 X-Received: by 2002:a05:6808:199:b0:398:268e:4c7c with SMTP id w25-20020a056808019900b00398268e4c7cmr24503398oic.42.1687610833799; Sat, 24 Jun 2023 05:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687610833; cv=none; d=google.com; s=arc-20160816; b=k7FtbjemjTBdzRs3ZxWvLZnmI94aZb76pMPtrD1ucrpEImP2BdYCi+YPcXpm1Kj1QC tPsO7asxKY6QlACcwLTFiffE/AWHDAbNdIfFMB3tYw3b3KIESHLxf7+3ZwdApst1ZOc4 znDWEcvC7ULc2VKl+6STA3r8kycKoZ7q6C6gGPz3f2fPv3nsURdO8gTXJ6FxS9aDsz+H k0TOUSgZrfYIoPyGeIZOuUmQPZbBPEVbxPt39rKXMjZyhW8A4hx/ROqcwJm1Bf5Xm6CG skhYS7QZ+6KNVCBauTub3VsbCW6gkFczVBjVHlKchYBBfta327gZ3ZMn5XX8x0yUnJcx cdCw== 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=4mlusQIqHLc3L1kKJFIe3oY0E4pRPb3J1UORktAQD1k=; fh=VsX4z0tyvf0RAheyUx8BwMMyitohmjFBru78Qc382AE=; b=ooOpwFaS7xEB9ESYEaTuoz5nJzeAu5s5lvgjqE2XSVBMi8/wlBHxAaZVPqeMxG2BjQ nemPWd+YjGP+1OlFEOdNrEuFYO6yCeUPxnWF5ZAujWZn9JKtHVRiVxkJ1mdbJfyseYV8 n33dE0aT5nxNBar/xRQD2eMFp9oz1tSxYZfYF6rSCB13XemlLAnpTk/9efR5JwUSNNiu oLp/akk4YtEEmhe2gzKKakd9IZ7TQOE0RN/sF7WUP6Dz21Wzv3hbWbBripyxbVEo46a0 g6w4a+zyvZBJ5dMnw8x9UOy3B1AgnO6O2EIGTzPJKd3acq1M5Dh8cURpcOc0gd0yeGsY GLIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OZGC+9QI; 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 mg20-20020a17090b371400b0025bd9dac5f1si3684437pjb.28.2023.06.24.05.47.00; Sat, 24 Jun 2023 05:47:13 -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=OZGC+9QI; 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 S233167AbjFXMXy (ORCPT + 99 others); Sat, 24 Jun 2023 08:23:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233132AbjFXMXv (ORCPT ); Sat, 24 Jun 2023 08:23:51 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C1F6E41 for ; Sat, 24 Jun 2023 05:23:50 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f96d680399so2020412e87.0 for ; Sat, 24 Jun 2023 05:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687609428; x=1690201428; 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=4mlusQIqHLc3L1kKJFIe3oY0E4pRPb3J1UORktAQD1k=; b=OZGC+9QI1M3ODN9W7x37gwtYeEEBZK1C4ZBcjZxWEjq+3+Csf55wDuNCEuAoUCMFA2 z7pg9Wg6+Xhr3fK5LtK/iPlPJq7TfMZC0OwOL+Z0ChzK13P/ldd6DrUokIboyx9QYnOO 08vGi/1T5NHk6NcnPBMUIzmbYsI5BpWi0cEIAhmTY8cLJbnQ6OjihjmIudftwqRiaGM5 xpN8EmGucaHcmnPQ6Ja5JNX30N1+W3xf0PriZf8eclootT9EEBYTwQvSAfMnsR7Bu00s VZYgwiIoCCJJbDuxHTARjplZEDBG0AQcwxjbcO8h42KRvK6nYwYXOotf0mgMWuh3TFxQ k1og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687609428; x=1690201428; 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=4mlusQIqHLc3L1kKJFIe3oY0E4pRPb3J1UORktAQD1k=; b=P2ppbsmpEGvMr1E5KrosTxUAfNwkdviy4l8WULd3QeOrkl4a2vNAik/C3IvwSDei3n FXzpyQWBJL/h6G+EQOi4T1ihhQXM+FtElvbMqFpvt3zsbNgOeD9Y5G8fB3uPrzATG1cZ OVpFvBS6xYArfQhdGDvzodwy5kHqg/AR/thdoN+9Za/4RjbutWnCq73tAmHOy+sZ83mq qMXCO8A7zdGoR3rA/3sJ0QQHYWqmTRudmO/UnoJv90EoBDW2r4wAOaCEnMryGKqXjW9K nqSbk/8mbkSOdq0Me+xQKlZtB4GLqHvRiXtdO5+WHaneOXHmbkFHEn0bSovtaA4buOVG c/NQ== X-Gm-Message-State: AC+VfDzb0CsP2As3i2NnebO5tUdQorTaC1M2lXdzeuWkfkZBDN40M+sQ XaDwE54PvyQ0BHyscRbrdDTnJQ== X-Received: by 2002:a05:6512:31c8:b0:4f9:5d34:44b1 with SMTP id j8-20020a05651231c800b004f95d3444b1mr8229225lfe.2.1687609428226; Sat, 24 Jun 2023 05:23:48 -0700 (PDT) Received: from [192.168.1.101] (abyk197.neoplus.adsl.tpnet.pl. [83.9.30.197]) by smtp.gmail.com with ESMTPSA id s13-20020a19ad4d000000b004f00189e1dcsm260200lfd.117.2023.06.24.05.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jun 2023 05:23:47 -0700 (PDT) From: Konrad Dybcio Date: Sat, 24 Jun 2023 14:23:45 +0200 Subject: [PATCH v2 1/3] firmware: qcom_scm: Always try to consume all three clocks MIME-Version: 1.0 Message-Id: <20230623-topic-scm_cleanup-v2-1-9db8c583138d@linaro.org> References: <20230623-topic-scm_cleanup-v2-0-9db8c583138d@linaro.org> In-Reply-To: <20230623-topic-scm_cleanup-v2-0-9db8c583138d@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=1687609426; l=5055; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=c6mXCk54PRq5wka3veC3/OftoitCZW2RQQCuecVwHSI=; b=CohtLcSjA2HX4NMnCMM24PR0MDttb7QJBE91IfGXR0mpfZQ66Toy6jR1mwMo2hrzJi23GRBNq 5PuMfr8LJhmDSUG+OpbyI+R7P41eN91mImDT+XPkMy9LQ+wIKsWP3Ge 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=unavailable 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?1769588217536342719?= X-GMAIL-MSGID: =?utf-8?q?1769588217536342719?= 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 | 73 ++++++++------------------------------------- 1 file changed, 13 insertions(+), 60 deletions(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index fde33acd46b7..237d05d6208b 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; @@ -1405,7 +1401,6 @@ static irqreturn_t qcom_scm_irq_handler(int irq, void *data) static int qcom_scm_probe(struct platform_device *pdev) { struct qcom_scm *scm; - unsigned long clks; int irq, ret; scm = devm_kzalloc(&pdev->dev, sizeof(*scm), GFP_KERNEL); @@ -1418,50 +1413,27 @@ static int qcom_scm_probe(struct platform_device *pdev) mutex_init(&scm->scm_bw_lock); - clks = (unsigned long)of_device_get_match_data(&pdev->dev); - scm->path = devm_of_icc_get(&pdev->dev, NULL); if (IS_ERR(scm->path)) 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 +1484,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 Sat Jun 24 12:23:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 112454 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6377509vqr; Sat, 24 Jun 2023 05:48:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7EzCieenD8Tr8lWTBEiq+mi0UFU5xQ6d1qEzoJ72VnUXMoWhnkMxsiQcNBjO7CsoCgsVmQ X-Received: by 2002:a05:6e02:60c:b0:345:79eb:dffd with SMTP id t12-20020a056e02060c00b0034579ebdffdmr1421974ils.23.1687610922914; Sat, 24 Jun 2023 05:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687610922; cv=none; d=google.com; s=arc-20160816; b=XqBNYggAsLEobKL5INT4TBfCTmUqDE0n5BMXVZL1kYiRRd/UQOqWyvtOV8JWEaBzlY KMgmwBLx1MfV8Kk7omOFPR6Vfl62S1z9/JJ9ylXy82voouvDW2rVzbOPhKh9IuGF8ZHb LcNtCuWeJfz7JwmdaYUp4RkkhAbSBz250zgiHG/vwf8uJif6io77YAp4xKTV0AUgPP5U Y4D8J3TVFqUGBZejzrHZ4r+N8JxoAwcgPc6Nk2/YY6Y90g218sv8iS/Rk8yUGUiGf76I svGIlTI4Tokl7MoTO0HtayAbDAH+S8sLtu5AFK6cbk0S418Jt5quDJsn9RjVRs+U2hZj mwTg== 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=SdwUD4ja8kl0C3si3v+OvYMyCtcQIhX5wG+ZPdgw56w=; fh=VsX4z0tyvf0RAheyUx8BwMMyitohmjFBru78Qc382AE=; b=xcvoj9QBADN6+qH2z/z/IEZB0MYW5O7VwN22Bp3HgRjyBP4GNUar0Lsg/UgbpfhlsR +vbO4hD/tjZLuVrMF/SJBH6Y4npKMLnCT+BPeDlZmURLeh6F8KGFozRqHutGqiugEf+f l2/7PnnT43OofZxEyUGAwC+k246x4zzWUTAHv4+eLclVzfOQ3Q7iMKB+mIcV5F7+n4wD au7jVjdkEpsTJt6HKVhMBraZW2pd6ugY7ZPInQyxB3XHYuqa7bcsI9SVo9bH6zskSPnz pD9mIbtkZ1gAVk2EwvnsxB0/nXDjgSmF2UDNlqg31hfLd/GXPX+8WBQ+GizL3qJ8xsD/ EwCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hWJrUE+y; 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 s4-20020a63d044000000b0052c73367c13si1274412pgi.871.2023.06.24.05.48.29; Sat, 24 Jun 2023 05:48:42 -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=hWJrUE+y; 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 S233176AbjFXMX4 (ORCPT + 99 others); Sat, 24 Jun 2023 08:23:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233153AbjFXMXw (ORCPT ); Sat, 24 Jun 2023 08:23:52 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3461E45 for ; Sat, 24 Jun 2023 05:23:50 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b47a15ca10so24751091fa.1 for ; Sat, 24 Jun 2023 05:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687609429; x=1690201429; 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=SdwUD4ja8kl0C3si3v+OvYMyCtcQIhX5wG+ZPdgw56w=; b=hWJrUE+yTMBo33EWAQ3Fuij490p7Z6ilnJGULElb6XCef93PXynQsqdx65ZyA9hvMP w+j0Rm3iw7Anuz0b7KQ5oLmrSxm82yiCBW2dPS7ToTeJI/MONb1/+v+owUk5iSuUTy1F erDe/Ii8RS6H+eMWDHfzeWu1RzWmVh80oRQyplQLmXi2QHoCLwLAbxqUwsN26va8QJ+W NfRYg+rmlgHipqH8hXioYWNcI6I0tr9thcD4aYq7aPt0q7MQVR3CHnMEjWrSckPqYegX hEsWpGxbNyr5rKUw61VFdhSEIBrYE55sJuHwiHSUkdcys/fD0OV7ckiWTGxOTOwLOkya ekqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687609429; x=1690201429; 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=SdwUD4ja8kl0C3si3v+OvYMyCtcQIhX5wG+ZPdgw56w=; b=FnxkYlYgncaIG2ghPLSQ3+vhCOkU55W+atumnkvXKAkSieZeEoJguvmbF0fEtyDCN5 u8Dix2oGw6XE/E5A4Rd4r85q9k+ZZPdi1g2uxj+RGLAVPnlOG92oOkQDmP0S2FM4GnmO j9UXSVX/kVGb032snD4tbog9A5lG9f4MxfEdyK9XE8rOqhfmpie9gfUyPZRcx9JOVEW2 mrhplyGL5WNPHrLvOPj9cV+M6X3liHBlvt2NMljc3TJj+n5tzbIXnQobv3pva1j5f4sB YRU7DOtXWSe/XqxR/6zHjYTyoMKXEdiwOuDQkBvOXUJOOeSWXjJbU1S8eu9bUN8oyB8G Is3Q== X-Gm-Message-State: AC+VfDzIJ3ACeif8CedNCabetMSOLDjRfsCB4Vvwe1esR5Wla6GLYSqz fC5TVqN8KQoEIsPjmdDiznH26w== X-Received: by 2002:a19:5050:0:b0:4f8:598b:e62d with SMTP id z16-20020a195050000000b004f8598be62dmr13826809lfj.56.1687609429133; Sat, 24 Jun 2023 05:23:49 -0700 (PDT) Received: from [192.168.1.101] (abyk197.neoplus.adsl.tpnet.pl. [83.9.30.197]) by smtp.gmail.com with ESMTPSA id s13-20020a19ad4d000000b004f00189e1dcsm260200lfd.117.2023.06.24.05.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jun 2023 05:23:48 -0700 (PDT) From: Konrad Dybcio Date: Sat, 24 Jun 2023 14:23:46 +0200 Subject: [PATCH v2 2/3] firmware: qcom_scm: Always return devm_clk_get_optional errors MIME-Version: 1.0 Message-Id: <20230623-topic-scm_cleanup-v2-2-9db8c583138d@linaro.org> References: <20230623-topic-scm_cleanup-v2-0-9db8c583138d@linaro.org> In-Reply-To: <20230623-topic-scm_cleanup-v2-0-9db8c583138d@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=1687609426; l=1572; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=LId2EVrQK5HfRRaxbRB0VnCSfdSPSyuZN4O6GtpVCuM=; b=TGAD5/2nSgKWjnQ1tOb5GK/LXL4aWbiquVPfQsfgiWQ9LZowwvQHrOdjJzXUbK3Q9yl5l/+ra qMQ6GwEnkJpDNQdO6nYIpMZmx15RuochA73XruUynPQoYXNWr7DlCmW 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?1769588310808470759?= X-GMAIL-MSGID: =?utf-8?q?1769588310808470759?= 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 237d05d6208b..b8398002205d 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -1419,22 +1419,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 Sat Jun 24 12:23:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 112455 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6377625vqr; Sat, 24 Jun 2023 05:49:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4911uq4YzcAxdgwaGX8KIfRj5uGLPxfmTUIfeZJ2OqXx5SUJu72z1ItvaeINO2d/q3kUyL X-Received: by 2002:a05:6808:2027:b0:3a1:c233:5552 with SMTP id q39-20020a056808202700b003a1c2335552mr1326025oiw.34.1687610940599; Sat, 24 Jun 2023 05:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687610940; cv=none; d=google.com; s=arc-20160816; b=YVffCo/UIZrmg/K8zJK2nzGbq4rD4cgy8XuVtEVyMAaBzCIpC6OKjQlYnftPBb6XVU NUTkuygkVerTCBz754gVrMhXlL/dlEvt2U64asm3yWFbiUnb8iKWj1wtaE+GeXR5kzm4 n1IVneqhuxN+YuSpbzDXYmBjV2mYKSnxb2ZVjbJeXtNQAsPAyQki8F5WpxMuFQ/uS3e6 AUUuQH7i+4Rcy6g+NgImsogNiyqmdb3aVXU2L3KOXk4wwfrf+Ezm4ENBCgUrAZWjElSs C8qwX4eASwhK7sSbliG2TeFlxx5ScjvRziy8ItyG7WRuPtbdRg+8BB2cs6u+zOqGJofu qtqA== 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=avKiWxoWYl1UXVnI1jhFRgj1Bd8Ey8Z1YlDdy76fbHw=; fh=VsX4z0tyvf0RAheyUx8BwMMyitohmjFBru78Qc382AE=; b=udiLY8VqafkWilU8hvtrRpH32gOCvFXRabJ6k1A7zOXo30FfoyMcMUNEPHueTG/5dW +1pCZpHNLjUjgQoNV5YfW9cJEa61dLYmRuILnelmxr4urM+ouDpW5PmU4/3GdrBDwdIx 4Qt8MkJqtc+sJXtRI1o2MU7t/EwNpy1CGSR87deIrmIvTLsFo4TydznhAdLElt23Ojpa +U+UzWrTMacQcqNsuiF1RQANYXo8YmY5/j/b6a4Pr7cOw+Kq7VojXqlXnNRE/vSj9b1P ZWrq9Y8htWgTuW5NdTUCc6Iwu1GfrHnsKYmNI9WnQgoFs7kMlYv+me8iIqpNqIhSehvI ECKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Y/r6vNea"; 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 u6-20020a17090a4bc600b0025693afd311si3737209pjl.43.2023.06.24.05.48.47; Sat, 24 Jun 2023 05:49:00 -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="Y/r6vNea"; 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 S233172AbjFXMX7 (ORCPT + 99 others); Sat, 24 Jun 2023 08:23:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233156AbjFXMXw (ORCPT ); Sat, 24 Jun 2023 08:23:52 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAD03BF for ; Sat, 24 Jun 2023 05:23:51 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2b46cfde592so24899371fa.0 for ; Sat, 24 Jun 2023 05:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687609430; x=1690201430; 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=avKiWxoWYl1UXVnI1jhFRgj1Bd8Ey8Z1YlDdy76fbHw=; b=Y/r6vNeazTy5SqQSn7ySKBYS/EBpIMfd7saTZB52qjSq5nZEBXdxO4wWvT8zv6rMrO wZyWiR+0Tnfojf1i9AC5wqXMGQOyzw7Am2DdITaQAj/w2MeP2uY+GgDx6+i/bO2nCh7R ejJwJggxe/DpvTjOam5ljnvaB1OYct/bTIAqWtACIdNRUFA+gVMPv+meTW6eMeC+0Hod y5TgEkdnnF9RCFhINPanmzx6Lvc1A35m0fDUo8nVmyySkRLsLHOVbaWZhuKKlUqnZYnr gamLQAzCSH/X6JOQvqrQjebbafRTQY+fxE7qIjoFcqhMzKU5OzKE9C/mJRAcvuk+/pnB jUDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687609430; x=1690201430; 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=avKiWxoWYl1UXVnI1jhFRgj1Bd8Ey8Z1YlDdy76fbHw=; b=AaSaMVjdPyE5kxLonKYmU+/UMLIUv6j7j0f9SekUaOugoapnOSJLhZ0TsUpIsY3QuR 7zJmWvv5O7hYJmPUHVtyV/jGPExnZffgqO11Mzdf6eG0P1PxfZNFtygpx3t0MsMinyHh SoymiHphwDqfUMIErET4Mz4kJH6wRpJQFkvkVT0kZVwYPIX+1TC2caRaodKMZgkfRKx3 kl7vlUKgcT8Pxe8VCuDxTPvCtf3SVzTWilD60kNI0xiimAbVint33qlXVob1UZOiRH0x rWV74eY1ucl7JybEti5P0GHWGVb0vyElKqXdeNSAVUZJysRZmaMOfx1zNA+NE4eMK7eF pS8w== X-Gm-Message-State: AC+VfDxVElgtQ2qiFyPo1GaBWUGxRXq1jlzOK0NdNl077bilo/At4Zu1 VXT+hzAcImjY35PmI0yLd0DqyQ== X-Received: by 2002:ac2:4992:0:b0:4f8:453f:58f3 with SMTP id f18-20020ac24992000000b004f8453f58f3mr16346770lfl.40.1687609430036; Sat, 24 Jun 2023 05:23:50 -0700 (PDT) Received: from [192.168.1.101] (abyk197.neoplus.adsl.tpnet.pl. [83.9.30.197]) by smtp.gmail.com with ESMTPSA id s13-20020a19ad4d000000b004f00189e1dcsm260200lfd.117.2023.06.24.05.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jun 2023 05:23:49 -0700 (PDT) From: Konrad Dybcio Date: Sat, 24 Jun 2023 14:23:47 +0200 Subject: [PATCH v2 3/3] firmware: qcom_scm: Drop useless compatibles MIME-Version: 1.0 Message-Id: <20230623-topic-scm_cleanup-v2-3-9db8c583138d@linaro.org> References: <20230623-topic-scm_cleanup-v2-0-9db8c583138d@linaro.org> In-Reply-To: <20230623-topic-scm_cleanup-v2-0-9db8c583138d@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=1687609426; l=1502; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=2851rppnMfhTFcDTpFWS0mg9wSl32exm/NRmmxF+T/w=; b=Qy3D0ksutlS9UBuf6hqlAIbaAbyXSeHcDCXBDPBTZYPkD2ERbRol6/AF6Z8ZTspgmJZHgNBjx x6ELhXKung9BQemO4xI9iX3W25RZf4QdqPkxrMs4VF+BTUIB7z+cHss 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=unavailable 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?1769588329808960233?= X-GMAIL-MSGID: =?utf-8?q?1769588329808960233?= 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 b8398002205d..b6055b1c18d8 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -1478,20 +1478,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);