Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp257735rdb; Thu, 2 Nov 2023 02:55:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFevmtZHVzOhr5jCEO8T6kTYFyABKC+M3hOmfbyqbj/7gK7PDTNbLAkLMkgJ+mRebFNKt4I X-Received: by 2002:a05:6808:10c8:b0:3ae:251b:5552 with SMTP id s8-20020a05680810c800b003ae251b5552mr24102429ois.12.1698918902553; Thu, 02 Nov 2023 02:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698918902; cv=none; d=google.com; s=arc-20160816; b=NWKEB2E+YrW9wnVeun9C2kfV3ER7V+XZ86Dfxcegn/5h8RMy5vnr+AfZ9/DOxz2t4t ILdg+ugWntw41P0goxjimOAmN8hdXATa97HMFxJleMGRdnaSH+vkg+nAq2+vmNRzlLlK 38hVj7c2vAXxTvpnepg4aygwIRQBbR2KmcOmjxa3/J6GqBEKrL3sk/O64mfan+DnPH2A 7YBobVuWa+Uh0XkmvE5dcXbI30G+RSbf6oW7D5cqt3LRiFGP+hIWn73pz53Kum6YgPnP qqSIl0e5ZvbXJ+VRDJAdB7jfWLTF2lPhFjvVPx5+4GA3sBUP0D0QCZU+tDcnPv0Ar9oZ 42/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:cc:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=QYS16eCPsBztvO6TV3MQMioFM+kthtA6Q+ME42940KY=; fh=JQtWl23l9FVLqjuxOl47RtpgWA4L3h4Qr0j67YA7Vgc=; b=G5Qv8GxuQcaT0MxZyEIP80btJVh1rYpWdn96+fcDPKzjRNGStSkzaZLflrzJMIArG+ wB9eadKKuUxBGinfuY+Zi5EngRyPNc9n3TgEPXphSWJhlHzuRa20nXMWbdnzq6Y1PwEd GrR0e/DJa1tKoQbq6PzoDW46k8m21f3clK+kQqoWxU/gGKFO2CGZ04RuZ5Dlt0BVjP4m doBfPoBH/Ue2uZyn0Qrm48EgZOVw+HxE+ye//9Cgwcyekg/XNQ2MAboFShjJEo5vnhFE sgVkJduSe3r67Quo2cSPMKFZhAinFnQe9Vd2aXX6lqRdC4wDKCYHhvkuSU2n7hKElk6D YbVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20230601 header.b=MOGJ4NAJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id cj11-20020a056a00298b00b006b0cfed2c77si3441332pfb.135.2023.11.02.02.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 02:55:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20230601 header.b=MOGJ4NAJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4327981FD9F5; Thu, 2 Nov 2023 02:55:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345944AbjKBJyz (ORCPT + 99 others); Thu, 2 Nov 2023 05:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbjKBJyx (ORCPT ); Thu, 2 Nov 2023 05:54:53 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25F16133 for ; Thu, 2 Nov 2023 02:54:50 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-991c786369cso110292066b.1 for ; Thu, 02 Nov 2023 02:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698918888; x=1699523688; darn=vger.kernel.org; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QYS16eCPsBztvO6TV3MQMioFM+kthtA6Q+ME42940KY=; b=MOGJ4NAJbyDjOO8tgJKz4GJY3se8B9zCsiPAI5qbJVO9bhoOrbG8Ekj6tyeGJQSsea S53CCL61GeJeQ1rFAmyr3QyIDIkYt3/MtKqF2qjtAinF/HrbbBm0gcSzYg2N2f5Nwiei VZ+jRpapOyAA8t38fLuB50IAG6W7QZmRlwQZ+PZWOFXBydrtovMHe5etVzrg1q0raP6F XrrmMjb+u6I02pbFdA8Wuhdj0UqxoSQzpBIEKEpSBA4uV0N4OT0BPsoH+H9tKI0+7Vka euvVfEl2gutOE7ZAPPLDl2l5JLBcyybVmtY67DRdxot1I6PE8buQJ+nh441C/RefsWhi 0uoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698918888; x=1699523688; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QYS16eCPsBztvO6TV3MQMioFM+kthtA6Q+ME42940KY=; b=sUX0H04zHLiHZhfRa+QtBgjmjxmTKdjYbEMyof8/x+7veOkLZXzOWjsy6C1EShM2RT +FShq4dvy4nc99mVNtGGlQFy1/aZIGMQwixCmnDdpltk9+byLZ3Z2fV4vEZWiI+uwTKv popDBXPHCua/2Yb4Z5BJ80QCfTfe7kBQZXRVpToWgvEUh7YZYyC+ggjtf9OJa6BLMw9F ZcC3+aJr/W56TmZKdBbBxjPKxti8ov8EWSlX2J3ELemNfk1c4SzOgB2Wcp1fMGZCSA8w AD8WCxFGZcTbZuU5HOAqJzT6haPS5gZUfdlkJq+WtXY+cLwWO4GlzEAwpSu+hlPx2TTx bt1g== X-Gm-Message-State: AOJu0YwfQANYVAU2aEqQBSTqNKdF6QV6D7JpjnmkUZcSwElAJYNwOoYG X86IAXL3dhJT8QfEJuhGXPvT2A6eSXEMI0PUzobU4f1g X-Received: by 2002:a17:907:724e:b0:9be:5ab2:73c0 with SMTP id ds14-20020a170907724e00b009be5ab273c0mt4010139ejc.8.1698918888378; Thu, 02 Nov 2023 02:54:48 -0700 (PDT) MIME-Version: 1.0 References: <20231102075853.1320710-1-xinglong.yang@cixtech.com> In-Reply-To: <20231102075853.1320710-1-xinglong.yang@cixtech.com> From: sean yang Date: Thu, 2 Nov 2023 17:54:37 +0800 Message-ID: Subject: Fwd: [PATCH v2] firmware: arm_scmi: Refrain set operations of perf Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.3 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 02 Nov 2023 02:55:00 -0700 (PDT) ---------- Forwarded message --------- =E5=8F=91=E4=BB=B6=E4=BA=BA=EF=BC=9A xinglong.yang Date: 2023=E5=B9=B411=E6=9C=882=E6=97=A5=E5=91=A8=E5=9B=9B 15:59 Subject: [PATCH v2] firmware: arm_scmi: Refrain set operations of perf To: , , Cc: Refrain from trying to take the SET operation where the set_* operations are not supported, because: (1.) avoid unneeded SCMI exchanges, (2.) avoids to trust the FW reply blindly. Signed-off-by: xinglong.yang --- drivers/firmware/arm_scmi/perf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/p= erf.c index 431bda9165c3..3bcdef91ed5c 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -377,6 +377,9 @@ static int scmi_perf_limits_set(const struct scmi_protocol_handle *ph, if (IS_ERR(dom)) return PTR_ERR(dom); + if (!dom->set_limits) + return -EOPNOTSUPP; + if (PROTOCOL_REV_MAJOR(pi->version) >=3D 0x3 && !max_perf && !min_p= erf) return -EINVAL; @@ -473,6 +476,9 @@ static int scmi_perf_level_set(const struct scmi_protocol_handle *ph, if (IS_ERR(dom)) return PTR_ERR(dom); + if (!dom->set_perf) + return -EOPNOTSUPP; + if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL].set_addr) { struct scmi_fc_info *fci =3D &dom->fc_info[PERF_FC_LEVEL]; -- 2.42.0