From patchwork Wed Aug 14 12:47:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 819327 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012051.outbound.protection.outlook.com [52.101.66.51]) (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 4C5E215C9; Wed, 14 Aug 2024 12:38:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723639139; cv=fail; b=av2322sCFnmmrFaNwbK4Lt5/KDQNx3zb6mc7qeF3Zr7JFQUJ87pQG2dnOlPwO9GNgNxyjBTTpc17kdM3SeJJL/Yz7zqkwDflTCzWP2mFJZHGZ/3s3qRIm30TYuee+BwL7kzcge5rhs+rTkTbdjf+nu84q7xnBTeQH0lNxeeUy5M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723639139; c=relaxed/simple; bh=hbQZ33KfTr7TmcNFv/iUiCeTw3z/GrjXiKz+smAKDqI=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=aY097XKsm8yPDXVJSCToKTECO5k0XzOfIDpdIONUB1t4NiX/mvX95AYO66wxHX9nJ2VKpd2xMaCVbG4gjZ6/GKM+lkjL3T4fnicrvWomOshUYBS+d6pLnC9b8LI90UmWHiggwgRgDy1PjtsGk4kc6ZhcSghP93nW7C5R/fUGksY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=jfzytGQn; arc=fail smtp.client-ip=52.101.66.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="jfzytGQn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K/xwTIaqMCzusXkMDrIFPd1fwa9O9mLZHXEhUIi8q0y9JXT58ULgl1g4r9jSzeu+o4L4lmhmqmf6U2KnEsa7uH1kqYsTXO5vIjbgOcr1vLuaKbszIcWeJFxCAmni+AcifEO2ZsvSaOyr3vtJNWsAyrywzPXOL47cff6oh0+eK+EsdWc+cUhwqD+GX3DoH+UjU3Fs16pdjh68NSPh3p34dIEAd3b6By+YxqLKfkOyjDCitGz30u913C2LWmDDUITmj3h7LbrhbMRPF14wgrIs5iJnqMrWuf1zaLFDeuXu1uKaGVNk40tFZ6DJM+wMJNaExQv28JA383XeGw72PFyZxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rZBER3YRZSUbF3bopuTiDF4EIeQWF0Xsrrp7C8nUgA0=; b=qIf+e8dtKtXfkuwHkcsjHttc3Ynpzjpnjpp3Uds6WJD+JlgGcJeBQo4GjKLYT3WYEFKsR35C/90wRzTvj8WWnfMDlCYCDYB9FC4ymNBBx/qTkl8RbTspgOVTyv7igYQkUXVFB9ZvjSFC0RNviVzb/F3bZ4Cb41GzCLMQgEVu7rNWxeGIJE/5CcRWiFih9M6ivaowAL+gwUk2u+vklITkxfaqZXwYetWHBT6wFQSzJrI7Pwj6J0P1lXx68eyV6hiTZi54VMhaixXeBx8W4MRBwzDPQO72X+cc1Tx0Ez1grrEtiqSa1J+/xE+WPv2Vr8N4A5eIatX1XLNeqR/2w3zOCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rZBER3YRZSUbF3bopuTiDF4EIeQWF0Xsrrp7C8nUgA0=; b=jfzytGQnfRSEcDUuBmopdrrR755Wm7QR9tUYJX/AWtETG06gKVdckp8dXrDd7m17jAwbRDsaO44wI7FrDZ1SmT/OEmRAvGU80fiDdeC9eTbf8sv7cIDr0Cme9zW7KPrHjGQpKHBZA0jmGA5lkQVgMUj86xZhbYjlbTPmGrRiDHJLAJDtr+18Rws2SMYInmNlXxs7dG74LTwYXsED3yIQyCuuUpe/ctZ6HqKq6FpEYNJQQdczHYNjFcJJ5XjgMNps++Qx47MfvJm2DvbNMzB27r6mJO6CXeXv0xl5nEsiTlnFgLMPoDniu6tIaZWqa6NpPR0AIH2gLPs39+Fafh1iCg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by GV1PR04MB10486.eurprd04.prod.outlook.com (2603:10a6:150:1d3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.17; Wed, 14 Aug 2024 12:38:53 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%6]) with mapi id 15.20.7849.019; Wed, 14 Aug 2024 12:38:53 +0000 From: "Peng Fan (OSS)" To: ulf.hansson@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Peng Fan , Stable@vger.kernel.org, Jacky Bai Subject: [PATCH V2] pmdomain: imx: wait SSAR when i.MX93 power domain on Date: Wed, 14 Aug 2024 20:47:40 +0800 Message-Id: <20240814124740.2778952-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SG2PR02CA0046.apcprd02.prod.outlook.com (2603:1096:3:18::34) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|GV1PR04MB10486:EE_ X-MS-Office365-Filtering-Correlation-Id: 68138a7f-eede-4b4b-bdbf-08dcbc5e0e0e X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|7416014|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: CN32gZoOIaYv4exeMJiIiccYMso1hRTvLV3dK/PEAvU5PCW6+byYf8Jui6ZS2VoeE3Xt3ZTXvvdZo/fzWyjF9B2mRKbpMdZi3jAx+LyxFx96d9Eax6uJAOEQx0PJOe2p2DBXRwETALUQBGePnvAF71bwoxmvnXLmpKJbo0bdV5mZC4qZh0V6FqBFzLXgCJ4saClK/lI2YdrPsFvqO8jDuDAxTvJPI9TYr6hwwE9MDdJvpIHn2gQbr6GJxge/V7TyKX1Pf02kc1gbKduIFAfe6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gTcvrcgwTvMPfIx/us2CEOmfnlsW8KvwTvttocjJNmmgFv0LRXUxUW2xYvjBRLuI1NodlVt5YecBKCKEKQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(7416014)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VN3LSGdXhBBhOCPL7Q1AMrDepZURhDx70kdUon4FwbnJCuO0tsI08hco3BVbUwwmyFu5iG6ja89o5FlhZU2TVL/KpD2IlELv0i0G7tVLLxIq6NfOUQGevvq6WxNLEbUXXg7XBy1QZv857kqkQxBuakTBFbOcgyH3WxTy9riY1dcsoGGwAREyX3Egdp78G60MLehlbVTp3GTokAZ2sRJAEx9BDjxkjIzhDdxg8BcmdZBpnqVlQUARLYwYgx5SHjj9sRnODZceP/jhKO09+J3kuc2ByM+ypwu8R5aJOUY6Vp+rP/lKKKcS+OASfhbM72T+TsLqXJDkUbZqfwwyxl/aPPcp+N2eolVobktyKDEk3/BDAzKFsMRv8wX4ZIE3Ihd8pPWXRsqiLBKRxOewxFGFnYG3j9jYq4Inw61e5aDqRqN1TWLXxWPNDaK5N4e2quOfQycQuJHIfwo+/BmJzmDmU+uPNzN1BJhY/z8OmY3WhNNcXTGR/trSvqlLLH1QLR4Lj3K/RXrt7lMmv1S/4A0DMpOe1v6FAqImeaU5OONV+psYPkig3OrU0Ibde9G9F1+6ws0c/ii0bvTTfzmjQnkrtVyfsr9RH/ZID/bLYxalRzxdfEWhHmZZh7Y8U862gZJuyziKaounx/NQH7W5RhXCJLi8dWe+mTFamcBdDCnlEDxYD5lbs8zlEIARHG1Efrv5tPXCVL/1AGNCkFxQajiv0M+ypseKrEFennDOkLcAbr3RoVwjh/RrhlTjpLnG4ZDByY7HvfSOG2Xj1R48WszNaXzcOOcK/0GNPaz8PtN3vH4l3Hau18MXbpxhbKXqVpOva//7IxZwq0IW009xj4ISosDYUtnwj4WLbF5v83ykzDJXLysAzNByvmRV12bmztOaRuni0FZitXTiX1rB74b5lNrbywnSbHXXJ7BZ0v1Wv+grlM0m5uea/aXcSQ1FuDGf6SJbJ7YhY2z1xHMNmxx91MEzdCpt6MKuGCYWKoGxipHgqV6Ap15nomL/mxD+nTaKovQ+yhgxGh8pCKh+TNgzcNvulvIuaIIT72fbVXfxg9ckrAlauvZMpxgTcL2Q17CkvQAXeRDYv1c5hwqqXG90/KOuCeu9o16c1Xto1Mt5KiivRaE+KNKtc56TS5WPTerltzL4SYTIWCeWdmfMzMV26aerCXC/Z4fMcnhd2ioCBK4HNhwBbNAsCKsQYnGZyJ7WsCn4ZEPiVZfgpZtPdV/jTO+M68BWBAlw/S9WzMR1qjke2OPffgqqXzT3Ak28ov+DyXroKu47RsNmiPfhhUKzFqQMfe4Wd08akGbif6N9+ebdctDOWowzwFqBZHtf6RHZmXhglDy319wvDQF1WWMGSAcfk0/Bjano67U6EdnXEWUs5sQb9r7H0ZGqwkpLDDYrEFm/yijyg+vXOo0aKeUW6e+kGvBvmnOc6T3deTgRzaExRxUEpIAmQbTUmS0D0WRLC7PaPtc1wjN6ppc7vtlVLFPWhHckOn7fNji4mbDhsmzZfaOgyXMSkVDcuhd2J+6Tcdl2eBRppwQtypY5kaBGvgmmFY8Dy3Sx5Jsz0Nt0MM3az8Phda3DbwpkTr0iSJtd X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68138a7f-eede-4b4b-bdbf-08dcbc5e0e0e X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 12:38:53.2605 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VHvqlYREoAGOXVkqjl5wJwYQegeP6meCpyebNZUbYs1ECI5MliM2+wKELk+YPw/9+lsJau2HbAc6E7cNpXxxkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10486 From: Peng Fan With "quiet" set in bootargs, there is power domain failure: "imx93_power_domain 44462400.power-domain: pd_off timeout: name: 44462400.power-domain, stat: 4" The current power on opertation takes ISO state as power on finished flag, but it is wrong. Before powering on operation really finishes, powering off comes and powering off will never finish because the last powering on still not finishes, so the following powering off actually not trigger hardware state machine to run. SSAR is the last step when powering on a domain, so need to wait SSAR done when powering on. Since EdgeLock Enclave(ELE) handshake is involved in the flow, enlarge the waiting time to 10ms for both on and off to avoid timeout. Cc: Fixes: 0a0f7cc25d4a ("soc: imx: add i.MX93 SRC power domain driver") Reviewed-by: Jacky Bai Signed-off-by: Peng Fan --- V2: Add Fixes tag and Cc stable (Per Ulf's comment) drivers/pmdomain/imx/imx93-pd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c index 1e94b499c19b..d750a7dc58d2 100644 --- a/drivers/pmdomain/imx/imx93-pd.c +++ b/drivers/pmdomain/imx/imx93-pd.c @@ -20,6 +20,7 @@ #define FUNC_STAT_PSW_STAT_MASK BIT(0) #define FUNC_STAT_RST_STAT_MASK BIT(2) #define FUNC_STAT_ISO_STAT_MASK BIT(4) +#define FUNC_STAT_SSAR_STAT_MASK BIT(8) struct imx93_power_domain { struct generic_pm_domain genpd; @@ -50,7 +51,7 @@ static int imx93_pd_on(struct generic_pm_domain *genpd) writel(val, addr + MIX_SLICE_SW_CTRL_OFF); ret = readl_poll_timeout(addr + MIX_FUNC_STAT_OFF, val, - !(val & FUNC_STAT_ISO_STAT_MASK), 1, 10000); + !(val & FUNC_STAT_SSAR_STAT_MASK), 1, 10000); if (ret) { dev_err(domain->dev, "pd_on timeout: name: %s, stat: %x\n", genpd->name, val); return ret; @@ -72,7 +73,7 @@ static int imx93_pd_off(struct generic_pm_domain *genpd) writel(val, addr + MIX_SLICE_SW_CTRL_OFF); ret = readl_poll_timeout(addr + MIX_FUNC_STAT_OFF, val, - val & FUNC_STAT_PSW_STAT_MASK, 1, 1000); + val & FUNC_STAT_PSW_STAT_MASK, 1, 10000); if (ret) { dev_err(domain->dev, "pd_off timeout: name: %s, stat: %x\n", genpd->name, val); return ret;