From patchwork Tue Nov 24 10:08:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 11927853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38964C56201 for ; Tue, 24 Nov 2020 10:26:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C7548206CA for ; Tue, 24 Nov 2020 10:26:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uoDROq2E"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="hKr6Dho5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7548206CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ihWpudLnaBSFgweYuthrT3SQ9MkHBADE2ztrUXWzyVQ=; b=uoDROq2EBViNvFUjqUqZt+MxT ZVjFvb8WMvnUUjq3Zr/kBjBSCuwu3r7NKzBQSlLLFIvJc0HYHXzRau6AtMH+lMjUKF44Sc6nIJ59O 6nQ2Grf0mI/APqNzOeBeMO0ZwmgsHBFAWPobSr1UYWTfQPED6a6XyWmyvcynWcOR9Knk6cx3jpaft VI1CB+f0hy5j7mo04wA8UUTiWeQURT6OWzMcArMZKYZX1PwF0kgD//uHvPS2P9R6XM4owVlopu8HJ N+MoRkZMexQW0ogrr0uhb/J34aKbN30m2jXB4+sVCtMB6bzy/dv7uojyo9vQ0p221cpdUxj4Z2VAw YkMhR3MJg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khVVw-0007Fd-Vo; Tue, 24 Nov 2020 10:25:37 +0000 Received: from mail-eopbgr80081.outbound.protection.outlook.com ([40.107.8.81] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khVVk-0007CS-D9 for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2020 10:25:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A9GnD1cvP8eL4fUnZKSsr6aiQRc22l+zzer6GNF+6yPkLjRKNph0IkrrkknEwIY4qFq6UKFeg51FzfsQlVhWithqK1HATcsajuBjilHNq8dlt0tOk62h0uJaQCMqzY/ZMcg5SzYzcESZ5iSu8ya/7w3aZEISpGoYUuuAqqdGiFdQ1aT5J0gBv3bt2HBMqf8ESB6g16sP9CXSerpbLHx6L8Z6IdvoOaCMonzxOc+L/m+ipkpwVMfNXHyii4dG0Xx4MNO36E9vZIMcWbW9TJc3y+S0bC/u/5O0uWjgLeTloKkXfsAZosTDndg1y+xD+qoq8P339Ra2/OAoNCLS071Nnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KvMRkDCfeNlAPS7G0tVx4+aMw2Oy3sipAg+1vj9PMxU=; b=m7H5W1vOrnlNSWd8O1pIDY92MgxiW6oeDCCbWakcogG+A7dZ+6xcFlKrFA4RFIwPZIJH3byIUM4OjQduOywYAh0xkgZYZz0Cs7vVloO/uTAI+cTv4pCpkFR1JWslZcV5I/lwqgfAqUwkewtZBcfRlwmRb4RF9wgBJSAQVNlarv0ZgZbB+l7B+A7R+d1lEt1SAylU/TO3QIzFDiIHfqFiGdmdgfNRxlut/flgfp002+rBNlVdw1OlsiEOhE2+/pt6+4XiJepqL5D5a/uC1PM0+gHHPphAuPc/7O0zlNrUGQ7OyJQCmxjgGwcp8aFtFu8mp5uOLWDpqYXbA9BOUE6JXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KvMRkDCfeNlAPS7G0tVx4+aMw2Oy3sipAg+1vj9PMxU=; b=hKr6Dho5ZyBUzrHPnzVhAmJkGFvZYNsNCHLfViuZN1k2/b0AIEWqP5hgWxbwejgzEGeAH9g+Y1HHg3HdEvyzrr/+CqVSyOQzcMs5gJXh4J3gidYTkp3LhIKoehBgYLatcxYsMBtFEBSUokUfs6LbMnz6YlG6a4Uia/0vDH4fAD0= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) by AM6PR0402MB3669.eurprd04.prod.outlook.com (2603:10a6:209:1a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.30; Tue, 24 Nov 2020 10:25:20 +0000 Received: from AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::3cfc:a92e:75ad:ce4a]) by AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::3cfc:a92e:75ad:ce4a%3]) with mapi id 15.20.3564.029; Tue, 24 Nov 2020 10:25:20 +0000 From: Dong Aisheng To: linux-clk@vger.kernel.org Subject: [PATCH 3/3] clk: imx: scu: defer probe if scu pd is still not ready Date: Tue, 24 Nov 2020 18:08:02 +0800 Message-Id: <20201124100802.22775-4-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201124100802.22775-1-aisheng.dong@nxp.com> References: <20201124100802.22775-1-aisheng.dong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR02CA0054.apcprd02.prod.outlook.com (2603:1096:4:54::18) To AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29396-OptiPlex-7040.ap.freescale.net (119.31.174.66) by SG2PR02CA0054.apcprd02.prod.outlook.com (2603:1096:4:54::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3589.20 via Frontend Transport; Tue, 24 Nov 2020 10:25:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1370c00a-911f-404d-51c9-08d890633e60 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3669: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ayva5iHH5q3OHbJcC7NstcgaOCO7AfOe1R5W1cUf4FPDTzbDI6RP8yGamtBzRAYzgDZgpEKU6v3BP4dKyK6YCX7Gp2HkO2PMYbN3DKxJcsfsDiYQtuRNW3GgWDEieeaGxMeERtsOVaZ7d0nIdCwKQwx7cbpkmbnPteJXguFmUqr6amGfyuPKX3HJg+PqrVD3zCtcicOzInbp01up8RAIRrBWqlBmJw8zEr+uUUJ1e6SP7M1rjL7pXFmyqo/3bhUWVj/egyGy31igVh0ghNiF1tUTuq/Zu5hSfTPD8PhfGNV3b7QqxAupIADWPINGUjxWqnIqYsugdDvBf1CJczf08g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4966.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(136003)(376002)(346002)(39860400002)(366004)(36756003)(2616005)(8676002)(52116002)(6486002)(6506007)(86362001)(1076003)(8936002)(956004)(6512007)(4744005)(478600001)(4326008)(316002)(186003)(6666004)(83380400001)(5660300002)(66946007)(66556008)(2906002)(6916009)(16526019)(26005)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: IXsyb0y/WwzbS/wh59hjDQ/W0mXPM7c73Ik7f2LNjKG1YsLFN5qRr63pAcAjAP6/TwRdX8CB3/KEzrrXd9LCebYbCZUELLwpRbxNrSwFPX86hz87Lz43pfim1hg49A8+3X96mzGtYbzVayQF88L/sv2MypV3Sbq0JinXw/4R8Rw/q7KWM02y8PPIYagZUx8XLsXmWWz9BiH3YZdqanB4yQePsHpnf1ttuc4I+FRjV2yCNNRWVksRKXmRKPxCO0glnsxkZvnM2vNL5SN10l4fcBgVsCG76mfN5ciXLWcPxhsQ7hIMa5924gcPn9gwOp7tx+uyL6D+16+/uXzj7ntfR3EHoFB7KE3bbX/WY4o1I0RvxOTSSbuPCQ/fD/6acdX6oFLhmoIIV4E0U4X3kFrJG7n7oBMIqyt3oEHy7DnQ1o9lnAklUj9haJIMiu7KDIBdPPhyt+LNu1vwzLT9U77HCaOfWNBjhJ562XIuQo3Dr+iyC+SHlGqvvUThP9DxJiup1xqCxxY/4WO9VQs9XrfYeQYRGi1T4lKgkFT//OfPrn6SXNYbV79CYDzNc1SWhDwSOwy8ZaNTxn9XPlPCAVOMDsz4wM+D+JgDKVjEGuAVH4NSFeLVdMoz39Gnlt/gWzPAqJT9r61YR/gb/NJyPp6wY/rGy0fSoTuYBTSOZpf7A2gKAnfn/XQgR49OnjAh2XYS04JUJSBRcDlp4z2M/8jp8pHbt2sH0l4e0sQHK8bKNBeCpaUiRc0UG0e59ViRS4qWHLLVm3WqQVYPiddj4yGUNySiDhciqdk/b6JPFgMte5shUP+MuFOTbsfw3aiIMSZfLpO0Mw4xBEQZeq3muvbyDQ2CQxiwpKwfquhqcSpkFc56Bw4l8e4LmgSrsMiBJf/GH6pWgC86aS6Sqbzge9JHlA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1370c00a-911f-404d-51c9-08d890633e60 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4966.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2020 10:25:20.3382 (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: Jw31xd8vPBxRWLAS4Egwqq6835Ji2jfC2hb/qtEyzopT+O+sIsLXSvn2TdFmQJh+hOKC8iZyj8lcm0lzfuBSTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3669 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201124_052524_562948_941E3DD8 X-CRM114-Status: GOOD ( 13.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , dongas86@gmail.com, linux-pm@vger.kernel.org, sboyd@kernel.org, linux-imx@nxp.com, shawnguo@kernel.org, sudipm.mukherjee@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The clocks registered by SCU clock protocol driver requires power domain to be ready first. Query the SCU PD status to support -EPROBE_DEFER properly. Signed-off-by: Dong Aisheng --- drivers/clk/imx/clk-scu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index 1f5518b7ab39..846201f9b72d 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -163,6 +163,9 @@ int imx_clk_scu_init(struct device_node *np) of_property_read_u32(np, "#clock-cells", &clk_cells); if (clk_cells == 2) { + if (!imx_scu_pd_is_initialized()) + return -EPROBE_DEFER; + for (i = 0; i < IMX_SC_R_LAST; i++) INIT_LIST_HEAD(&imx_scu_clks[i]);