From patchwork Fri Aug 11 20:48:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 134757 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp1403027vqi; Fri, 11 Aug 2023 15:59:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOo3jkyjoA2ZMaAqtQKzkfXERkiAGLwLykq/1p1xF1dB7CXfispJDJlp3AShKNw/Wkfbb1 X-Received: by 2002:a05:6a20:d5:b0:13e:427e:ff18 with SMTP id 21-20020a056a2000d500b0013e427eff18mr3867615pzh.62.1691794775839; Fri, 11 Aug 2023 15:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691794775; cv=none; d=google.com; s=arc-20160816; b=IuM0UN9pQC3EzMMui8aopPzoHx9zMDyVNEAAJUWJ4kc4rwtSAladl31DaV4QdNQphY x7qYh8t5bBSa26X+RJhnxD9CNDP+ll2j38NCNMEg1+Tb3Y0enYFTLHHrypMt8ahSG8re v+ZFX4ez74oLKJw4poQFHmn4yDSZ8i5i9uMJhWLi9Y8jvBRwU75MlYUWnw2ZALJ2WjPP AVfoYF4HWhtjjJ83TeILWxz7BC0oJCa9zJXhHkshbYcZkyya0r5oFyZ19U/PB7oc1Hy/ fN5p9rwcjXC/IaU2dtX5YVrH/4/5BwirW/oWDeLtv2CgL4kBjIINBt56YL48CmPk/IP+ qLhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=cflUzEaWx29nL/vxxURuqfdfo+2qrB5uMsLChz0yjS0=; fh=DBxf6osa4s9RWu5yPm25gmAEycRXH8xyMwcik2crKpI=; b=ryDmdhNjEnaM7l5FMt/RUHWdCjYbqECdASYMizLVy5tyNTsQJNJd65YR+pdSd4ZP9B IMjcFLr7yVAVJbsadi6aPFyL1hgiBR1bkeNw88ffnfML5LmOW3IF1LKm5gz4FHCuQ6Y1 ui1vEuMiALVuYw5EojQLjRQrsQDNlLzcLjY9Ldsrx2jmCEkMoEGv2VL90Bc1mUBcntxE +fqZODQUJuPgJ3zvcz9sreZomQ3UkP3SU5ybo7vH+dScwEOa72xp3ni3o2yn35OUscpC sEVO5otTpF/hw64i9ap6mAlqQhIn8YoIDw5TfolTVNxWxv4LY7OBrPEB31gSmUSJrepW rkXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JZ0UYZ1F; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a630c0a000000b00563ef54582bsi4005875pgl.105.2023.08.11.15.59.23; Fri, 11 Aug 2023 15:59:35 -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=@quicinc.com header.s=qcppdkim1 header.b=JZ0UYZ1F; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236021AbjHKUtX (ORCPT + 99 others); Fri, 11 Aug 2023 16:49:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236903AbjHKUs7 (ORCPT ); Fri, 11 Aug 2023 16:48:59 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8245330DF; Fri, 11 Aug 2023 13:48:58 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37BKbeCK024125; Fri, 11 Aug 2023 20:48:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=cflUzEaWx29nL/vxxURuqfdfo+2qrB5uMsLChz0yjS0=; b=JZ0UYZ1FpdXf436ZjtQUohAeIR/YZ7jhUJJYhvmPuBEOKkb+BusuS9m8/ygZlRRW5isw aYRlI2edO5Q9yMwa5hHXmzdaIjr9qt9jkPJiqN2XmuyOC3f5RbuKDypqZjXPZx2oQmnA yAEu0vTzjLaUHONpA6gXtnFUQwmzQcaqGHzNqH+BobxZHrLH6N4vNrvyb7vbgXWiAy2y 4rdGi4rrA+Qo9H0t7ThRwRd/r71SdtwdpAqFmS4yfcxpgSeFPJTHueAbAG2M1GRYRQKY X5Kt/hphl468HtazZHEtliWO15hzQKxzOpWjauTzSPRlBBcNEnTNdZF3LR/hZRJuHApS Gw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3sd9062qyc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Aug 2023 20:48:49 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 37BKmm5Y007231 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Aug 2023 20:48:48 GMT Received: from blr-ubuntu-87.ap.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 11 Aug 2023 13:48:45 -0700 From: Sibi Sankar To: , , CC: , , , , , Sibi Sankar , Chandra Sekhar Lingutla Subject: [PATCH] firmware: arm_scmi: Fixup perf microwatt support Date: Sat, 12 Aug 2023 02:18:18 +0530 Message-ID: <20230811204818.30928-1-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: fUGMSjhW--y1csfsf7jrO3m2f6kGQiPf X-Proofpoint-ORIG-GUID: fUGMSjhW--y1csfsf7jrO3m2f6kGQiPf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-11_12,2023-08-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 clxscore=1011 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308110191 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, 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: INBOX X-GMAIL-THRID: 1773975398690485599 X-GMAIL-MSGID: 1773975398690485599 The perf power scale value would currently be reported as bogowatts if the platform firmware supports microwatt power scale and meets the perf major version requirements. Fix this by populating version information in the driver private data before the call to protocol attributes is made. CC: Chandra Sekhar Lingutla Fixes: 3630cd8130ce ("firmware: arm_scmi: Add SCMI v3.1 perf power-cost in microwatts") Signed-off-by: Sibi Sankar Reviewed-by: Cristian Marussi --- drivers/firmware/arm_scmi/perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index c0cd556fbaae..30dedd6ebfde 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -1080,6 +1080,8 @@ static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph) if (!pinfo) return -ENOMEM; + pinfo->version = version; + ret = scmi_perf_attributes_get(ph, pinfo); if (ret) return ret; @@ -1104,8 +1106,6 @@ static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph) if (ret) return ret; - pinfo->version = version; - return ph->set_priv(ph, pinfo); }