Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp45953lqt; Mon, 18 Mar 2024 00:09:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUyHbIJ94Lqs9AM9LekHuL1YDA+9tgPktaOsqs9q1iwjyN/1Bz6gbC9+3NL/q5gWwkPLDvxedTnksLK7Tty88EmBYsstLXOHMxAq4+t3A== X-Google-Smtp-Source: AGHT+IFbsVT8YJj3vfd2mzMdGAekXb+BqkPLYDR+FxmIxcfZOM6znr2l1i6vgO78qWh2EOdopy/a X-Received: by 2002:ac8:4f05:0:b0:430:d8a0:c27a with SMTP id b5-20020ac84f05000000b00430d8a0c27amr722223qte.12.1710745785369; Mon, 18 Mar 2024 00:09:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710745785; cv=pass; d=google.com; s=arc-20160816; b=uCEeFzGW/JVZaOGzJNSFT9P9mgV876dN8aOLN8FoglEt8QLWn/Jznl972b3rWjmFPi DDfDWA7AOzo8jM7skfXZvlI3pslHgjrsixEEKOmfRwS6noxeW4OyWkO83+66uohdrQ7P Mz7xfRHarBfBVxuunVMeWj9XLMFPvK2/AZH1htdwOi2LtKQsAEozsdh97yfBZ1Gc6zV9 jKvhKSoqI8Q+M8rV8idCq5unZ075WsyiQHU/6S2OiRy8zudh2p89VqEtNndK3MGanwHF n5rz0lUqVtAHHNp5JRRBGmVCXlDdFM79Ib86lQLo0azgg/xQzJXKjSo6VF99Xz86wu+T /t1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eb0Ccz7HpZ5APiazpAPXMBC/gybVlUfHgyxFsx8OJ5c=; fh=8H9FOzZkyTQOFtaBVsMfkqSVOup+YLMDvSxEfw53iXI=; b=Xmu3PxdWxHjBH8ZzzXjgCQ/RGGAbVwT07P8K55gvQR4Tl7tYCwAwNObEgpKbmsvvXD ZT3Nt32pkm9RHUCu5mgDnl+45OyRxaK59GxrmOJntL4tOSxkoS+b9btcO+Y1pwKoN2Ax tNcuNtqlvXPKmmDA8r2ptnmtHsuN19JYiRDQlr6H8K/a8BAg3se2gDAzKb3eVwvqI8U+ qLC6kQxoFbSIf0xybxOP6xx/acRGBfCoIUQKektkhjxx/uto0egN+AbH7JOFuGQ7jtNL M3WoeZgs/r4iLaTc52I7S3ZHTJtgGlbKN1j+c+GWIPBprT7y+tkEuTiIapIzHvgfjE97 MyiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=YSB4ad8t; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-105758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t19-20020ac85893000000b0042f4b70543asi1570588qta.60.2024.03.18.00.09.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 00:09:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=YSB4ad8t; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-105758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1CFF71C20E22 for ; Mon, 18 Mar 2024 07:09:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0C3D22619; Mon, 18 Mar 2024 07:09:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="YSB4ad8t" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E33661CA89; Mon, 18 Mar 2024 07:09:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710745771; cv=none; b=DNBbtI3J41DcqyrsNLUFNQ/4wK5GEBDw6parujusd4sPKv71xDJAEJ3u+59PG2Pkejoj6l0XXxrouyWecjS7ChV052JV5Icx0YSBImf50LyJMC8rE5W7yEBxXsXj64gO1SyTL73HVI8WvPFuUs2CEu/meRhV847LrM7XubgKRhg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710745771; c=relaxed/simple; bh=uuwFTLvyMNqlpKTyNz8SdpNe0H6SFIIuVGNRpJwqqGc=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YcR1UTTBG77dSKEY9RwEyxbdza8G8TaWfkFQKETB8I541JIVsVK6sQg+GRNOcYH7mUTbbkOgJPeWbK5IIZg8zygD1iVJEZf9K7ENjmgDSCePzCuI9qxu8Xd1xcBGzcnZubrgRjD5xEeBelK/MVEXCt1/sM/EUYsMfUkWPyAgyvs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=YSB4ad8t; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 42I63EYF085045; Mon, 18 Mar 2024 01:03:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1710741794; bh=eb0Ccz7HpZ5APiazpAPXMBC/gybVlUfHgyxFsx8OJ5c=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=YSB4ad8t69Xt6z8Q9rUY7EPVPxlrBq3REXebtcGlwp2Xm9RDgJhWweHPSkviZerXB sECEHphpbqVd6gYcEzGnykTJsRuqoFIEyjiUgvEoZmz51wvOS+gqLTJH9eanEIJrXb 51pd1marzgijpu8vVM65WjCMxGNME2Yx2hb6+A9o= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 42I63EkG002963 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 18 Mar 2024 01:03:14 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 18 Mar 2024 01:03:14 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 18 Mar 2024 01:03:14 -0500 Received: from localhost (dhruva.dhcp.ti.com [172.24.227.68]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 42I63DLB033059; Mon, 18 Mar 2024 01:03:14 -0500 Date: Mon, 18 Mar 2024 11:33:12 +0530 From: Dhruva Gole To: Jagadeesh Kona CC: "Rafael J . Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Andy Gross , Stephen Boyd , Stanimir Varbanov , Vikash Garodia , "Bryan O'Donoghue" , Mauro Carvalho Chehab , Dmitry Baryshkov , Abel Vesa , Taniya Das , , , , , , Imran Shaik , Ajit Pandey Subject: Re: [PATCH V5 1/5] PM: domains: Allow devices attached to genpd to be managed by HW Message-ID: <20240318060312.z5pk4roz6uqhwosc@dhruva> References: <20240315111046.22136-1-quic_jkona@quicinc.com> <20240315111046.22136-2-quic_jkona@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240315111046.22136-2-quic_jkona@quicinc.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On Mar 15, 2024 at 16:40:42 +0530, Jagadeesh Kona wrote: > From: Ulf Hansson > > Some power-domains may be capable of relying on the HW to control the power > for a device that's hooked up to it. Typically, for these kinds of > configurations the consumer driver should be able to change the behavior of > power domain at runtime, control the power domain in SW mode for certain > configurations and handover the control to HW mode for other usecases. > > To allow a consumer driver to change the behaviour of the PM domain for its > device, let's provide a new function, dev_pm_genpd_set_hwmode(). Moreover, > let's add a corresponding optional genpd callback, ->set_hwmode_dev(), > which the genpd provider should implement if it can support switching > between HW controlled mode and SW controlled mode. Similarly, add the > dev_pm_genpd_get_hwmode() to allow consumers to read the current mode and > its corresponding optional genpd callback, ->get_hwmode_dev(), which the > genpd provider can also implement to synchronize the initial HW mode > state in genpd_add_device() by reading back the mode from the hardware. > > Signed-off-by: Ulf Hansson > Signed-off-by: Abel Vesa > Signed-off-by: Jagadeesh Kona > Reviewed-by: Dmitry Baryshkov > --- > drivers/pmdomain/core.c | 64 +++++++++++++++++++++++++++++++++++++++ > include/linux/pm_domain.h | 17 +++++++++++ > 2 files changed, 81 insertions(+) > LGTM! Reviewed-by: Dhruva Gole -- Best regards, Dhruva