From patchwork Wed Jun 7 12:46:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13270659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4696FC7EE29 for ; Wed, 7 Jun 2023 12:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WcBDurV5OEA2CgsuTBsM9g1/ssplSLANE8JCd1VXCD0=; b=mvlMuRz1e8hJe5 OX5ZV2Op1QKlXx2dtX44BD2VjQTmdFRMztTsPo65PkyEqJPyj+FeK1L2MUoNX1oCKW1HARCdaS7rQ 8RsuH+Q23FvRBzmxn5R5ciLaS/JKoEkIK+zo4Lst4KlDOZeUZNeJ1L7wNedsxmpo3JfpgErNgE8fn RinVThEkEZ0Lllx9NJ5dJKnR/LUw1X4WwUzkNWvd/JgMpYBVgjHNBBWlHI7HmD+R2dwS4zCCXBEkQ d0pHwScUY0CHyHVSbb9zjMH0je5gh5jc5Caw5LR3EYDlkDiZBvkf0MyTUCLz2y4r5qCkZkpgk6d15 excJNGZiFijS0IhOgVIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6sZ7-005x09-0k; Wed, 07 Jun 2023 12:47:05 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6sZ2-005wxN-0a for linux-arm-kernel@lists.infradead.org; Wed, 07 Jun 2023 12:47:01 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f6148f9679so6776542e87.3 for ; Wed, 07 Jun 2023 05:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686142018; x=1688734018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WT1gco3SixkDR/OziK3JosQemihuanLlknRMm9B1CS8=; b=i7i4/XQ2a6an/rgAvd96eO9/R9qJ16QRQxIAyqU//tp/p+4ptLtiF/GRaZWa8F5Ms8 sfsY51UWBXFbRQf4w/yJrgERsCiJWMaK3ue7f09ilyWHcp2ohVoj2lYvuyMIcEVYsdQD DWBt1K81UovndWUzvPlDTHJc9mv2CpWzMx3n5WkfF+v5nucFQYKe3BAEA66GMzCNLTjm 017he3Em1AkvxbdBWCXodi5shTK19rROLQgBLg7y2M1KGlzySoxIr3ZLMQL6wGHE7w5Z LDuN79gPUIUxoWxNSkmTSTLsFRvBDJ5+TaFVlNkrT0v6loTeyr74gxtncpR8MVYzI2gz 7gfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686142018; x=1688734018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WT1gco3SixkDR/OziK3JosQemihuanLlknRMm9B1CS8=; b=RXs/8U7t/hjg5MjTbq2LDbwXu7DcGhCaNg/7O5kg+8xQiRvrC/0f1bVeRsdyHl7qtw 65jmF7EnuUUDVUTDZf9DyavXHFeLMYb1Vx2AiRYSEFignMIyl1mvuFY/iS21+vordG1K p2ms4GyIZKx9R6lagYn1Bh+aA4BjONnDTgVAwRY6wobrmqT0xMLJrIbjHzdHUmxhL1OI eDNPLmOVyQlGZyBJ0q1uU6/xLksJ7cP9xMQgcg4YqMkfjJ8iKXcZnPhC9jfxP0u7eqtz 5MnWHhEBSO1ZbIbjojuIT3UfViMqepNOdL6JEoPdecAD+hlzvb2zua2X5fS5gszzZyaU 4qug== X-Gm-Message-State: AC+VfDwCuUApVSUnGiXNAAye3WX0IzmVPRnG8NK9OdPgjk3c/96vdWvC IKvu3Lc3igSARxdFSmQ38Kgo9A== X-Google-Smtp-Source: ACHHUZ46s+CAtlnvjg/Pe4nAxStehloY+FWgmNeOggKS/r6wguvflGLIBjohnTHGZRMM8IbnFecjOw== X-Received: by 2002:a19:f806:0:b0:4ee:dafa:cb00 with SMTP id a6-20020a19f806000000b004eedafacb00mr2163873lff.60.1686142018272; Wed, 07 Jun 2023 05:46:58 -0700 (PDT) Received: from uffe-tuxpro14.. (h-94-254-63-18.NA.cust.bahnhof.se. [94.254.63.18]) by smtp.gmail.com with ESMTPSA id z7-20020a19f707000000b004f4b3e9e0cesm1781708lfe.297.2023.06.07.05.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 05:46:57 -0700 (PDT) From: Ulf Hansson To: Sudeep Holla , Cristian Marussi , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Nikunj Kela , Prasad Sodagudi , Alexandre Torgue , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/16] firmware: arm_scmi: Extend perf protocol ops to inform of set level support Date: Wed, 7 Jun 2023 14:46:15 +0200 Message-Id: <20230607124628.157465-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607124628.157465-1-ulf.hansson@linaro.org> References: <20230607124628.157465-1-ulf.hansson@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230607_054700_238387_EB3FB192 X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As a subsequent change show, it's useful for an scmi module driver to know if a performance domain can support the set level operation, hence let's make this available by adding a new perf protocol callback. Signed-off-by: Ulf Hansson --- drivers/firmware/arm_scmi/perf.c | 10 ++++++++++ include/linux/scmi_protocol.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index 5a6ed42bfb55..216bcd68d549 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -440,6 +440,15 @@ static int scmi_perf_limits_get(const struct scmi_protocol_handle *ph, return scmi_perf_mb_limits_get(ph, domain, max_perf, min_perf); } +static bool +scmi_perf_can_level_set(const struct scmi_protocol_handle *ph, u32 domain) +{ + struct scmi_perf_info *pi = ph->get_priv(ph); + struct perf_dom_info *dom = pi->dom_info + domain; + + return dom->set_perf; +} + static int scmi_perf_mb_level_set(const struct scmi_protocol_handle *ph, u32 domain, u32 level, bool poll) { @@ -707,6 +716,7 @@ static const struct scmi_perf_proto_ops perf_proto_ops = { .name_get = scmi_perf_name_get, .limits_set = scmi_perf_limits_set, .limits_get = scmi_perf_limits_get, + .can_level_set = scmi_perf_can_level_set, .level_set = scmi_perf_level_set, .level_get = scmi_perf_level_get, .device_domain_id = scmi_dev_domain_id, diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index 07152a0baee3..99c3e985c40f 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -129,6 +129,7 @@ struct scmi_perf_proto_ops { u32 max_perf, u32 min_perf); int (*limits_get)(const struct scmi_protocol_handle *ph, u32 domain, u32 *max_perf, u32 *min_perf); + bool (*can_level_set)(const struct scmi_protocol_handle *ph, u32 domain); int (*level_set)(const struct scmi_protocol_handle *ph, u32 domain, u32 level, bool poll); int (*level_get)(const struct scmi_protocol_handle *ph, u32 domain,