Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4339649pxt; Wed, 11 Aug 2021 03:55:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxbxmz2YQBlW1F4R7J/T/tpklKcKYUYUfLElKmzKkhNdOJWP6eYSFzLBvukpyL32HRDJI6 X-Received: by 2002:a17:906:fcd7:: with SMTP id qx23mr3028818ejb.267.1628679304102; Wed, 11 Aug 2021 03:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628679304; cv=none; d=google.com; s=arc-20160816; b=LzJFO1FchWhlOzr0fiUBGoF9mBCX46OqghzobkpBPaAqQoju1c4Fa2ytGVL4DxOPVf nwADnQOGj/EnTgdfLVtQt9GI0oy4x9ssKSEMYDY8qRYXFmzoz4RfiZbtQWY1wbLELbmp jcBbmGsVlTWKiBtmlD9YQpM491SD386DrqMbGFapWUj4LiLlc6o76u3f4TlevH1wsgqe 3Zvn5xwII9NRxQ7bHwKioEs8N2lktIhobFoHDG09ng8sNm6wHAu5GRqT4gzZu4pTcEmk Jb7bno7vXx3i4X7g8WWNGboom3JTVseoXYpsj7WCxBqQwOGc6unQ9tcIwri+zrFe3I9E JVqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sY3RpgyWHBy4W+/+RqTX6YRD6atJotbsjKLoIW0AnuM=; b=HTm+cyU71i4bq5zqmDs2wGnbuiwbC37pA/HLN/wX5N0VKxO0dPDkbyLaD7JCyLoqPN 9kF8gO1K2CONynHWjx9+kyF9WITw3s7MUsSbG4Dz+2uGjbxsKCuColE2HzIklJNDUVlg OUTYpoxJNhfC3DqZ3CknJxutBEQxh54nynGNbPK/pAwXMMESDCsIHBWNLnZY1DbpKFEs u8jqvrVEy2XoaL8TTViFMPSs1g6fznPBM2r9DiR3DPsfQpZKy2rAU3beQpsEpnEpnlI7 xH3PLvgJAEGdUsQlIMTSxssqvgf3vhzACFWermayndq/T1REHhCz8mBdT7TNStlMeJUz z7nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SjhJcaaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si23479153ejz.402.2021.08.11.03.54.40; Wed, 11 Aug 2021 03:55:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SjhJcaaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237226AbhHKKxM (ORCPT + 99 others); Wed, 11 Aug 2021 06:53:12 -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-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