Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1921616iob; Fri, 29 Apr 2022 16:30:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMM2ceIXEKcapy0dyqqwpnWsrm4v84D6F0c1myqFDzb+zcSMC3J9E4Y8lNZYOs3pDH+a2w X-Received: by 2002:a05:6a00:b4e:b0:50d:a75a:ec6e with SMTP id p14-20020a056a000b4e00b0050da75aec6emr1238194pfo.19.1651275008096; Fri, 29 Apr 2022 16:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651275008; cv=none; d=google.com; s=arc-20160816; b=gpef25X56GA/BCLhZcJXewwPanJjO2scVuQSUuXkNDs0t5M0O37icU4T+S5ESx77FU Anh0v7UPV/75PjB5s4DgNgzQALRWtu5f92vgJgWqGOwNEzTBcNxqDVbPexSFcxW4YweV FNLYSD7RAyQXG6oPQhp98cL8DTAqjT8MUzJybBRNGskPihO6GNmBEbmytOCFtXmWtfKo ah4gEvJWB3LN0LwDVOWZk+iq9NRwtvwzbGGan+klk5lxqxo390QFFPLb8HTmPeDZgvDS sd295gr3h3uM4tK2UOpocajtQM8Jcf8m+/9lDsmwa4DXAwbZC2S3B3/x0O4KtvX2ZLnA ekbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=aprAuOHeRGyn+jBRhUvlHOkPclRZMFhy+t5R/KiZU68=; b=lLPMQHnNWZPTJv3cbk8YRInuKQUwrM/glesGCQr3vJRdcn4L1PvlDyHbHNmOQS7mu/ u8VhYIySzbLYC9LvdMuwphQr0lpbym05Zw7OqyPRxXsQoIljmeMOxQzTEGfHCa5vR8Bv ZuQBuVJHjNqWtu7RkHUnO1jOXgkIrdB1qtUKOcpmbLDa3ikYGQaN44Xr9pLmqkCMLodY w6At3pnQiY0X/jQ0nO8KZPjxnVejFMAveSoz2QlR8F/dC/JBiz8uWGL7rdR7UnFnFQIb X4x9NQO1B/QrrMP28YLxxT62dy7y19e4a3/jTi3dUDPpa9ipQWjY/JdtP4QCYk9Dqf5p Rimw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c33-20020a634e21000000b003aa663f5451si7972150pgb.744.2022.04.29.16.29.52; Fri, 29 Apr 2022 16:30:08 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347690AbiD1NxH (ORCPT + 99 others); Thu, 28 Apr 2022 09:53:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbiD1NxG (ORCPT ); Thu, 28 Apr 2022 09:53:06 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2BC85B3C47 for ; Thu, 28 Apr 2022 06:49:52 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E905D1477; Thu, 28 Apr 2022 06:49:51 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AEB0A3F5A1; Thu, 28 Apr 2022 06:49:50 -0700 (PDT) Date: Thu, 28 Apr 2022 14:49:48 +0100 From: Cristian Marussi To: Sudeep Holla Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com Subject: Re: [PATCH 22/22] firmware: arm_scmi: Add SCMIv3.1 PERFORMANCE_LIMITS_SET checks Message-ID: References: <20220330150551.2573938-1-cristian.marussi@arm.com> <20220330150551.2573938-23-cristian.marussi@arm.com> <20220428131357.mbj5pksrnt5auotb@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220428131357.mbj5pksrnt5auotb@bogus> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Thu, Apr 28, 2022 at 02:13:57PM +0100, Sudeep Holla wrote: > On Wed, Mar 30, 2022 at 04:05:51PM +0100, Cristian Marussi wrote: > > Starting with SCMIv3.1, the PERFORMANCE_LIMITS_SET command allows a user > > to request only one between max and min ranges to be changed, while leaving > > the other untouched if set to zero in the request; anyway SCMIv3.1 states > > also explicitly that you cannot leave both of those unchanged (zeroed) when > > issuing such command: add a proper check for this condition. > > > > Signed-off-by: Cristian Marussi > > --- > > drivers/firmware/arm_scmi/perf.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c > > index 65ffda5495d6..8f4051aca220 100644 > > --- a/drivers/firmware/arm_scmi/perf.c > > +++ b/drivers/firmware/arm_scmi/perf.c > > @@ -423,6 +423,9 @@ static int scmi_perf_limits_set(const struct scmi_protocol_handle *ph, > > struct scmi_perf_info *pi = ph->get_priv(ph); > > struct perf_dom_info *dom = pi->dom_info + domain; > > > > + if (PROTOCOL_REV_MAJOR(pi->version) >= 0x3 && !max_perf && !min_perf) > > + return -EINVAL; > > + > > Do we really need the version check here ? I agree it was explicitly added > in v3.1, but it makes sense on any version really. No ? Indeed seemed a silly patch also to me but given that only in v3.1 it is explicitly stated that you cannot issue this command with both min and max ZEROED I though this could have broken older fw that allowed setting PERF_LIMITS_SET max=0 min=0 ....maybe overthought ... Thanks, Cristian