Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1063586iob; Thu, 28 Apr 2022 18:08:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHYSkYqDDG3R1sx4PYk4zI3N2dXFQesIAZO0Z7WTxjUDXn/wpOvqZ5YcYCNoD5k84q70iw X-Received: by 2002:a17:903:41d1:b0:15d:45d8:8f77 with SMTP id u17-20020a17090341d100b0015d45d88f77mr13802069ple.25.1651194510254; Thu, 28 Apr 2022 18:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651194510; cv=none; d=google.com; s=arc-20160816; b=0XMxxCjxBmzt7ojIdCcFrLSvUAE6hAcaqLU4Es7yNmNyT8c4C3Pn2pjNXD7EHVxfnM tYqneBD1U5gWa8fP0rKbvxG94+XK6ed5h3GXB6m9KS81q5tdRnR2fIDNfWd+3YGgUMAc 9yIYI4vJCYPxhrZXwQXhsvjG5ZgLFMAQnWI5hgpHPQnoH6av/OyFbZ1xKKHTAHFxajeS tp63R/8TWkMHKf0d1O165C3da9l4P/7TyGjgtX0Elaz8ySSkD/LQc69+Pwzo0RjhKYaN nGe/cgGeJ6NQXyizCCYNQ10n8qcMmridYI6mSi02hFR7jLODSo/eDfXnxRA2GFh9Fm1w CDng== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XxanPSSrG29kVl18HvG/B4L1gc5bSKaJbbjwX1Cvc7M=; b=fQLx/VfZ7v5xBXtNyTAVmz/MirriUQoeecItOvufvQHrHPzJv6iHB2/NhoDVIGo1J1 hCZ0uBlswtoIMRw7Osqi+3sDCbiPq7ReZ+gNPKG0HVhIxLG6wWm5s/eoAWfN99C8Kr1Z E7hbnl/vD6QoJGhuo/mcN3/rXcUo6IjIyA3aLlLYsIeTfmf5C2E8mPTvJDAPVXumw8NZ cJmPTFO9zea2VChteBevjZ8FeHTP++iWOZiTWBeu2UyQlKEqP5ozofzut1CXD40TU8KW +DOtLR0YeU3frkKvA8kBZDtKpi8eFaLfaUMyi7cwu+PV953RVUJPOvZhSZD7e3LuKjxr FVyw== 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 9-20020a631149000000b003c13fbd29d1si5873959pgr.217.2022.04.28.18.08.14; Thu, 28 Apr 2022 18:08:30 -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 S1347724AbiD1Nz7 (ORCPT + 99 others); Thu, 28 Apr 2022 09:55:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347725AbiD1Nz4 (ORCPT ); Thu, 28 Apr 2022 09:55:56 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C8CF2B42D9 for ; Thu, 28 Apr 2022 06:52:40 -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 8AAAD1474; Thu, 28 Apr 2022 06:52:40 -0700 (PDT) Received: from bogus (unknown [10.57.11.83]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 637AF3F5A1; Thu, 28 Apr 2022 06:52:38 -0700 (PDT) Date: Thu, 28 Apr 2022 14:52:33 +0100 From: Sudeep Holla To: Cristian Marussi 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, Sudeep Holla , 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: <20220428135233.r2yzwgr5uxex7vox@bogus> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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:49:48PM +0100, Cristian Marussi wrote: > 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 ... Hmm, let's keep it unconditional for now. We can add if someone reports broken firmware. BTW there are no users in the kernel ????. -- Regards, Sudeep