From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 113C4C4338F for ; Wed, 11 Aug 2021 10:01:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCBEA60F11 for ; Wed, 11 Aug 2021 10:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236805AbhHKKBf (ORCPT ); Wed, 11 Aug 2021 06:01:35 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:45311 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236797AbhHKKBf (ORCPT ); Wed, 11 Aug 2021 06:01:35 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1628676071; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=YsRXRW60o9vyHLLImrko8sF08vcveheFzhu6/n2s0+Y=; b=obiwAA8K4wTIW9gUaYidDFlTknBLP1Z3lQX7mldZc61nVsccf9QSjuzQCP+ndU4Qm5yDxvX7 eYCWlssfqg6dgdqq1esG83YBgabsy8vaUs/0tZJvqf7rIF7qLCVU8+Ms9lcLoMMqGUYR4co8 zjzpoACRu+9qv8MGKXX2XdO2c7k= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-west-2.postgun.com with SMTP id 61139fd5f746c298d96b87aa (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 11 Aug 2021 10:00:52 GMT Sender: rnayak=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7E28FC433F1; Wed, 11 Aug 2021 10:00:52 +0000 (UTC) Received: from [192.168.1.100] (unknown [49.207.220.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak) by smtp.codeaurora.org (Postfix) with ESMTPSA id 89553C433F1; Wed, 11 Aug 2021 10:00:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 89553C433F1 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=rnayak@codeaurora.org Subject: Re: [PATCH v6 1/2] PM / Domains: Add support for 'required-opps' to set default perf state To: Viresh Kumar Cc: Ulf Hansson , Bjorn Andersson , Linux PM , DTML , Linux Kernel Mailing List , linux-arm-msm , Stephen Boyd , Roja Rani Yarubandi , Stephan Gerhold References: <1628074696-7979-1-git-send-email-rnayak@codeaurora.org> <1628074696-7979-2-git-send-email-rnayak@codeaurora.org> <2afd0fac-ed28-c090-a345-3fd4284b4125@codeaurora.org> <20210810024308.gurvzpbe2bc2bhky@vireshk-i7> From: Rajendra Nayak Message-ID: Date: Wed, 11 Aug 2021 15:30:46 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210810024308.gurvzpbe2bc2bhky@vireshk-i7> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 8/10/2021 8:13 AM, Viresh Kumar wrote: > On 09-08-21, 16:38, Rajendra Nayak wrote: >> Sure, I can do that, apart from the error print, the function currently also >> returns a -EINVAL in case of the missing 'required-opps', are we suggesting >> we change that to not return an error also? > > No. > >> Since this is completely optional in the device node, we would want the function to >> ideally not return error and only do so in case 'required-opps' exists and the >> translation to performance state fails. > > Not really. The function should return failure if the property isn't > there, but it shouldn't be EINVAL but ENODEV. In my case I don't want to error out if the property is missing, I want to error out only when the property exists but can't be translated into a performance state. So currently I check if the property exists and *only then* try to translate it, Ulf asked me to skip the check. If I do that and I call of_get_required_opp_performance_state() unconditionally, and if it errors out I will need to put in additional logic (check for return value of ENODEV) to distinguish between the property-does-not-exist vs property-exists-but-cannot-be-translated case. It just seems more straight-forward to call this only when the property exists, Ulf? -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation