From patchwork Fri Aug 26 19:13:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 12956563 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 7079AECAAA3 for ; Fri, 26 Aug 2022 19:33: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=M5AGAU6VMaVO4aMFSJ/E65gznryoIS5Zp5ji/rzGSHw=; b=khEGSYaebFHG3F +HzD9eEYOZ4WDA9AibIKsQwxtQjvAe3lXtd46GvyoM2GTU6PhSMWwF16NOz5bdiiKEo6eD6I1Pd90 f0Zmz9XLQyK7JJ0+pirOQ4II43dywlOaxZkv6RsCXG1cbsAxo8GCmcG+CM2kv1VEkFiFOAYF/TNU5 EnEm1BSVTVWHjX+75HGjCFhZgfwSxQah89Q4IIIw1RNY+DgQ9VxFlmmJFx2Q+WpwGbEHQL7y9WV76 pdjIeDet6/z7Y/sIHw3Jg67bEm2qGfjyfU8779aLEjeAu+rYi0YMhvH3HhojBzVKTlvSWEwbruOfd YOtTxQpqtk1y3h64KosA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRf4J-00Ai73-MZ; Fri, 26 Aug 2022 19:32:40 +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 1oRelT-00ATd6-K0 for linux-arm-kernel@lists.infradead.org; Fri, 26 Aug 2022 19:13:13 +0000 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1oRelO-0006jh-92; Fri, 26 Aug 2022 21:13:06 +0200 From: Lucas Stach To: Shawn Guo Cc: Fabio Estevam , NXP Linux Team , Peng Fan , Kieran Bingham , linux-arm-kernel@lists.infradead.org, patchwork-lst@pengutronix.de, kernel@pengutronix.de Subject: [PATCH 1/3] soc: imx: imx8mp-blk-ctrl: don't set power device name in Date: Fri, 26 Aug 2022 21:13:03 +0200 Message-Id: <20220826191305.3215706-1-l.stach@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 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-20220826_121311_734721_B6CC690B X-CRM114-Status: GOOD ( 11.22 ) 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 Setting the device name after it has been registered confuses the sysfs cleanup paths. This has already been fixed for the imx8m-blk-ctrl driver in b64b46fbaa1d ("Revert "soc: imx: imx8m-blk-ctrl: set power device name""), but the same problem exists in imx8mp-blk-ctrl. Fixes: 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl") Signed-off-by: Lucas Stach Reviewed-by: Peng Fan --- drivers/soc/imx/imx8mp-blk-ctrl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/soc/imx/imx8mp-blk-ctrl.c b/drivers/soc/imx/imx8mp-blk-ctrl.c index 4ca2ede6871b..9401df25c85a 100644 --- a/drivers/soc/imx/imx8mp-blk-ctrl.c +++ b/drivers/soc/imx/imx8mp-blk-ctrl.c @@ -529,7 +529,6 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev) ret = PTR_ERR(domain->power_dev); goto cleanup_pds; } - dev_set_name(domain->power_dev, "%s", data->name); domain->genpd.name = data->name; domain->genpd.power_on = imx8mp_blk_ctrl_power_on; From patchwork Fri Aug 26 19:13:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 12956562 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 0C9E7ECAAD6 for ; Fri, 26 Aug 2022 19:32:54 +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: 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: List-Owner; bh=hdwQk+2Y3Dof9pHHq8MSLOIPOki5k5JJlN0VQZLt/Ds=; b=bE2PNEZS2gg2xs b4x/rFp9bk2rXbbulsONCp6uxlOcKRgx5YzjZWTOKWxPz28HBCcEkv6N6qrc3zYj7DB/nAtbCg4d4 cBilyrwslXav3BHNmUo7zzbdfl8PsEJe9MBkbOyAI7G84+WMYzcHeBil0/ljzqzM9re8nFUEChw59 EYHIlIYPIzx92TUNlJ5Jx4n1t/S7B7KS4R8YoJl/Av8DsM71uYhCboU8yGrODI/Zrb8fX4P46ShIo QauFh5BxcLMCoulZkCe9Ioef8cbikjwdnS5eveph7VyQV1tMUS3I5kxVLdY7qrUv8QWCtCea4JaUF 5hpsoHhw66Ca5oLb6CXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRf3S-00AhbZ-Gv; Fri, 26 Aug 2022 19:31:46 +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 1oRelT-00ATdB-Jz for linux-arm-kernel@lists.infradead.org; Fri, 26 Aug 2022 19:13:14 +0000 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1oRelO-0006jh-Mv; Fri, 26 Aug 2022 21:13:06 +0200 From: Lucas Stach To: Shawn Guo Cc: Fabio Estevam , NXP Linux Team , Peng Fan , Kieran Bingham , linux-arm-kernel@lists.infradead.org, patchwork-lst@pengutronix.de, kernel@pengutronix.de Subject: [PATCH 2/3] soc: imx: imx8mp-blk-ctrl: enable global pixclk with HDMI_TX_PHY PD Date: Fri, 26 Aug 2022 21:13:04 +0200 Message-Id: <20220826191305.3215706-2-l.stach@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220826191305.3215706-1-l.stach@pengutronix.de> References: <20220826191305.3215706-1-l.stach@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 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-20220826_121311_726430_ED25D661 X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. 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 NXP internal information shows that the PHY refclk is gated by the GLOBAL_TX_PIX_CLK_EN bit, so to allow the PHY PLL to lock without the LCDIF being already active, tie this bit to the HDMI_TX_PHY power domain. Fixes: e3442022f543 ("soc: imx: add i.MX8MP HDMI blk-ctrl") Signed-off-by: Lucas Stach --- drivers/soc/imx/imx8mp-blk-ctrl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/soc/imx/imx8mp-blk-ctrl.c b/drivers/soc/imx/imx8mp-blk-ctrl.c index 9401df25c85a..73f672104aaa 100644 --- a/drivers/soc/imx/imx8mp-blk-ctrl.c +++ b/drivers/soc/imx/imx8mp-blk-ctrl.c @@ -192,7 +192,7 @@ static void imx8mp_hdmi_blk_ctrl_power_on(struct imx8mp_blk_ctrl *bc, break; case IMX8MP_HDMIBLK_PD_LCDIF: regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL0, - BIT(7) | BIT(16) | BIT(17) | BIT(18) | + BIT(16) | BIT(17) | BIT(18) | BIT(19) | BIT(20)); regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(11)); regmap_set_bits(bc->regmap, HDMI_RTX_RESET_CTL0, @@ -221,6 +221,7 @@ static void imx8mp_hdmi_blk_ctrl_power_on(struct imx8mp_blk_ctrl *bc, regmap_set_bits(bc->regmap, HDMI_TX_CONTROL0, BIT(1)); break; case IMX8MP_HDMIBLK_PD_HDMI_TX_PHY: + regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL0, BIT(7)); regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(22) | BIT(24)); regmap_set_bits(bc->regmap, HDMI_RTX_RESET_CTL0, BIT(12)); regmap_clear_bits(bc->regmap, HDMI_TX_CONTROL0, BIT(3)); @@ -243,7 +244,7 @@ static void imx8mp_hdmi_blk_ctrl_power_off(struct imx8mp_blk_ctrl *bc, BIT(4) | BIT(5) | BIT(6)); regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(11)); regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL0, - BIT(7) | BIT(16) | BIT(17) | BIT(18) | + BIT(16) | BIT(17) | BIT(18) | BIT(19) | BIT(20)); break; case IMX8MP_HDMIBLK_PD_PAI: @@ -271,6 +272,7 @@ static void imx8mp_hdmi_blk_ctrl_power_off(struct imx8mp_blk_ctrl *bc, case IMX8MP_HDMIBLK_PD_HDMI_TX_PHY: regmap_set_bits(bc->regmap, HDMI_TX_CONTROL0, BIT(3)); regmap_clear_bits(bc->regmap, HDMI_RTX_RESET_CTL0, BIT(12)); + regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL0, BIT(7)); regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(22) | BIT(24)); break; default: From patchwork Fri Aug 26 19:13:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 12956560 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 45DEBECAAA3 for ; Fri, 26 Aug 2022 19:32:03 +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: 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: List-Owner; bh=BVnws06OMn/c9NWydevxd0WuB4gqv1GuGmjf9bKotHg=; b=lpI7QOpVu9J8LE k5qH5CPPMEHoMDaJX8nnOJalaUvEfZzUFaYlKn55HVCA5b2FXgVU7f1c0JfDIlToRgLdzepgKF8DM V+V86lVBzfocg9FYa0+nVCrvmDyxMA40DiYZtELTKKzwuhHN5yEc8WVGyyxTG22Hx1WWuaK+Ag+w5 O/zgHYLpwaOVuyjLIFfq+MLwSHYJg+cTnpgDKfKUwmZ4CmWrmz62781/OH/3vUDKQgZM4R/f/SkZU 5V/ycJUmeIRL2iMDkhyv4Ax9l1hLBhaspXJS1B+yt3TOusb7Y7WIdqzyrw65u19lLHsk5Hupcw18f q+RuQVhO9cJn/rB4wPbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRf2g-00Ah6m-Vm; Fri, 26 Aug 2022 19:30:59 +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 1oRelT-00ATdT-TT for linux-arm-kernel@lists.infradead.org; Fri, 26 Aug 2022 19:13:14 +0000 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1oRelP-0006jh-4R; Fri, 26 Aug 2022 21:13:07 +0200 From: Lucas Stach To: Shawn Guo Cc: Fabio Estevam , NXP Linux Team , Peng Fan , Kieran Bingham , linux-arm-kernel@lists.infradead.org, patchwork-lst@pengutronix.de, kernel@pengutronix.de Subject: [PATCH 3/3] soc: imx: gpcv2: split PGC domain probe in two passes Date: Fri, 26 Aug 2022 21:13:05 +0200 Message-Id: <20220826191305.3215706-3-l.stach@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220826191305.3215706-1-l.stach@pengutronix.de> References: <20220826191305.3215706-1-l.stach@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 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-20220826_121312_006431_DE439F2A 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 Since 5a46079a9645 ("PM: domains: Delete usage of driver_deferred_probe_check_state()") power domain consumers attached by the driver core do not support probe deferral anymore, as it is assumed that they are only probed after the provider is present, as a devlink should have been established between the two. With the GPCv2 and its slightly unusual mix between platform devices and DT description for the PGC domains, devlink fails to add the neccessary probe dependency. Now that probe deferral is not an option anymore, the domain drivers for nested GPC domains simply fail to probe, leaving parts of the SoC unusable. Rather than trying to teach devlink about our one-off usage of DT and platform devices, just split the registration of the nested power domains into a second pass, so that we never need any dependency handling. Fixes: 5a46079a9645 ("PM: domains: Delete usage of driver_deferred_probe_check_state()") Signed-off-by: Lucas Stach --- drivers/soc/imx/gpcv2.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 6383a4edc360..d1bbadbcb034 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -1446,7 +1446,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev) struct device_node *pgc_np, *np; struct regmap *regmap; void __iomem *base; - int ret; + int ret, pass = 0; pgc_np = of_get_child_by_name(dev->of_node, "pgc"); if (!pgc_np) { @@ -1465,7 +1465,16 @@ static int imx_gpcv2_probe(struct platform_device *pdev) return ret; } + /* + * Run two passes for the registration of the PGC domain platform + * devices: first all devices that are not part of a power-domain + * themselves, then all the others. This avoids -EPROBE_DEFER being + * returned for nested domains, that need their parent PGC domains + * to be present on probe. + */ +again: for_each_child_of_node(pgc_np, np) { + bool child_domain = of_property_read_bool(np, "power-domains"); struct platform_device *pd_pdev; struct imx_pgc_domain *domain; u32 domain_index; @@ -1473,6 +1482,9 @@ static int imx_gpcv2_probe(struct platform_device *pdev) if (!of_device_is_available(np)) continue; + if ((pass == 0 && child_domain) || (pass == 1 && !child_domain)) + continue; + ret = of_property_read_u32(np, "reg", &domain_index); if (ret) { dev_err(dev, "Failed to read 'reg' property\n"); @@ -1522,6 +1534,11 @@ static int imx_gpcv2_probe(struct platform_device *pdev) } } + if (pass == 0) { + pass++; + goto again; + } + return 0; }