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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 6E6DDC4338F for ; Wed, 11 Aug 2021 10:52:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54B8C60F22 for ; Wed, 11 Aug 2021 10:52:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237228AbhHKKxP (ORCPT ); Wed, 11 Aug 2021 06:53:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231678AbhHKKxJ (ORCPT ); Wed, 11 Aug 2021 06:53:09 -0400 Received: from mail-vk1-xa2a.google.com (mail-vk1-xa2a.google.com [IPv6:2607:f8b0:4864:20::a2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAF59C061798 for ; Wed, 11 Aug 2021 03:52:45 -0700 (PDT) Received: by mail-vk1-xa2a.google.com with SMTP id 11so531214vku.11 for ; Wed, 11 Aug 2021 03:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sY3RpgyWHBy4W+/+RqTX6YRD6atJotbsjKLoIW0AnuM=; b=SjhJcaaQaR3bgI6mINR8blfMfqZUZQAmUCU/WQ3q81hg9P2cOxROif/hBHMm6/9ceY dRziTDc9JhsHP61z3/Jxr5j4z7IAq7winn/bK3O8hhZwEddB7EXGz8OB3L6DfHOoZ3AT n6zZoxUuMoth29rN8nl303/N7OnapqmZrvtYm+RD7HemcoGCoFADnCvRw70rqcb5USsj uyN4mtHOby1fW5sYY5edXmV38mPNVhZKa99iyHwwPFFZKQM825yMi/LT6u48ICnn1mqJ O3OTqZmGpdEiDRoNnUVAMsNpkeY4PQPd8n2FjrlJRMJtqW5OXI+/X8XebO+zNsdT31hk BE8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sY3RpgyWHBy4W+/+RqTX6YRD6atJotbsjKLoIW0AnuM=; b=bNQPXgIiuuZv/E/Inka31vxt9rfYD9zf9OZxZtUWOwMFAsBt6Z4E+N1IBAn5MoARxa RY2+4bLKeOvoTY4lyeA96H1jOp/pAFddtQn+oHSbUAA/+MPIQAz01hczWA7segpvWZeU 9NDSvgKlQU2/FjQpDU15DFYy3VTX/DfyQA7Xy0cOqtF7iQg+SfTVPcA6C3XkrL4+iQbq SLqbQhEc4q/v0bHXE26eJNAVCHh/f3ccn899wmxlN7/W8rdJm5fMOGS+/utF8MknmO5g ZUS3ywfYUe/LsXGiUG87jAb26PiayBoGiEEWyg4Rq8lGRE7UemnyWrs3MO212zQixQuc /jdg== X-Gm-Message-State: AOAM533D9z6KrMQm5yGVKspdChR7rzTDB4oJpwXZvoddzB6SlX3RxFTH NSw0bhj9SDeXMFhxy9nD6ItJpsYRP7zQ6m+Fxz4arA== X-Google-Smtp-Source: ABdhPJw6de1+RpQzyeap5euW6di99KHadH4LfFdealqxrDMNt6WlC/H44W7aFvJAgVPTTMVBqd7cMsH+ul3pmXnd/Xc= X-Received: by 2002:a1f:1d94:: with SMTP id d142mr22071649vkd.6.1628679164996; Wed, 11 Aug 2021 03:52:44 -0700 (PDT) MIME-Version: 1.0 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> <20210811100749.kwg6435m7xj7ulwa@vireshk-i7> In-Reply-To: <20210811100749.kwg6435m7xj7ulwa@vireshk-i7> From: Ulf Hansson Date: Wed, 11 Aug 2021 12:52:08 +0200 Message-ID: Subject: Re: [PATCH v6 1/2] PM / Domains: Add support for 'required-opps' to set default perf state To: Viresh Kumar , Rajendra Nayak Cc: Bjorn Andersson , Linux PM , DTML , Linux Kernel Mailing List , linux-arm-msm , Stephen Boyd , Roja Rani Yarubandi , Stephan Gerhold Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Aug 2021 at 12:07, Viresh Kumar wrote: > > On 11-08-21, 15:30, Rajendra Nayak wrote: > > 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? > > The same check will be done by OPP core as well, so it is better to > optimize for the success case here. I will say, don't error out on > ENODEV, rest you know well. This should work, while I generally favor not having to parse for specific return codes. Another option is to add a new OPP OF helperfunction that just informs the caller whether the required-opps property exists (instead of open-coding that part), and if so, the caller can continue with of_get_required_opp_performance_state() and then expect it to succeed. I have no strong opinion though! Whatever works for me. Kind regards Uffe