Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3087390ybi; Mon, 10 Jun 2019 04:14:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwFTJy0l8sJuAFe1gX273ta8idh+RquqdM9da/a8+Pzz2uIIWVXrKPNbJmYX1WIqk5x327 X-Received: by 2002:a65:64d9:: with SMTP id t25mr15237478pgv.130.1560165274678; Mon, 10 Jun 2019 04:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560165274; cv=none; d=google.com; s=arc-20160816; b=Lu2E4vrTN4M0chxhzsvrP19th/nnGFv01jcJXknelXPEHS+KytokaDWEIVv/CZuDED s93mDXD7JWL1L6NjeE+GgNbAcabStxA3KtwAZ/yxC4yt2oxez6uoGJaubZirYKYl8XHP cMJeDkQFxYBM0KHTz4+VCk1VsEJUJYmLr4D9NkgFMfj5Ib2Gqmy3i//CJIm/A3MpDz9X Wc0LgYhduERXNu71LvVYd4mIRChGoSU5QBq0uFZ7ZOMjkv1hOVhMwwS+BuJHBShq9JsI enD73UlDFKZvQffFaM3eMRnsJ6JWVX3fF2/Tg7y0kGCetvbwESNvr3AtEerqcaOqrQme iIXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NXqeo1LbFJSL+1LCaAfKzqEZKFONY9X3pV9ONG9ouiQ=; b=ZcD1UgTDvdLLy7R3pHOdH13wpxraOdG31xV64O2VF7vQWhgKuucobgjG+Ip9kmgswG BK5Q4V4by2dzDqracqmEulSAohD/OCscFAMegbSHIBdyUU6JqnYThdFMwijfORfqXNre JM+aIc3pl+ypagYAzVgvOeDqAk4G3zO8pPU0iXfY+zBZBTlHtrOa8chd0i1HJS+tjxaM B7BKnRvii2p6omG/GtFPoN8i5T7aGTRPElr7FoTMdl9mtnXSsTrsKmCurubh1eeuZyAB S5Q1S//wMxUrZ3qIgyBS5oyck6Xx6W7xWIylASl+VvSgo6OGEJ2ahg2jxEWJSwSqnmUo KhBg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13si9196500pgv.398.2019.06.10.04.14.18; Mon, 10 Jun 2019 04:14:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389378AbfFJLC5 (ORCPT + 99 others); Mon, 10 Jun 2019 07:02:57 -0400 Received: from foss.arm.com ([217.140.110.172]:40672 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388982AbfFJLC4 (ORCPT ); Mon, 10 Jun 2019 07:02:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC8F6337; Mon, 10 Jun 2019 04:02:55 -0700 (PDT) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB2553F557; Mon, 10 Jun 2019 04:04:34 -0700 (PDT) Date: Mon, 10 Jun 2019 12:02:50 +0100 From: Sudeep Holla To: Ulf Hansson 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 , Sudeep Holla , Linux PM , linux-arm-msm , Linux Kernel Mailing List Subject: Re: [PATCH 15/18] drivers: firmware: psci: Support CPU hotplug for the hierarchical model Message-ID: <20190610110250.GD26602@e107155-lin> References: <20190513192300.653-1-ulf.hansson@linaro.org> <20190513192300.653-16-ulf.hansson@linaro.org> <20190607153114.GI15577@e107155-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 10, 2019 at 12:21:47PM +0200, Ulf Hansson wrote: > 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? > Sorry for my bad choice of names. I just wrote names as I understand rather than looking for exact match. But yes, I meant generic place where such ref-counting is done currently for other things. > In such case, this is not the job of genpd, but rather the opposite > (to *monitor* the reference count). > OK, I need to understand that then. > > > > 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. Sure, I understand your intent. I have just mentioned my thoughts/comments as I reviewed. -- Regards, Sudeep