Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3424127imm; Fri, 25 May 2018 05:36:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq80Hdq1irva+Q/Z27U8+EX3Y7rhNaPHmbnByibwpIyrlgb6O248uRkuQV/2GTfU9mNjyuO X-Received: by 2002:a65:4e85:: with SMTP id b5-v6mr1882145pgs.155.1527251767694; Fri, 25 May 2018 05:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527251767; cv=none; d=google.com; s=arc-20160816; b=RnD7impubedeAPmuUxVpe5dQ7UbJQ9j97zwuD82p5AEHhVZOvCCpErqZHvkgIKjjRx zQfZfm58DYr4pc36AQpLh2jw57mmtpg7ngEIMSC5Xt0mo/sR/Y76H0K6u7u4kTs/+5n9 GQJs2m2ocjWEr2V7NkUszDwvE582DvS1vTTbYcjm4mpIZH7m6HekQ+DQ3aHezOT0zw7F MaFkM1VyQmpFpvMhAfMeDQ8MMZ+q8j428m9vengSF7Lp55hUzo/o2Mzp6dVv4qZn5ulk 0qCR1JUkjFYZFLWgkgOq6oD/QuHGpHu3DXEuITvkd3a4bJYeZ9KuFwsWWFR/UDk+uC8d 3e4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=T0seJm/bDd3Ar87xCDRD0fKtD8WpbFPRke7xvGTJuy4=; b=TMjE6hN5BYp/LK1HXSE3msdMJMFd7QIZ7Cma7pc0C7AklzsTq+3Ck3ZkRltaQRDHU9 QRsQX0EHftWrcUjDf/ourAn7TfAFC46t2lhuCVPFOdGc+I7KmSN4hOqBhcdsyktHd7kU j+ZX3kPaPLEtz1CUOo/L7zN92f9/GU4iGJQkhh6or7r2TYgUx9oIwtwPO+Kck7F3j4O5 N08PSXg7MFuMWrmgqGfulbjTnvOMX6Fg1ZZDrpT9LKLQmQqZam5zh7VcyfvXh9NlXsaU rlJB50rXjFHbKhDcOkYze0MZL+hCEbPpBjRU9GuEniw1knChwBi9NOsAnqYXNsMLqyrK Ao8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g4qQ8OoJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w10-v6si23722424pfg.174.2018.05.25.05.35.52; Fri, 25 May 2018 05:36:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g4qQ8OoJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S933152AbeEYMeG (ORCPT + 99 others); Fri, 25 May 2018 08:34:06 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:35841 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752217AbeEYMeE (ORCPT ); Fri, 25 May 2018 08:34:04 -0400 Received: by mail-io0-f193.google.com with SMTP id d73-v6so6208997iog.3 for ; Fri, 25 May 2018 05:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=T0seJm/bDd3Ar87xCDRD0fKtD8WpbFPRke7xvGTJuy4=; b=g4qQ8OoJhVkkufpmZlv/gdA/csMSlRrRluYVu4JemGPLS3oExWibTV6y8R4Gvd8q5y vci3vrN9xUh1vBFaln66cd+IOMPHBySJbfM4dbF9gSLKv4Ed8OJTOg/0exg0LPyhVnRd uydDOq2TNETgGkeVmcd+8H/1Jj1kyzpTwv4zE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=T0seJm/bDd3Ar87xCDRD0fKtD8WpbFPRke7xvGTJuy4=; b=MvHE89+r8uRul0OqQqOH0NQf/IETra9K4H3vKxcPpmneEnILdaLzYPhXQQ8CowAxNt P72FHpHxdkoN+y5qm72U8KuSsAsSTK109T0/B4t/pzwBuFRmn4Z1oi7PgC807K+WWKf+ RRuKYCOFR2YHZhImLWY8I7z7cgZkUXQTnGehKjs+fLX4oYmdNejZPncqwuXQpNWRSsAf YCSPDYY6Al3NUhJ6EikjqMDA1NdwziXZx6mfw6wQxptGstzQ2hYmhGNAvYV7Sj/KyoIQ WOUq/53AeCYOPa+LZHdbEK5K4rdE9+dWWeKsqiq+OpXAVU3TaTygL5+4GKxNQdd2rjP+ wi0A== X-Gm-Message-State: ALKqPwfy3Ec3qOBi8l+rXvBiOoCNd9/nqGSCADAGFF8HxDr905KRFcfT 8MZBhTHsyrMvIzCkYZty7xtBTrfaBfgqF+0XlOIWuA== X-Received: by 2002:a6b:84a6:: with SMTP id o38-v6mr888057ioi.119.1527251643342; Fri, 25 May 2018 05:34:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:7353:0:0:0:0:0 with HTTP; Fri, 25 May 2018 05:34:02 -0700 (PDT) In-Reply-To: References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> <1526639490-12167-10-git-send-email-ulf.hansson@linaro.org> <1c21d18e-954a-f3a8-9817-0117b7cb7e4f@nvidia.com> <2c63af8c-4745-a751-8d3d-f7122e921e6f@nvidia.com> From: Ulf Hansson Date: Fri, 25 May 2018 14:34:02 +0200 Message-ID: Subject: Re: [PATCH 9/9] PM / Domains: Add dev_pm_domain_attach_by_id() to manage multi PM domains To: Jon Hunter Cc: "Rafael J . Wysocki" , Linux PM , Greg Kroah-Hartman , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , Linux Kernel Mailing List , Linux ARM , linux-tegra@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25 May 2018 at 13:07, Jon Hunter wrote: > > > On 25/05/18 11:45, Ulf Hansson wrote: > > ... > >>> Right, but this case still seems like an error. My understanding is that >>> only drivers will use this API directly and it will not be used by the >>> device driver core (unlike dev_pm_domain_attach), so if anyone calls this >>> attempting to attach another PM domain when one is already attached, they >>> are doing something wrong. >> >> >> [...] >> >> You may be right! >> >> What I was thinking of is whether multiple PM domains may be optional >> in some cases, but instead a PM domain have already been attached by >> dev_pm_domain_attach(), prior the driver starts to probe. >> >> Then, assuming we return an error for this case, that means the caller >> then need to check the dev->pm_domain pointer, prior calling >> dev_pm_domain_attach_by_id(). Wouldn't it? Perhaps that is more clear >> though? > > > IMO the driver should know whether is needs multiple power-domains or not > and if it needs multiple then it should just call > dev_pm_domain_attach_by_id() N times without needing to checking > dev->pm_domain first. If it fails then either the PM domain core did > something wrong or power-domains are missing from DT, but either way there > is an error, so let it fail. Right, sounds reasonable! Kind regards Uffe