Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3051535ybi; Mon, 10 Jun 2019 03:32:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqygT7C5aoEKT+eI+arCWmO8WwxV8m1+SnF0YNHumt4UkQaGdWRkDbpJ8KS0zQ+NImXJDU4J X-Received: by 2002:a62:b405:: with SMTP id h5mr71652920pfn.85.1560162771029; Mon, 10 Jun 2019 03:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560162771; cv=none; d=google.com; s=arc-20160816; b=rmR/CYC4YejSvY8FC6GI6s/0RpVFB3uTDC6hUit/Izd3ewDp4lr1pJnccXrWiSsAfI RHlh43LgEq+zrtaX3qVOJ/ukOhxZOdEfj8kXMgtdJOUy2IPhbcjj3dYC21nLLOLQORgk U9R7hUBKw7mGyfE7qAN9NFt9MAyoD9p6PvQ/XT/jK/LKkT/el2GRULcBdQeHzSrGqr+U GeGz403ckyoU3Wna9qLQeVoUA2n7AtSgF0sGkxjbAhEbu7gR/bN0f/F2bFnTWeORSNjc kTrQTD/zXieP+qa4hMbxa+KiWKc+lOPuNgxRO86QhVweXvolziVAIoaO5Bj1VcKyLHSE XToQ== 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 :in-reply-to:references:mime-version:dkim-signature; bh=pFMIIVsyJBl8LZ+WUnN+JflDTkBBRBPq/m9+UsHc1js=; b=d/k72JbHVZ4NHcPTg4kbpL/uqqGB6peHsu9vBJyussxmwkvSXBLU6eX/1M0ZWPkWoI WL1VWMgRMZvPQkGKCS3zrGMFjwRBdk8xEJ/hjRmIZzW6YynZ6qduvOtRTAXM5WcxoT2T ULHsrfauhhSw05Kx2ZIEb+BO1RvDOPnCmkaDCnHFvovzL4T5jz/y1bD6r1PbxzAK0mJG bsCNyyEbcyIWuIZJZ4ZE0F6APZAhS6YUhTNcX7zZSi8klo4XQyJ2uDUYRHlXGBKcw/Nn ViLE2n2mHm9PmRLMqzlsEoz5BAW2lb7V+4LXkpx50rBKlgUH9M0SPPLyVHF/Owhg78oa xLhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kOl0u/Rh"; 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 q17si9050929pll.285.2019.06.10.03.32.35; Mon, 10 Jun 2019 03:32:51 -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="kOl0u/Rh"; 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 S2389392AbfFJKWY (ORCPT + 99 others); Mon, 10 Jun 2019 06:22:24 -0400 Received: from mail-vs1-f67.google.com ([209.85.217.67]:35000 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388937AbfFJKWY (ORCPT ); Mon, 10 Jun 2019 06:22:24 -0400 Received: by mail-vs1-f67.google.com with SMTP id u124so4979176vsu.2 for ; Mon, 10 Jun 2019 03:22:23 -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=pFMIIVsyJBl8LZ+WUnN+JflDTkBBRBPq/m9+UsHc1js=; b=kOl0u/Rhe57ubEv7N22/9aZ//K3tjzZfW3Py8ox3gbRPJ6UjiUgoBGpilHmu/nCgmF Ll1a6TJ7+gn0FAn103tRUjuk892mvZfOsB00cLYygk5yPXdQvJrPnZIpzYG3zXELtLMJ NLCtkLm8RZc0kCi5TJQfbd9CP/i/0rIJmiJvP1UXVlh0gR4m02y3koKodB6L+b382pE0 M3zkVPlISPXoI3B7+3H/4zEB5JxriVTdDltIcyAUw50l/asQ0SrKbfQjTlnP9OKVTAjE njP6gb75FZQe1lldrnZ7yn8rRe+wgtVpTZ0/WmG3SePMX0wfqy+bDDbLj459+WuP2TPZ aefQ== 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=pFMIIVsyJBl8LZ+WUnN+JflDTkBBRBPq/m9+UsHc1js=; b=GrMESPKt9BlQHWMLe3hp78ZmZA+TNaMXlYsBnjFPe+g4rdUgIOUpBfKzUT0/+kwc/l syQEEWKln4vT2rvWPfpc8N287YJm+e+kbcRocjf5oWqtUto/VETWeIsvnL9mdW5n58ZA qC8VFMWdZTMK6ftNl7cuuKfNqUnQd5mTRo265BaJkO3sAKSNKpUP9FNxEPPKm92E3JlF Hs6FtbvRQPLLAH+WdrbWGkOz25kpTP2iDPD9HlRuynxS2wOHDvDlSRNNMJgVB3mIOqQv 8GbBfyp9v7RUeavjz1Eu+9aelBOutPILMJBCKj1p7BmziZpBh2kbFEZqrl3b93QAWF+s CPtQ== X-Gm-Message-State: APjAAAUOvCSONrgBO0cZvRfgyRID8+cbf56mDupkvlaXfOVfvAKMEbb+ vxuy39iPcE4RdGP6X0oFBHEFkbYYuR/mihCF/AX9vA== X-Received: by 2002:a67:ebc5:: with SMTP id y5mr24379568vso.34.1560162143163; Mon, 10 Jun 2019 03:22:23 -0700 (PDT) MIME-Version: 1.0 References: <20190513192300.653-1-ulf.hansson@linaro.org> <20190513192300.653-16-ulf.hansson@linaro.org> <20190607153114.GI15577@e107155-lin> In-Reply-To: <20190607153114.GI15577@e107155-lin> From: Ulf Hansson Date: Mon, 10 Jun 2019 12:21:47 +0200 Message-ID: Subject: Re: [PATCH 15/18] drivers: firmware: psci: Support CPU hotplug for the hierarchical model To: Sudeep Holla Cc: Lorenzo Pieralisi , Mark Rutland , Linux ARM , "Rafael J . Wysocki" , Daniel Lezcano , "Raju P . L . S . S . S . N" , Amit Kucheria , Bjorn Andersson , Stephen Boyd , Niklas Cassel , Tony Lindgren , Kevin Hilman , Lina Iyer , Viresh Kumar , Vincent Guittot , Geert Uytterhoeven , Souvik Chakravarty , Linux PM , linux-arm-msm , Linux Kernel Mailing List 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 Fri, 7 Jun 2019 at 17:31, Sudeep Holla wrote: > > On Mon, May 13, 2019 at 09:22:57PM +0200, Ulf Hansson wrote: > > When the hierarchical CPU topology is used and when a CPU has been put > > offline (hotplug), that same CPU prevents its PM domain and thus also > > potential master PM domains, from being powered off. This is because genpd > > observes the CPU's attached device as being active from a runtime PM point > > of view. > > > > To deal with this, let's decrease the runtime PM usage count by calling > > pm_runtime_put_sync_suspend() of the attached struct device when putting > > the CPU offline. Consequentially, we must then increase the runtime PM > > usage count, while putting the CPU online again. > > > > Why is this firmware/driver specific ? Why can't this be dealt in core > pm-domain ? I am concerned that if any other architectures or firmware > method decides to use this feature, this need to be duplicated there. What is the core pm-domain? Do you refer to the generic PM domain (genpd), no? In such case, this is not the job of genpd, but rather the opposite (to *monitor* the reference count). > > The way I see this is pure reference counting and is hardware/firmware/ > driver agnostic and can be made generic. As stated in the another reply, I would rather start with having more things driver specific rather than generic. Later on we can always consider to move/split things, when there are more users. In this particular case, the runtime PM reference counting is done on the struct device*, that genpd returned via dev_pm_domain_attach_by_name(). And because dev_pm_domain_attach_by_name() is called from PSCI code, I decided to keep this struct device* internal to PSCI. Kind regards Uffe