Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2867257pxk; Mon, 28 Sep 2020 02:06:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzECPrgZ84kRI/LENDkusY1s8NJ94NHMAQe9LQMoQdQxkwcLb4oi0qC730VMtIPKa0hghbX X-Received: by 2002:a50:9b19:: with SMTP id o25mr573502edi.340.1601283962002; Mon, 28 Sep 2020 02:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601283961; cv=none; d=google.com; s=arc-20160816; b=SE20JtvUjhqiOngJcoIr/LWevid49ISla4iM3cEJNWnsK5TwjEtgWl5WFyvgbmroYZ V2a006hhhwwafBcHaRVWS0FURwK08QndHbLM8ZPNGeuMGkstDn4hC+8ZNz/ANvNsGnDV EI598KZ2dnDx23IZbcgsxrCAojcP8IfVZ8OaaXtLuul2OE0YW75ThYCmYKtfjDRFapvi oNADEVJ8plyksffhiYZod5DQkBQtxcETJxtqmPiCTYs6911hZDmapRgwCg3w7vtpuZcB Gm/ood0tVKIbsFGTZj7jbIzDoSuVZXssnQdQ69BfWsuhlZ9aIkB1f84gI0iovhOCskU/ b48Q== 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=S7pENcmmNgOoqlL1+ZG5YXU2ecSXuvsW0dZ6tL5rYFY=; b=bj44acw7MnbguKGrwm7crXcek96KDLqXBIJ60FdqA4+EQp97FZza2daSmbV6N+m9GM PY/8N860uClt1BHUStGhNnTi7ur5jdzCPbanfE2bZjHxkJ1pGZDpb2ktxXc9PwZ+gne3 7TQP83QFOe/fhSrNPA/UmFlAR+P6+rv2472ItfPo7P0a42gZK3ltLTvFFjuC7pMHg59E SYKJLjDG/9sL+pqaTMxmfgfJSamuGM1RP4vkczJybaDFKWRiaDwJiO2RgzP+PmBzG2YH NL7t2fNRcNyEIVsM6D/yM0z0KXG3vYeFRjh28nE7GHHjdDP5i9hP1/5H1cZbqmDrnrkT OUcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iqd29t5m; 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 s16si223588ejz.557.2020.09.28.02.05.38; Mon, 28 Sep 2020 02:06:01 -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=iqd29t5m; 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 S1726567AbgI1JEa (ORCPT + 99 others); Mon, 28 Sep 2020 05:04:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbgI1JE2 (ORCPT ); Mon, 28 Sep 2020 05:04:28 -0400 Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AF76C0613CE for ; Mon, 28 Sep 2020 02:04:28 -0700 (PDT) Received: by mail-vk1-xa43.google.com with SMTP id c63so1374631vkb.7 for ; Mon, 28 Sep 2020 02:04:28 -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=S7pENcmmNgOoqlL1+ZG5YXU2ecSXuvsW0dZ6tL5rYFY=; b=iqd29t5mDGOgpna+dqL33C997s6TDn5QnSW5JQ985xPlvVqWhqjJ3+MsFOzijTtu6n 2oXQ0eov4XdPLwRGfZDm+5jkLPNiYkJhccH0RmK7ZdLMV8cophAkURcQutBN5v8VLgNj t6lxjxwGkr4iQSEyVhfTIU+sM2FRd008Xy8uapCYwAapPl7ph5Pt3X1P+yHe2WJDz/G2 fnCP2PVWQZvU0UJzQSahopKJGCPQXFmeI2i8Pr0/9tNjrTzllqGCiAEQ8OqrO7rjILSP 9RRvUloZ3yo/feovRLhHw3bxDTOGfsEfFHRiOmy4S4ascfWtajKpCUQpl4DtZa0kru4k PK5Q== 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=S7pENcmmNgOoqlL1+ZG5YXU2ecSXuvsW0dZ6tL5rYFY=; b=Rv4gyL0FNBQVluaMQEo0cp4YnwjiaMles+yPTYnDdWzb7mi4bbYhWtrdkXcmhVKQkX DoXQlXsfT+EETzVppGd6tb8ZOINmxoAvPax3jpZchwje0ZgHoyahk8QU+HcUFPn7KzA/ YXehAIhMeqx5LiWQs/GufPa8B2Hb2rCxhDHjxoXJqbaUYnXliw85iU2QOJtVT/RNEGPC iP7ChBDp5aEr5QcZRksDuXih6Ow84VYpn1U4D6hk1MiYrdGQuLtcGlcp3fdNuTiz3hB9 f+MV15t7usT63g7Ua1OhGqBmDg5ki0SMUAAbOkfqMdCOeBliQ0hjRbBT/5Lt1NE6i4eF hhPg== X-Gm-Message-State: AOAM531n3NegEkUV4rCnYVPSR5X8NDg/UqR1spgSDyWDqnb+RpqpKX5i FPqA2Z2oiz/7Z1LA/eq6yDnvVseJR+4/wHGMGuXq/g== X-Received: by 2002:a1f:6ec4:: with SMTP id j187mr4294515vkc.15.1601283867298; Mon, 28 Sep 2020 02:04:27 -0700 (PDT) MIME-Version: 1.0 References: <20200924110449.329523-1-ulf.hansson@linaro.org> <20200924110449.329523-4-ulf.hansson@linaro.org> In-Reply-To: From: Ulf Hansson Date: Mon, 28 Sep 2020 11:03:51 +0200 Message-ID: Subject: Re: [PATCH v2 3/3] PM / Domains: Add support for PM domain on/off notifiers for genpd To: Peng Fan Cc: "Rafael J . Wysocki" , Kevin Hilman , "linux-pm@vger.kernel.org" , Sudeep Holla , Lorenzo Pieralisi , Daniel Lezcano , Lina Iyer , Lukasz Luba , Vincent Guittot , Stephen Boyd , Bjorn Andersson , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Sep 2020 at 16:30, Peng Fan wrote: > > > Subject: Re: [PATCH v2 3/3] PM / Domains: Add support for PM domain on/off > > notifiers for genpd > > > > On Fri, 25 Sep 2020 at 08:08, Peng Fan wrote: > > > > > > Hi Ulf, > > > > > > > Subject: [PATCH v2 3/3] PM / Domains: Add support for PM domain > > > > on/off notifiers for genpd > > > > > > > > A device may have specific HW constraints that must be obeyed to, > > > > before its corresponding PM domain (genpd) can be powered off - and > > > > vice verse at power on. These constraints can't be managed through > > > > the regular runtime PM based deployment for a device, because the > > > > access pattern for it, isn't always request based. In other words, > > > > using the runtime PM callbacks to deal with the constraints doesn't work > > for these cases. > > > > > > Could the notification be added before/after power on, and > > > before/after power off? not just after power on and before power off? > > > > > > Our SoC has a requirement that before power on/off the specific > > > module, the corresponding clk needs to be on to make sure the hardware > > > async bridge could finish handshake. > > > > Thanks for your comments! > > > > May I ask, to be sure - does the clock correspond to the genpd provider or is it > > a clock for the genpd consumer device? > > It is the clock for the genpd consumer device. > > > > > If the former, couldn't the clock be managed from the ->power_on|off() > > callbacks for the genpd provider? > > Sadly not former. > > Our current solution is to add a clock property to the power domain node(NXP ARM SIP > based power domain driver), and when power_on/off, we enable/disable the clocks. > > But we are moving to use SCMI power domain, and leave the clock in Linux, > Scmi power domain driver is a generic driver, and we are not able to mix clock > parts in the driver which is bad. > > Your patch gives me a light that if we could use notification to let consumer > device driver do the clock enable/disable for each power on and power off. > That would be great. Thanks for clarifying. Let me re-spin the patch to address your points. [...] Kind regards Uffe