Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2123858pxb; Mon, 11 Jan 2021 01:15:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyifEr/JD7ZgoUASPDiaIcNpUgonJ6eymB/DkdvOxfb6JdwvVDeJhx8V9MQYGJvQo1Zse3N X-Received: by 2002:a17:906:351a:: with SMTP id r26mr9638585eja.409.1610356504636; Mon, 11 Jan 2021 01:15:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610356504; cv=none; d=google.com; s=arc-20160816; b=eJbY3xxWk5JsOqlWsAnzBa9DGOI0k+fhJ92VsrwHZUdy0JkuuZPpi2uLeulxj0j80D 3mXXPlLrOqPJoLBu3MSzvlBMLZjYzFdaS0N7omtpUDZtOUKYOb/wDvVIGbzXIyUbHwyP yIN7rB4+N1Pl5bp6fDJGXZM50hlj6LOB+/AbarhZ0SNxlGYCRg2njsUrL4/dr3mpZfWs p0q4fWrBDwKdzxFlXX7gij3etv/ibrYFebQwJvA1kBYbbb6cjREZpEgwNOuz5bo9ZqR2 5+VpmzycZGnSK9nuJwq50QqHagBdl7NzCoBQ1J/gmSe34jS63lWFfhd36F1RU2wXTbmg 4L4g== 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=rzsqb244fAIaB0c3Hwq/Q8yeHQrbTVz3BLbnT43mepE=; b=HfNfMHxwqD6wzP3zNC9+zMw0wMDITxPFfnG4j0yOQK09G5smM3gK7SXbluY+/agvQj HxJgnhLK1yguEb5TQXs76QZTykv4Axy9iBQ12yOyxYDOAruR4GTRXc8ga3GAnMUzFICh utIAC4NUM0cP6LRoc6Oku/AWs1KW0mAArkho+1xInQKRr3T7VtXKh1aw/M+9MQoIFvQW lNEUMPINZ/9zkzdzrMmRp4rhhdOqBchwpDDR6nx9YvNuISCeecHiFAPQ2TODjSME4Hyr 3wimxtNIoTRjH7J0sExmzrr3D8yqB/tpZ3lAupVPqK6SXKiR71QpybxAPA+5+Rxo6sAT wlFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RpjsJo01; 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 e26si6954171edr.610.2021.01.11.01.14.40; Mon, 11 Jan 2021 01:15:04 -0800 (PST) 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=RpjsJo01; 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 S1728059AbhAKJLy (ORCPT + 99 others); Mon, 11 Jan 2021 04:11:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727967AbhAKJLy (ORCPT ); Mon, 11 Jan 2021 04:11:54 -0500 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 029C5C061794 for ; Mon, 11 Jan 2021 01:11:13 -0800 (PST) Received: by mail-vs1-xe35.google.com with SMTP id z16so9310186vsp.5 for ; Mon, 11 Jan 2021 01:11:13 -0800 (PST) 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=rzsqb244fAIaB0c3Hwq/Q8yeHQrbTVz3BLbnT43mepE=; b=RpjsJo01PdFt62gzMkdlO86lMnwyovgap9eY12cGxMf3hDn8GwbNuVluZLOvm1JEo9 dXxUa1/loNb8fF2e5MZDtxUm5+sa6RX3psbO8UbyGN6o6zSp+eUPCGrj/kvdAtkpqZrM TFFI+Q/fVHNTx2BG2y3lf4l8dgDIcnb8PVidXWvsNrXkktt1CWr0ma6rD8UtTyfixOzd t5eCg0nJXTm9eOeN0W2xLdBx1itJBAeIoGmtNjgIUBSEM4MYqWfzOBr211UAPKsWvhi5 7T3npWvl/XQFa5vIMaheXCf0kdHsjstZz4lCl8GxnidCnh036wvkcdIoRpAzJhXKnWGt 2Rww== 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=rzsqb244fAIaB0c3Hwq/Q8yeHQrbTVz3BLbnT43mepE=; b=oY9apN4Loq9VMJZaZVlg/5/wYCDcUICmI6aKGcf3257of29q1ePTJRRuxdj2ItLvE9 bgZ2pzMjpmV1bj8RcxfXE/8tRMaIzxa/Q/C88XGb1ygFkrB7DpZqdoOWZLc751vaaYkS kNSKN+40Yn6oDAZkTynDxcs/c0anEAo6oXF2jpqMhGumKgGmym/vDpYly/4bBT7QYWae E7O6E1/OM6Yr/mLUZL2zBbjXQxQViZskPbOOXUzWm0p9DUEH/wodPTylmxBcZMUVLTHI vPRcfOsag7y4s1UTWB+TmUmK/KQW+vbmNoI6iAYjtK00Kfh3bxQrr57pcSi/jJ6T8zQY IeYw== X-Gm-Message-State: AOAM5316kolrbWknbroD3hHl65xEfdLBMH7FOBo3UETzZ35MB+CaGkKB si9MIvmhOq9EV3eXMNtgRVcLQRN+P0RNKp3kWP1T7vdSoSN7HQ== X-Received: by 2002:a67:e286:: with SMTP id g6mr12425479vsf.42.1610356272969; Mon, 11 Jan 2021 01:11:12 -0800 (PST) MIME-Version: 1.0 References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-21-digetx@gmail.com> In-Reply-To: <20201217180638.22748-21-digetx@gmail.com> From: Ulf Hansson Date: Mon, 11 Jan 2021 10:10:36 +0100 Message-ID: Subject: Re: [PATCH v2 20/48] PM: domains: Make set_performance_state() callback optional To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , "Rafael J. Wysocki" , Kevin Hilman , Peter De Schrijver , Viresh Kumar , Linux Kernel Mailing List , linux-tegra Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 17 Dec 2020 at 19:07, Dmitry Osipenko wrote: > > Make set_performance_state() callback optional in order to remove the > need from power domain drivers to implement a dummy callback. If callback > isn't implemented by a GENPD driver, then the performance state is passed > to the parent domain. > > Signed-off-by: Dmitry Osipenko Reviewed-by: Ulf Hansson This should be ready to be picked up, but maybe it's easier if you could send this to the linux-pm mailing list separately. Then Rafael can pick it up. Kind regards Uffe > --- > drivers/base/power/domain.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c > index 9a14eedacb92..a3e1bfc233d4 100644 > --- a/drivers/base/power/domain.c > +++ b/drivers/base/power/domain.c > @@ -339,9 +339,11 @@ static int _genpd_set_performance_state(struct generic_pm_domain *genpd, > goto err; > } > > - ret = genpd->set_performance_state(genpd, state); > - if (ret) > - goto err; > + if (genpd->set_performance_state) { > + ret = genpd->set_performance_state(genpd, state); > + if (ret) > + goto err; > + } > > genpd->performance_state = state; > return 0; > @@ -399,9 +401,6 @@ int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state) > if (!genpd) > return -ENODEV; > > - if (unlikely(!genpd->set_performance_state)) > - return -EINVAL; > - > if (WARN_ON(!dev->power.subsys_data || > !dev->power.subsys_data->domain_data)) > return -EINVAL; > -- > 2.29.2 >