Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1349018rdb; Tue, 30 Jan 2024 16:19:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIQ4UDIepjI3FUoWzRI2IC/8cJMjVOG7XNsGtimKsNOZ5X3IXhUjMMeItXJfNAPpmR/gB8 X-Received: by 2002:a17:907:76e6:b0:a35:86ce:688a with SMTP id kg6-20020a17090776e600b00a3586ce688amr547590ejc.60.1706660380485; Tue, 30 Jan 2024 16:19:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706660380; cv=pass; d=google.com; s=arc-20160816; b=roqOWSkaTjogx1sXikk/0tcG4SXvoBdnwo8N7l1NPM+ADqSNPZHjyBVLi5Vi4wsmsy iQXTjqnV3vxA/KdLz5+O20ZfziThAWFmVEqblirGKLZTJYHSXDc42VKniRl8g2LaiesO aRt24gcSPw+hmKVP5oafsCCK0WbartbyGcJBFUkS4PpNDLFCrm0ahMtMF7sGtfyKQLwU hHipWyaAEflW4EoCMY4j+c6nbdQhLtrVpJj7tkhJqfPRzb4GasI9KbgJ3TU36AkaEiBM vH1Gotp0ER0TpeB0FdbhBVaj+TSxtCqTP7P2QR/lxy0Yn+6yAF5opr++lnPZq0vYkYfa xjTA== 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=Ts9kfBrkn1fhVRcRCojQJqGOIgTXmynXYX/YTYv6rVg=; fh=M6VA/GdCZVN174TN54vynke1F073s3eGFUt3gn7VtBQ=; b=Ncdtw4qRqeRbhr3Tw9teEhZVz6tT01mIO1ll74NG0H2betdNMOJH1H+sL73evuZVf8 U/j3T427JgxYz4HTUS++hbyU3tpz8ZKmi19dmJxtLyCXksKfFHfFLt6521AnwJI8zF5q Ew8P5E9ZtpYSSpLmLwZp7i4gQFL+2u9fhPz/nSBPKngx4Ufg+GfMFlV5Sxxbbqp//3r+ 6q9QrdF5BAg4J7jhGtgMDpd9VzunJsqe5Thv7RKRODt62XnHQl6j+galj7Hv8msij9Ax TqkQM+wt9WI8xA1zrCUOSiu2a4guBL4ADoTMH4XvphXL3V7w6Oi4bEmmVRfCJEl9f/nY CXRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="TP/DXvRA"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-45515-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXITVlcrwgLTN4Owe1HV0ytGGkyLyf/QaTSYXCIGjZHB9jfquRlXy+5VHWhqR2LY2F9Ag0CY2IzQ0PvPANUWe63RVR6d3NIv2hw8xuHsQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dt16-20020a170906b79000b00a3600b03138si1523401ejb.1003.2024.01.30.16.19.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 16:19:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45515-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="TP/DXvRA"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-45515-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3F64B1F25E12 for ; Wed, 31 Jan 2024 00:19:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C17DD804; Wed, 31 Jan 2024 00:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TP/DXvRA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D4C66363; Wed, 31 Jan 2024 00:19:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706660365; cv=none; b=LFQB+FGPFV+d2sV3TsQTCcutAtFn1OiqGBvAUh5ORtn3kIcAVqyofPuvienlCp7cWphtlYFYchYa9c+JfZyqOqf0srdws5A7yjFQP3iqkL3z2uufcjnFWGGWMXkNbUSVmKef5R5FLAd3QHAVeSuViO2TH72so9+GS6AAtn7qQ6Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706660365; c=relaxed/simple; bh=AUvmiiN2J4iUZBQtOTauNb4kWOolnYW+zkQQa/Z11CY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m3ihBn6YP6lX3YSXACUTQusQh0qS0I0yosKdrSPtZYSIw35Kfr+j9Ji8grWRSr/NtcPIaMNSpLTgLihdgGQVRu/VXhQlY6rFOTAaCJ6Q8YH5kNfNt9rjq8rq/yBh+MqFCnmJ7A6y8S137P5Xdj2gBZ3P8p9/gT9YuyXGyDJ4sMQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TP/DXvRA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF13CC433F1; Wed, 31 Jan 2024 00:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706660364; bh=AUvmiiN2J4iUZBQtOTauNb4kWOolnYW+zkQQa/Z11CY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TP/DXvRA3eH3jDc7yrTGi4ZABSlsTWSNsKaqLu9xMD6LXPJzNg+yGz9C44f2zvjQD H4pahFsQbu+q+xSx2BdVY8A87LmJaZ3JqNJhNcWyYvsVoVRle7Fuw8xFvvd7IhmxG3 QhaHVie17w3XVeV8JK8CfpuFH9I0ZC1WJGIoxv/XEruZVQIIJWS8w/fJwfhSZod+2+ +yRXX/WPeTIH+p9IqlXPEU0UVT4b6g2A1cHYWc3OXKh6G7N1r0ugGsNgNOEe3hHBs3 kBW37XJZt8DFdyVAH9fnkEpyBZsR8mgg3hzSGRNViU2PAgL3Sk7pVjBsOxkv+4qsjo M6kpw/rqkp2ew== Date: Tue, 30 Jan 2024 18:19:20 -0600 From: Bjorn Andersson To: Abel Vesa Cc: "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Greg Kroah-Hartman , Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Taniya Das , Jagadeesh Kona , Dmitry Baryshkov , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: Re: [PATCH v4 3/5] clk: qcom: gdsc: Add set and get hwmode callbacks to switch GDSC mode Message-ID: References: <20240122-gdsc-hwctrl-v4-0-9061e8a7aa07@linaro.org> <20240122-gdsc-hwctrl-v4-3-9061e8a7aa07@linaro.org> 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: On Tue, Jan 30, 2024 at 05:00:28PM -0600, Bjorn Andersson wrote: > On Mon, Jan 22, 2024 at 10:47:03AM +0200, Abel Vesa wrote: > > From: Jagadeesh Kona > > > > Add support for set and get hwmode callbacks to switch the GDSC between > > SW and HW modes. Currently, the GDSC is moved to HW control mode > > using HW_CTRL flag and if this flag is present, GDSC is moved to HW > > mode as part of GDSC enable itself. The intention is to keep the > > HW_CTRL flag functionality as is, since many older chipsets still use > > this flag. > > > > This provides insight into why we end up with both HW_CTRL and > HW_CTRL_TRIGGER. This doesn't describe why this change is needed, but > rather just an implementation detail. > > > But consumer drivers also require the GDSC mode to be switched dynamically > > at runtime based on requirement for certain usecases. Some of these > > usecases are switching the GDSC to SW mode to keep it ON during the > > enablement of clocks that are dependent on GDSC and while programming > > certain configurations that require GDSC to be ON. Introduce a new > > HW_CTRL_TRIGGER flag to register the set_hwmode_dev and get_hwmode_dev > > callbacks which allows the consumer drivers to switch the GDSC back and > > forth between HW/SW modes dynamically at runtime using new > > dev_pm_genpd_set_hwmode API. > > > > This still expresses the need for HW_CTRL_TRIGGER in terms of "some > drivers need for some use case". We don't need these many words to say: > "Introduce HW_CTRL_TRIGGER for client drivers that need it." > > > I find that it would be useful to document that every time a GDSC is > turned on the mode will be switched to SW... > I believe I'm wrong here. Reading the patch again, I think we might retain the mode across a disable/enable cycle. I at least don't see anything explicit returning us to SW mode. According to Linux though, the GDSC is off, so as described below, there will be no votes for supplying resources. Regards, Bjorn