From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32811C282DD for ; Mon, 10 Jun 2019 10:22:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 083C22085A for ; Mon, 10 Jun 2019 10:22:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kOl0u/Rh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389386AbfFJKWY (ORCPT ); Mon, 10 Jun 2019 06:22:24 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:40110 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389171AbfFJKWY (ORCPT ); Mon, 10 Jun 2019 06:22:24 -0400 Received: by mail-vs1-f65.google.com with SMTP id a186so3065944vsd.7 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=hIV96gE6AU+htVKoXdocHYC5y0x/jHxCVUry9faa2K61vej939cJrAFdXDYdWefeIs FW4WN47QeP+2+0Pwv2Ps5jbAo/0XWlcdy3HGVF2Afg/pVKqjlO3zan9FaABabfT8QK5D BxjuuXyyzBUUnt84oZoD/uKnIe2oqkfR/Ggc1jHly4ZS1U2AQJpyrLdyeMo15+/3io4R y0jQbufY6aHYcMoa9DxlRlFJ/WnF0HMHlT5sFA3iN29/9zhu5Bdg8afX2JgcfZFHkhks 3oXfyo14kSEygAeqdA8TcRDLApKX9QykwJleZDz3mCf6FtKCqlB/udXMZHnoxMa/bvlw uKrw== X-Gm-Message-State: APjAAAU7moKSNtoD9n4O0tWkvinAj9OOUNw1wZwLmLyZmoM9EXPmtCdw T4Edfgnboyq8njYkfgSYgxrJZU3IuZeKTxlwLCuCiA== X-Google-Smtp-Source: APXvYqxDX2qJsmmcFSXEA/D7lgBIhL5BcM//GZ2Awrb+ANPG1PdpnIRRbG98Nj437OF6HC5C/S/rLx9BEVMrPwv/lGw= 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, T_DKIMWL_WL_HIGH autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5E98C282DD for ; Mon, 10 Jun 2019 10:22:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A3B1C206BA for ; Mon, 10 Jun 2019 10:22:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZySBd+AB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kOl0u/Rh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3B1C206BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L4FULRAgq9YuzdKkhhP+keR2blkw37rrtnMNpCdicP4=; b=ZySBd+ABrxcrUg U/Hh4EbWnbeUicbQzkKVQT+a4GhGLL72l+MUhCjbhZu5jDtDCW0zeaBz78muKe/5lyN1+5wDHaRTU xLUIJ5mM2L0u5jPDUviXdipQPWA2IIFJqC5RtKPu9/nOHz24r/CagxmsNXBLjtt0Xw2WPfPlE9SjL lMNBdw3yq05E/sl3W8p1HUYZxLzrP9vcndnqK7f5VsdcOfBfYEFRzOKVdgdErdCdrtbRkw5JE4ySA mSYuSNGj7WuTnJ26gFwx/VG1cSHeCPXKbLnzqoDxErX1/M6W6teDturqY4UOwDrIDdJtK/xw2A12a CqYDMDnXM6J2LKfNBXng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haHRr-0004II-NQ; Mon, 10 Jun 2019 10:22:43 +0000 Received: from mail-vs1-xe43.google.com ([2607:f8b0:4864:20::e43]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haHRY-00040b-Cz for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2019 10:22:27 +0000 Received: by mail-vs1-xe43.google.com with SMTP id n21so4949330vsp.12 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=JPcj/PgqhjWdAIGfVssnZ6dIolCNi8a039AU15LWeq+BjpH+qGjDcqFwTqG2O230af nw/WZ0LiP+ypsZwTo7MhR3nAoAmDfvOJ0DFW/muOU9pTNfyKO5vzSTueqFt1Ya4pTdOK 3xgJHvM6Bp7sSW+6ATL/37SC+N0pik6dyjzTS+kGffmtaFEfaDEPTAee84UMXp4KF1lD fZ1vDt2yKPWF3v+3s8Z1kQfr9SYlxwz1GeQCF2HgoAh78xNedp2o0kzTfBqE0geS657n +52WIGp87xaK/5pnzEr0IzTagn7AgBotoINmz9YVksqxKOpfydI048qSltYu2/bUE3BH hMfw== X-Gm-Message-State: APjAAAVLkkqNeWwpJR+gxqqjSSquKwVdnUPa1en/4nS18NeDRUcYLfbJ QovQo3UtZNVrGl0L9vxxHKBhNsmH9vyZcIvJcBRuiQ== X-Google-Smtp-Source: APXvYqxDX2qJsmmcFSXEA/D7lgBIhL5BcM//GZ2Awrb+ANPG1PdpnIRRbG98Nj437OF6HC5C/S/rLx9BEVMrPwv/lGw= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_032224_556277_26A018F8 X-CRM114-Status: GOOD ( 16.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Lorenzo Pieralisi , Geert Uytterhoeven , Kevin Hilman , Stephen Boyd , Viresh Kumar , Linux PM , Daniel Lezcano , "Rafael J . Wysocki" , Linux Kernel Mailing List , Amit Kucheria , Bjorn Andersson , Tony Lindgren , Lina Iyer , linux-arm-msm , Niklas Cassel , Souvik Chakravarty , "Raju P . L . S . S . S . N" , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel