From patchwork Sat Nov 20 19:49:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 12693199 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 A5550C433EF for ; Sat, 20 Nov 2021 19:50:52 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9CZFMTKcr1BcdiDUxCvnEHcIWZErCGY/OpKmR2Da5zc=; b=iz8yB5UXLI82TR oMxD6lhVHLSrUhHMRbjPCxNycr8PXhDXeWhpv2lsBQ4Sttqzi9Pt2sWjuKA/BkS2qoDcJvuHO/x8o wFADd8TgM89qH4I9z9KJ1emSh+8JEuOJ2UTtXyM3HCUPc7Wr5ymkg2Vi8Zs4yHUvucYjkG5BPmMVN KFed9NznyZn1wbwjik4VY5Rc1+sZTnl3mHQBqayD4JCa0sC4hor3Z+WJf7GhQzgHKCnrKZLGd7t8g KfD56jcgp2d3NbbU9g6WKJ/H7dkPMq+PQPqaWaxVvcc8s60rvH8Cb+JMXAoHrK3BX3tdR1CVdf6tq Z4ka8+zkPJst2b96UzAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1moWMN-00CtyM-2W; Sat, 20 Nov 2021 19:49:15 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1moWMI-00Ctxu-TV for linux-arm-kernel@lists.infradead.org; Sat, 20 Nov 2021 19:49:12 +0000 Received: by mail-io1-xd29.google.com with SMTP id 14so17573658ioe.2 for ; Sat, 20 Nov 2021 11:49:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hr4it2Nu4JOURKxzXa2x66i2A/MiAQxWQ0LABh8nC9s=; b=LgTTv3lPW8Wx3HL2Tz4NpYsq5aSAdjeMRmMKb2XLhhk65VUIVH4BlC8LwL4VaNvkEi RDhnNuzVnjhyE9TGrxzi9XnfITPglhvylhyx+YFlCO5KA9KoLg+qW7o9iVZdfm6IOCVQ YsLQTcVU8G5R0QXn555PHvKhFJybQSIF671pMaPSXmwiApjV23yyrD3wvvSy2JEssewA ccdTJivH/hJqC5JR3ghJ8SDcaUB+2dTF5WG7aOQVrfCHPl0ozvMtvJVZvGdobn7H7uHJ h7e/IoZjA5xSGx7nyYSrGnr7B2SYbzrFdxmd+6Pw1k+eWuyenmblCzxHNEsR3buDLUcF ZO2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hr4it2Nu4JOURKxzXa2x66i2A/MiAQxWQ0LABh8nC9s=; b=SMtJOegH8Z57vqkNVW/iFaBMiku6ZZJnAkkMS1MuPM4GaGUZDzqqzTfwiF07dSKFkc A9z+XEyVNN8f+pvxged70eq3E4yOmLu1FaQq6tqW3Leq4UvTy3k226X2Qq/Ni+VqrmuK ucOAMhLMKhx1bqCvZjFN6CMZZNyu8v/zmDs6B+GEgXRKR32OwOpafBEklXLn1gWcPrHY fkVw3ynLlHHBDWhRqM0Dz8UHhVRkagu+7HUrpwYy0oCEawmpJpfgenKxmSUKKmGHpvUw f+C3agu8FGJ0q1vT6spb7Wsrj+qHrrrs/rBPI6bs3WJfn9gcyrOxIZrLnsNDN2ZmDpGB //rQ== X-Gm-Message-State: AOAM532Mb5zQceomA7OV1lhAljoQv2e1SzAUrQ0JpEx1mkgbsPVQ+/e+ 4f4yToeosJpUG/P4wn4QVxUSXqiHAINeZ3Xk X-Google-Smtp-Source: ABdhPJw48jx7b9hQD9iYukk5NV4yS382dP5h4GcVdBRMUFcLeSv+9EqhCIfaMjnRdQKNFIzPo1+yfw== X-Received: by 2002:a05:6638:2512:: with SMTP id v18mr35514340jat.22.1637437749356; Sat, 20 Nov 2021 11:49:09 -0800 (PST) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:de9c:9e61:8791:1fd7]) by smtp.gmail.com with ESMTPSA id t6sm2135976ils.44.2021.11.20.11.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Nov 2021 11:49:08 -0800 (PST) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: tharvey@gateworks.com, aford@beaconembedded.com, Adam Ford , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-kernel@vger.kernel.org Subject: [PATCH] soc: imx: gpcv2: Enable vpumix/dispmix to wait for handshake Date: Sat, 20 Nov 2021 13:49:00 -0600 Message-Id: <20211120194900.1309914-1-aford173@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211120_114910_993718_EA4CCCCA X-CRM114-Status: GOOD ( 17.76 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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] = {