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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DF34DC433EF for ; Mon, 6 Dec 2021 09:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/nfKxqrsJoc0s+wAAms4e5XysVCH1SNlRz3JZO4ndvk=; b=z8CVmYmPR9rxiS BjegecvIrPM9LB8ZOKsdwcncdndCCEyCgmrK1F4KHETH8P4DBPJvJhJ0tR0NJdjOTba2ApikRu7WZ CDVglR/EbKIYhk/gZ7G3L/Ei44q76qpR63FSVo+YODUzQIfA6ds2P4EOPl0wz2n9EnDCavcX6P79d Q+WVVBM001w//Y41VqEutA3z0RC3kkyZGoBeQNZzQh7mhx24f8l2jEKbTkVbZtNMxZnchh3fGQsRO av7XDR9WfikfVRxGxY9i24qCmZe2YCk3hBmV30iFoHS14KKtBKaHuFzy+HbbNGjJl7QjYhCQDrmcc feiy69sRtYUvhzCuVbsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muA1i-00373S-Py; Mon, 06 Dec 2021 09:11:14 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muA1E-0036uj-7W for linux-arm-kernel@lists.infradead.org; Mon, 06 Dec 2021 09:10:45 +0000 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1muA19-00028q-Uz; Mon, 06 Dec 2021 10:10:40 +0100 Message-ID: <575d2441945ef322f52068b9d8530fe16dd7f07d.camel@pengutronix.de> Subject: Re: [PATCH] soc: imx: gpcv2: Enable vpumix/dispmix to wait for handshake From: Lucas Stach To: Shawn Guo , Adam Ford Cc: linux-arm-kernel@lists.infradead.org, tharvey@gateworks.com, aford@beaconembedded.com, Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-kernel@vger.kernel.org Date: Mon, 06 Dec 2021 10:10:36 +0100 In-Reply-To: <20211206004549.GG4216@dragon> References: <20211120194900.1309914-1-aford173@gmail.com> <20211206004549.GG4216@dragon> User-Agent: Evolution 3.40.4 (3.40.4-1.fc34) MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_011044_324495_7CBA276B X-CRM114-Status: GOOD ( 33.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Shawn, Am Montag, dem 06.12.2021 um 08:45 +0800 schrieb Shawn Guo: > Hi Lucas, > > What's your take on this one? > Thanks for asking. This patch is incorrect. The handshake will only be completed once all the clocks for the ADB are enabled, which is done in the blk-ctrl driver. The blk-ctrl driver however can only do so _after_ the power-up sequence of the GPC domain is completed, so waiting for the handshake in the middle of the power-up sequence is not going to work for most of the GPC domains. Please drop this patch. Regards, Lucas > Shawn > > On Sat, Nov 20, 2021 at 01:49:00PM -0600, Adam Ford wrote: > > There is a comment in the code that states the driver needs to > > wait for the handshake, but it's only available when the bus > > has been enabled from the blk-ctrl. Since both the > > vpumix and dispmix are called from the blk-ctl, it seems > > reasonable to assume the bus is enabled. Add a bool to determine > > which power-domains are able to properly wait for this > > handshake and set the corresping boolean for the two domains > > activated by the blk-ctrl. > > > > Signed-off-by: Adam Ford > > > > diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c > > index 7b6dfa33dcb9..a957f7fff968 100644 > > --- a/drivers/soc/imx/gpcv2.c > > +++ b/drivers/soc/imx/gpcv2.c > > @@ -204,6 +204,7 @@ struct imx_pgc_domain { > > const int voltage; > > const bool keep_clocks; > > struct device *dev; > > + bool blkctrl_bus_enabled; > > }; > > > > struct imx_pgc_domain_data { > > @@ -282,17 +283,14 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) > > domain->bits.hskreq, domain->bits.hskreq); > > > > /* > > - * ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PWRHSK, reg_val, > > - * (reg_val & domain->bits.hskack), 0, > > - * USEC_PER_MSEC); > > - * Technically we need the commented code to wait handshake. But that needs > > - * the BLK-CTL module BUS clk-en bit being set. > > - * > > - * There is a separate BLK-CTL module and we will have such a driver for it, > > - * that driver will set the BUS clk-en bit and handshake will be triggered > > - * automatically there. Just add a delay and suppose the handshake finish > > - * after that. > > + * blkctrl_bus_enabled implies that the GPC is being invoked from a blk-ctrl > > + * and not from a peripheral or other GPC power domain. The blk-ctrl is required > > + * to support the handshake. > > */ > > + if (domain->blkctrl_bus_enabled) > > + ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PWRHSK, reg_val, > > + (reg_val & domain->bits.hskack), 0, > > + USEC_PER_MSEC); > > } > > > > /* Disable reset clocks for all devices in the domain */ > > @@ -701,6 +699,7 @@ static const struct imx_pgc_domain imx8mm_pgc_domains[] = { > > }, > > .pgc = BIT(IMX8MM_PGC_VPUMIX), > > .keep_clocks = true, > > + .blkctrl_bus_enabled = true, > > }, > > > > [IMX8MM_POWER_DOMAIN_VPUG1] = { > > @@ -749,6 +748,7 @@ static const struct imx_pgc_domain imx8mm_pgc_domains[] = { > > }, > > .pgc = BIT(IMX8MM_PGC_DISPMIX), > > .keep_clocks = true, > > + .blkctrl_bus_enabled = true, > > }, > > > > [IMX8MM_POWER_DOMAIN_MIPI] = { > > -- > > 2.32.0 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel